[mapguide-commits] r5644 - in trunk/Tools/Maestro: Maestro.Base/Services Maestro.Editors/FeatureSource/Providers/Wms

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Mar 21 06:08:23 EDT 2011


Author: jng
Date: 2011-03-21 03:08:22 -0700 (Mon, 21 Mar 2011)
New Revision: 5644

Modified:
   trunk/Tools/Maestro/Maestro.Base/Services/OpenResourceManager.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/RasterDefinitionCtrl.Designer.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/RasterDefinitionCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.Designer.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.resx
Log:
#738: Complete work on specialized WMS feature source editor


Modified: trunk/Tools/Maestro/Maestro.Base/Services/OpenResourceManager.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Services/OpenResourceManager.cs	2011-03-21 09:31:08 UTC (rev 5643)
+++ trunk/Tools/Maestro/Maestro.Base/Services/OpenResourceManager.cs	2011-03-21 10:08:22 UTC (rev 5644)
@@ -144,7 +144,7 @@
                 ed.EditorService.Saved += (sender, e) =>
                 {
                     //If saved from new resource, the resource id would be session based
-                    //So we need to update this to the new resource id has defined by the
+                    //So we need to update this to the new resource id as defined by the
                     //editor service
                     if (_openItems.ContainsKey(resourceId))
                     {

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/RasterDefinitionCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/RasterDefinitionCtrl.Designer.cs	2011-03-21 09:31:08 UTC (rev 5643)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/RasterDefinitionCtrl.Designer.cs	2011-03-21 10:08:22 UTC (rev 5644)
@@ -28,8 +28,6 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.btnSelectEpsg = new System.Windows.Forms.Button();
-            this.txtEpsg = new System.Windows.Forms.TextBox();
             this.label6 = new System.Windows.Forms.Label();
             this.txtElevation = new System.Windows.Forms.TextBox();
             this.label5 = new System.Windows.Forms.Label();
@@ -39,41 +37,24 @@
             this.chkTransparent = new System.Windows.Forms.CheckBox();
             this.txtImageFormat = new System.Windows.Forms.TextBox();
             this.label2 = new System.Windows.Forms.Label();
+            this.cmbBackground = new Maestro.Editors.Common.ColorComboBox();
+            this.txtLayers = new System.Windows.Forms.TextBox();
+            this.lnkUpdate = new System.Windows.Forms.LinkLabel();
             this.groupBox1 = new System.Windows.Forms.GroupBox();
-            this.lnkUpdate = new System.Windows.Forms.LinkLabel();
-            this.txtLayers = new System.Windows.Forms.TextBox();
-            this.cmbBackground = new Maestro.Editors.Common.ColorComboBox();
+            this.txtEpsg = new System.Windows.Forms.TextBox();
+            this.btnSelectCs = new System.Windows.Forms.Button();
+            this.btnSelectFormat = new System.Windows.Forms.Button();
             this.groupBox1.SuspendLayout();
             this.SuspendLayout();
             // 
-            // btnSelectEpsg
-            // 
-            this.btnSelectEpsg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnSelectEpsg.Location = new System.Drawing.Point(239, 134);
-            this.btnSelectEpsg.Name = "btnSelectEpsg";
-            this.btnSelectEpsg.Size = new System.Drawing.Size(24, 23);
-            this.btnSelectEpsg.TabIndex = 23;
-            this.btnSelectEpsg.Text = "...";
-            this.btnSelectEpsg.UseVisualStyleBackColor = true;
-            this.btnSelectEpsg.Click += new System.EventHandler(this.btnSelectEpsg_Click);
-            // 
-            // txtEpsg
-            // 
-            this.txtEpsg.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                        | System.Windows.Forms.AnchorStyles.Right)));
-            this.txtEpsg.Location = new System.Drawing.Point(108, 136);
-            this.txtEpsg.Name = "txtEpsg";
-            this.txtEpsg.Size = new System.Drawing.Size(125, 20);
-            this.txtEpsg.TabIndex = 22;
-            // 
             // label6
             // 
             this.label6.AutoSize = true;
             this.label6.Location = new System.Drawing.Point(5, 139);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(64, 13);
+            this.label6.Size = new System.Drawing.Size(50, 13);
             this.label6.TabIndex = 21;
-            this.label6.Text = "EPSG Code";
+            this.label6.Text = "Layer CS";
             // 
             // txtElevation
             // 
@@ -136,7 +117,8 @@
                         | System.Windows.Forms.AnchorStyles.Right)));
             this.txtImageFormat.Location = new System.Drawing.Point(108, 3);
             this.txtImageFormat.Name = "txtImageFormat";
-            this.txtImageFormat.Size = new System.Drawing.Size(155, 20);
+            this.txtImageFormat.ReadOnly = true;
+            this.txtImageFormat.Size = new System.Drawing.Size(119, 20);
             this.txtImageFormat.TabIndex = 13;
             // 
             // label2
@@ -148,20 +130,28 @@
             this.label2.TabIndex = 12;
             this.label2.Text = "Image Format";
             // 
-            // groupBox1
+            // cmbBackground
             // 
-            this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                        | System.Windows.Forms.AnchorStyles.Left)
+            this.cmbBackground.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                         | System.Windows.Forms.AnchorStyles.Right)));
-            this.groupBox1.Controls.Add(this.lnkUpdate);
-            this.groupBox1.Controls.Add(this.txtLayers);
-            this.groupBox1.Location = new System.Drawing.Point(8, 172);
-            this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(255, 106);
-            this.groupBox1.TabIndex = 24;
-            this.groupBox1.TabStop = false;
-            this.groupBox1.Text = "Layers (one line per layer name)";
+            this.cmbBackground.FormattingEnabled = true;
+            this.cmbBackground.Location = new System.Drawing.Point(108, 57);
+            this.cmbBackground.Name = "cmbBackground";
+            this.cmbBackground.Size = new System.Drawing.Size(155, 21);
+            this.cmbBackground.TabIndex = 16;
             // 
+            // txtLayers
+            // 
+            this.txtLayers.AcceptsReturn = true;
+            this.txtLayers.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.txtLayers.Location = new System.Drawing.Point(3, 16);
+            this.txtLayers.Multiline = true;
+            this.txtLayers.Name = "txtLayers";
+            this.txtLayers.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+            this.txtLayers.Size = new System.Drawing.Size(249, 87);
+            this.txtLayers.TabIndex = 0;
+            this.txtLayers.TextChanged += new System.EventHandler(this.txtLayers_TextChanged);
+            // 
             // lnkUpdate
             // 
             this.lnkUpdate.AutoSize = true;
@@ -174,35 +164,60 @@
             this.lnkUpdate.Text = "Update";
             this.lnkUpdate.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkUpdate_LinkClicked);
             // 
-            // txtLayers
+            // groupBox1
             // 
-            this.txtLayers.AcceptsReturn = true;
-            this.txtLayers.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.txtLayers.Location = new System.Drawing.Point(3, 16);
-            this.txtLayers.Multiline = true;
-            this.txtLayers.Name = "txtLayers";
-            this.txtLayers.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
-            this.txtLayers.Size = new System.Drawing.Size(249, 87);
-            this.txtLayers.TabIndex = 0;
-            this.txtLayers.TextChanged += new System.EventHandler(this.txtLayers_TextChanged);
+            this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                        | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
+            this.groupBox1.Controls.Add(this.lnkUpdate);
+            this.groupBox1.Controls.Add(this.txtLayers);
+            this.groupBox1.Location = new System.Drawing.Point(8, 172);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(255, 106);
+            this.groupBox1.TabIndex = 24;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "Layers (one line per layer name)";
             // 
-            // cmbBackground
+            // txtEpsg
             // 
-            this.cmbBackground.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            this.txtEpsg.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                         | System.Windows.Forms.AnchorStyles.Right)));
-            this.cmbBackground.FormattingEnabled = true;
-            this.cmbBackground.Location = new System.Drawing.Point(108, 57);
-            this.cmbBackground.Name = "cmbBackground";
-            this.cmbBackground.Size = new System.Drawing.Size(155, 21);
-            this.cmbBackground.TabIndex = 16;
+            this.txtEpsg.Location = new System.Drawing.Point(108, 136);
+            this.txtEpsg.Name = "txtEpsg";
+            this.txtEpsg.ReadOnly = true;
+            this.txtEpsg.Size = new System.Drawing.Size(119, 20);
+            this.txtEpsg.TabIndex = 25;
             // 
+            // btnSelectCs
+            // 
+            this.btnSelectCs.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnSelectCs.Location = new System.Drawing.Point(233, 134);
+            this.btnSelectCs.Name = "btnSelectCs";
+            this.btnSelectCs.Size = new System.Drawing.Size(30, 23);
+            this.btnSelectCs.TabIndex = 26;
+            this.btnSelectCs.Text = "...";
+            this.btnSelectCs.UseVisualStyleBackColor = true;
+            this.btnSelectCs.Click += new System.EventHandler(this.btnSelectCs_Click);
+            // 
+            // btnSelectFormat
+            // 
+            this.btnSelectFormat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnSelectFormat.Location = new System.Drawing.Point(233, 1);
+            this.btnSelectFormat.Name = "btnSelectFormat";
+            this.btnSelectFormat.Size = new System.Drawing.Size(30, 23);
+            this.btnSelectFormat.TabIndex = 27;
+            this.btnSelectFormat.Text = "...";
+            this.btnSelectFormat.UseVisualStyleBackColor = true;
+            this.btnSelectFormat.Click += new System.EventHandler(this.btnSelectFormat_Click);
+            // 
             // RasterDefinitionCtrl
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.btnSelectFormat);
+            this.Controls.Add(this.btnSelectCs);
+            this.Controls.Add(this.txtEpsg);
             this.Controls.Add(this.groupBox1);
-            this.Controls.Add(this.btnSelectEpsg);
-            this.Controls.Add(this.txtEpsg);
             this.Controls.Add(this.label6);
             this.Controls.Add(this.txtElevation);
             this.Controls.Add(this.label5);
@@ -224,8 +239,6 @@
 
         #endregion
 
-        private System.Windows.Forms.Button btnSelectEpsg;
-        private System.Windows.Forms.TextBox txtEpsg;
         private System.Windows.Forms.Label label6;
         private System.Windows.Forms.TextBox txtElevation;
         private System.Windows.Forms.Label label5;
@@ -236,8 +249,11 @@
         private System.Windows.Forms.CheckBox chkTransparent;
         private System.Windows.Forms.TextBox txtImageFormat;
         private System.Windows.Forms.Label label2;
-        private System.Windows.Forms.GroupBox groupBox1;
         private System.Windows.Forms.TextBox txtLayers;
         private System.Windows.Forms.LinkLabel lnkUpdate;
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.TextBox txtEpsg;
+        private System.Windows.Forms.Button btnSelectCs;
+        private System.Windows.Forms.Button btnSelectFormat;
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/RasterDefinitionCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/RasterDefinitionCtrl.cs	2011-03-21 09:31:08 UTC (rev 5643)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/RasterDefinitionCtrl.cs	2011-03-21 10:08:22 UTC (rev 5644)
@@ -26,20 +26,23 @@
 using System.Windows.Forms;
 using OSGeo.MapGuide.MaestroAPI.SchemaOverrides;
 using OSGeo.MapGuide.ObjectModels.FeatureSource;
+using Maestro.Editors.Common;
 
 namespace Maestro.Editors.FeatureSource.Providers.Wms
 {
     [ToolboxItem(false)]
     public partial class RasterDefinitionCtrl : UserControl
     {
+        private WmsConfigurationDocument _config;
         private RasterWmsItem _item;
         private IEditorService _edsvc;
         private IFeatureSource _fs;
 
-        public RasterDefinitionCtrl(RasterWmsItem item, IEditorService edsvc)
+        public RasterDefinitionCtrl(WmsConfigurationDocument config, RasterWmsItem item, IEditorService edsvc)
         {
             InitializeComponent();
             cmbBackground.ResetColors();
+            _config = config;
 
             _fs = (IFeatureSource)edsvc.GetEditedResource();
             _item = item;
@@ -87,22 +90,32 @@
             lnkUpdate.Enabled = true;
         }
 
-        private void btnSelectEpsg_Click(object sender, EventArgs e)
+        private void btnSelectCs_Click(object sender, EventArgs e)
         {
-            var conn = _fs.CurrentConnection;
-            string cswkt = _edsvc.GetCoordinateSystem();
-            if (!string.IsNullOrEmpty(cswkt))
+            List<string> names = new List<string>();
+            foreach (var sn in _config.SpatialContexts)
             {
-                //We want epsg form
-                try
-                {
-                    txtEpsg.Text = "EPSG:" + conn.CoordinateSystemCatalog.ConvertWktToEpsgCode(cswkt);
-                }
-                catch (Exception ex)
-                {
-                    MessageBox.Show(ex.Message, Properties.Resources.TitleError);
-                }
+                names.Add(sn.Name);
             }
+
+            var item = GenericItemSelectionDialog.SelectItem(null, null, names.ToArray());
+            if (item != null)
+            {
+                txtEpsg.Text = item;
+            }
         }
+
+        private void btnSelectFormat_Click(object sender, EventArgs e)
+        {
+            string[] formats = { RasterWmsItem.WmsImageFormat.GIF, 
+                                 RasterWmsItem.WmsImageFormat.JPG,
+                                 RasterWmsItem.WmsImageFormat.PNG,
+                                 RasterWmsItem.WmsImageFormat.TIF };
+            var item = GenericItemSelectionDialog.SelectItem(null, null, formats);
+            if (item != null)
+            {
+                txtImageFormat.Text = item;
+            }
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.Designer.cs	2011-03-21 09:31:08 UTC (rev 5643)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.Designer.cs	2011-03-21 10:08:22 UTC (rev 5644)
@@ -39,8 +39,15 @@
             this.toolStrip1 = new System.Windows.Forms.ToolStrip();
             this.btnAdd = new System.Windows.Forms.ToolStripButton();
             this.btnRemove = new System.Windows.Forms.ToolStripButton();
+            this.btnReset = new System.Windows.Forms.Button();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.grdSpatialContexts = new System.Windows.Forms.DataGridView();
+            this.COL_NAME = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.COL_CS = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.groupBox2.SuspendLayout();
             this.toolStrip1.SuspendLayout();
+            this.groupBox1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.grdSpatialContexts)).BeginInit();
             this.SuspendLayout();
             // 
             // label1
@@ -112,12 +119,57 @@
             this.btnRemove.Name = "btnRemove";
             this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click);
             // 
+            // btnReset
+            // 
+            resources.ApplyResources(this.btnReset, "btnReset");
+            this.btnReset.Name = "btnReset";
+            this.btnReset.UseVisualStyleBackColor = true;
+            this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.grdSpatialContexts);
+            resources.ApplyResources(this.groupBox1, "groupBox1");
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.TabStop = false;
+            // 
+            // grdSpatialContexts
+            // 
+            this.grdSpatialContexts.AllowUserToAddRows = false;
+            this.grdSpatialContexts.AllowUserToDeleteRows = false;
+            this.grdSpatialContexts.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.grdSpatialContexts.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.COL_NAME,
+            this.COL_CS});
+            resources.ApplyResources(this.grdSpatialContexts, "grdSpatialContexts");
+            this.grdSpatialContexts.Name = "grdSpatialContexts";
+            this.grdSpatialContexts.ReadOnly = true;
+            this.grdSpatialContexts.RowHeadersVisible = false;
+            this.grdSpatialContexts.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdSpatialContexts_CellContentClick);
+            // 
+            // COL_NAME
+            // 
+            this.COL_NAME.DataPropertyName = "Name";
+            resources.ApplyResources(this.COL_NAME, "COL_NAME");
+            this.COL_NAME.Name = "COL_NAME";
+            this.COL_NAME.ReadOnly = true;
+            // 
+            // COL_CS
+            // 
+            this.COL_CS.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.COL_CS.DataPropertyName = "CoordinateSystemWkt";
+            resources.ApplyResources(this.COL_CS, "COL_CS");
+            this.COL_CS.Name = "COL_CS";
+            this.COL_CS.ReadOnly = true;
+            // 
             // WmsAdvancedConfigurationDialog
             // 
             this.AcceptButton = this.btnSave;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
             resources.ApplyResources(this, "$this");
             this.ControlBox = false;
+            this.Controls.Add(this.groupBox1);
+            this.Controls.Add(this.btnReset);
             this.Controls.Add(this.groupBox2);
             this.Controls.Add(this.btnCancel);
             this.Controls.Add(this.btnSave);
@@ -129,6 +181,8 @@
             this.groupBox2.PerformLayout();
             this.toolStrip1.ResumeLayout(false);
             this.toolStrip1.PerformLayout();
+            this.groupBox1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.grdSpatialContexts)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -146,5 +200,10 @@
         private System.Windows.Forms.ToolStrip toolStrip1;
         private System.Windows.Forms.ToolStripButton btnAdd;
         private System.Windows.Forms.ToolStripButton btnRemove;
+        private System.Windows.Forms.Button btnReset;
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.DataGridView grdSpatialContexts;
+        private System.Windows.Forms.DataGridViewTextBoxColumn COL_NAME;
+        private System.Windows.Forms.DataGridViewTextBoxColumn COL_CS;
     }
 }
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.cs	2011-03-21 09:31:08 UTC (rev 5643)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.cs	2011-03-21 10:08:22 UTC (rev 5644)
@@ -44,6 +44,7 @@
         public WmsAdvancedConfigurationDialog(IEditorService service)
         {
             InitializeComponent();
+            grdSpatialContexts.AutoGenerateColumns = false;
             _items = new BindingList<RasterWmsItem>();
             _service = service;
             _fs = (IFeatureSource)_service.GetEditedResource();
@@ -68,6 +69,7 @@
 
             _items = new BindingList<RasterWmsItem>(new List<RasterWmsItem>(_config.RasterOverrides));
             lstFeatureClasses.DataSource = _items;
+            grdSpatialContexts.DataSource = _config.SpatialContexts;
         }
 
         private WmsConfigurationDocument BuildDefaultWmsDocument()
@@ -79,11 +81,17 @@
             var schema = new FeatureSchema(schemaName, "");
             doc.AddSchema(schema);
 
+            foreach (var sc in contexts.SpatialContext)
+            {
+                doc.AddSpatialContext(sc);
+            }
+
             var defaultSc = contexts.SpatialContext[0];
 
             foreach (var clsName in clsNames)
             {
-                var cls = new ClassDefinition(clsName, "");
+                var className = clsName.Split(':')[1];
+                var cls = new ClassDefinition(className, "");
                 cls.AddProperty(new DataPropertyDefinition("Id", "")
                 {
                     DataType = DataPropertyType.String,
@@ -144,7 +152,7 @@
             var item = (RasterWmsItem)lstFeatureClasses.SelectedItem;
             grpRaster.Controls.Clear();
 
-            var ctrl = new RasterDefinitionCtrl(item, _service);
+            var ctrl = new RasterDefinitionCtrl(_config, item, _service);
             ctrl.Dock = DockStyle.Fill;
             grpRaster.Controls.Add(ctrl);
 
@@ -195,5 +203,28 @@
             _items.Add(item);
              */
         }
+
+        private void btnReset_Click(object sender, EventArgs e)
+        {
+            _config = BuildDefaultWmsDocument();
+            _items.Clear();
+            foreach (var ov in _config.RasterOverrides)
+            {
+                _items.Add(ov);
+            }
+            grdSpatialContexts.DataSource = _config.SpatialContexts;
+        }
+
+        private void grdSpatialContexts_CellContentClick(object sender, DataGridViewCellEventArgs e)
+        {
+            if (e.ColumnIndex == 1)
+            {
+                string wkt = _service.GetCoordinateSystem();
+                if (!string.IsNullOrEmpty(wkt))
+                {
+                    grdSpatialContexts[e.ColumnIndex, e.RowIndex].Value = wkt;
+                }
+            }
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.resx	2011-03-21 09:31:08 UTC (rev 5643)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.resx	2011-03-21 10:08:22 UTC (rev 5644)
@@ -144,7 +144,7 @@
     <value>$this</value>
   </data>
   <data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
-    <value>5</value>
+    <value>7</value>
   </data>
   <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="txtFeatureServer.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
@@ -169,13 +169,13 @@
     <value>$this</value>
   </data>
   <data name="&gt;&gt;txtFeatureServer.ZOrder" xml:space="preserve">
-    <value>4</value>
+    <value>6</value>
   </data>
   <data name="grpRaster.Location" type="System.Drawing.Point, System.Drawing">
-    <value>294, 53</value>
+    <value>294, 134</value>
   </data>
   <data name="grpRaster.Size" type="System.Drawing.Size, System.Drawing">
-    <value>312, 275</value>
+    <value>312, 259</value>
   </data>
   <data name="grpRaster.TabIndex" type="System.Int32, mscorlib">
     <value>2</value>
@@ -193,13 +193,13 @@
     <value>$this</value>
   </data>
   <data name="&gt;&gt;grpRaster.ZOrder" xml:space="preserve">
-    <value>3</value>
+    <value>5</value>
   </data>
   <data name="btnSave.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Bottom, Right</value>
   </data>
   <data name="btnSave.Location" type="System.Drawing.Point, System.Drawing">
-    <value>450, 345</value>
+    <value>450, 399</value>
   </data>
   <data name="btnSave.Size" type="System.Drawing.Size, System.Drawing">
     <value>75, 23</value>
@@ -220,13 +220,13 @@
     <value>$this</value>
   </data>
   <data name="&gt;&gt;btnSave.ZOrder" xml:space="preserve">
-    <value>2</value>
+    <value>4</value>
   </data>
   <data name="btnCancel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Bottom, Right</value>
   </data>
   <data name="btnCancel.Location" type="System.Drawing.Point, System.Drawing">
-    <value>531, 345</value>
+    <value>531, 399</value>
   </data>
   <data name="btnCancel.Size" type="System.Drawing.Size, System.Drawing">
     <value>75, 23</value>
@@ -247,7 +247,7 @@
     <value>$this</value>
   </data>
   <data name="&gt;&gt;btnCancel.ZOrder" xml:space="preserve">
-    <value>1</value>
+    <value>3</value>
   </data>
   <data name="lstFeatureClasses.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
     <value>Fill</value>
@@ -256,7 +256,7 @@
     <value>3, 16</value>
   </data>
   <data name="lstFeatureClasses.Size" type="System.Drawing.Size, System.Drawing">
-    <value>270, 251</value>
+    <value>270, 238</value>
   </data>
   <data name="lstFeatureClasses.TabIndex" type="System.Int32, mscorlib">
     <value>1</value>
@@ -276,6 +276,27 @@
   <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
+  <data name="btnAdd.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
+    <value>Magenta</value>
+  </data>
+  <data name="btnAdd.Size" type="System.Drawing.Size, System.Drawing">
+    <value>49, 22</value>
+  </data>
+  <data name="btnAdd.Text" xml:space="preserve">
+    <value>Add</value>
+  </data>
+  <data name="btnRemove.Enabled" type="System.Boolean, mscorlib">
+    <value>False</value>
+  </data>
+  <data name="btnRemove.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
+    <value>Magenta</value>
+  </data>
+  <data name="btnRemove.Size" type="System.Drawing.Size, System.Drawing">
+    <value>70, 22</value>
+  </data>
+  <data name="btnRemove.Text" xml:space="preserve">
+    <value>Remove</value>
+  </data>
   <data name="toolStrip1.Location" type="System.Drawing.Point, System.Drawing">
     <value>3, 16</value>
   </data>
@@ -304,10 +325,10 @@
     <value>1</value>
   </data>
   <data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
-    <value>12, 53</value>
+    <value>12, 134</value>
   </data>
   <data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
-    <value>276, 275</value>
+    <value>276, 259</value>
   </data>
   <data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
     <value>5</value>
@@ -325,34 +346,100 @@
     <value>$this</value>
   </data>
   <data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
+    <value>2</value>
+  </data>
+  <data name="btnReset.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Bottom, Left</value>
+  </data>
+  <data name="btnReset.Location" type="System.Drawing.Point, System.Drawing">
+    <value>12, 399</value>
+  </data>
+  <data name="btnReset.Size" type="System.Drawing.Size, System.Drawing">
+    <value>107, 23</value>
+  </data>
+  <data name="btnReset.TabIndex" type="System.Int32, mscorlib">
+    <value>6</value>
+  </data>
+  <data name="btnReset.Text" xml:space="preserve">
+    <value>Rebuild Default</value>
+  </data>
+  <data name="&gt;&gt;btnReset.Name" xml:space="preserve">
+    <value>btnReset</value>
+  </data>
+  <data name="&gt;&gt;btnReset.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;btnReset.Parent" xml:space="preserve">
+    <value>$this</value>
+  </data>
+  <data name="&gt;&gt;btnReset.ZOrder" xml:space="preserve">
+    <value>1</value>
+  </data>
+  <metadata name="COL_NAME.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <data name="COL_NAME.HeaderText" xml:space="preserve">
+    <value>Name</value>
+  </data>
+  <metadata name="COL_CS.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <data name="COL_CS.HeaderText" xml:space="preserve">
+    <value>Coordinate System</value>
+  </data>
+  <data name="grdSpatialContexts.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
+    <value>Fill</value>
+  </data>
+  <data name="grdSpatialContexts.Location" type="System.Drawing.Point, System.Drawing">
+    <value>3, 16</value>
+  </data>
+  <data name="grdSpatialContexts.Size" type="System.Drawing.Size, System.Drawing">
+    <value>588, 70</value>
+  </data>
+  <data name="grdSpatialContexts.TabIndex" type="System.Int32, mscorlib">
     <value>0</value>
   </data>
-  <data name="btnAdd.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
-    <value>Magenta</value>
+  <data name="&gt;&gt;grdSpatialContexts.Name" xml:space="preserve">
+    <value>grdSpatialContexts</value>
   </data>
-  <data name="btnAdd.Size" type="System.Drawing.Size, System.Drawing">
-    <value>49, 22</value>
+  <data name="&gt;&gt;grdSpatialContexts.Type" xml:space="preserve">
+    <value>System.Windows.Forms.DataGridView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
-  <data name="btnAdd.Text" xml:space="preserve">
-    <value>Add</value>
+  <data name="&gt;&gt;grdSpatialContexts.Parent" xml:space="preserve">
+    <value>groupBox1</value>
   </data>
-  <data name="btnRemove.Enabled" type="System.Boolean, mscorlib">
-    <value>False</value>
+  <data name="&gt;&gt;grdSpatialContexts.ZOrder" xml:space="preserve">
+    <value>0</value>
   </data>
-  <data name="btnRemove.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
-    <value>Magenta</value>
+  <data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
+    <value>12, 39</value>
   </data>
-  <data name="btnRemove.Size" type="System.Drawing.Size, System.Drawing">
-    <value>70, 22</value>
+  <data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
+    <value>594, 89</value>
   </data>
-  <data name="btnRemove.Text" xml:space="preserve">
-    <value>Remove</value>
+  <data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
+    <value>7</value>
   </data>
+  <data name="groupBox1.Text" xml:space="preserve">
+    <value>Spatial Contexts (click cell to edit coordinate system)</value>
+  </data>
+  <data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
+    <value>groupBox1</value>
+  </data>
+  <data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
+    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
+    <value>$this</value>
+  </data>
+  <data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
   <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
-    <value>618, 380</value>
+    <value>618, 434</value>
   </data>
   <data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
     <value>CenterParent</value>
@@ -372,6 +459,18 @@
   <data name="&gt;&gt;btnRemove.Type" xml:space="preserve">
     <value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
+  <data name="&gt;&gt;COL_NAME.Name" xml:space="preserve">
+    <value>COL_NAME</value>
+  </data>
+  <data name="&gt;&gt;COL_NAME.Type" xml:space="preserve">
+    <value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name="&gt;&gt;COL_CS.Name" xml:space="preserve">
+    <value>COL_CS</value>
+  </data>
+  <data name="&gt;&gt;COL_CS.Type" xml:space="preserve">
+    <value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
   <data name="&gt;&gt;$this.Name" xml:space="preserve">
     <value>WmsAdvancedConfigurationDialog</value>
   </data>



More information about the mapguide-commits mailing list