[mapguide-commits] r7652 - trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun Jun 30 07:49:53 PDT 2013


Author: jng
Date: 2013-06-30 07:49:53 -0700 (Sun, 30 Jun 2013)
New Revision: 7652

Modified:
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.Designer.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.resx
Log:
#2306: Make the "Resampling Method" parameter optional in the GDAL Feature Source editor

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.Designer.cs	2013-06-28 06:47:04 UTC (rev 7651)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.Designer.cs	2013-06-30 14:49:53 UTC (rev 7652)
@@ -35,15 +35,15 @@
             this.btnTest = new System.Windows.Forms.Button();
             this.label1 = new System.Windows.Forms.Label();
             this.txtStatus = new System.Windows.Forms.TextBox();
-            this.lblResamplingMethod = new System.Windows.Forms.Label();
             this.cmbResamplingMethod = new System.Windows.Forms.ComboBox();
+            this.chkResamplingMethod = new System.Windows.Forms.CheckBox();
             this.contentPanel.SuspendLayout();
             this.SuspendLayout();
             // 
             // contentPanel
             // 
+            this.contentPanel.Controls.Add(this.chkResamplingMethod);
             this.contentPanel.Controls.Add(this.cmbResamplingMethod);
-            this.contentPanel.Controls.Add(this.lblResamplingMethod);
             this.contentPanel.Controls.Add(this.txtStatus);
             this.contentPanel.Controls.Add(this.label1);
             this.contentPanel.Controls.Add(this.btnTest);
@@ -92,11 +92,6 @@
             this.txtStatus.Name = "txtStatus";
             this.txtStatus.ReadOnly = true;
             // 
-            // lblResamplingMethod
-            // 
-            resources.ApplyResources(this.lblResamplingMethod, "lblResamplingMethod");
-            this.lblResamplingMethod.Name = "lblResamplingMethod";
-            // 
             // cmbResamplingMethod
             // 
             resources.ApplyResources(this.cmbResamplingMethod, "cmbResamplingMethod");
@@ -105,6 +100,13 @@
             this.cmbResamplingMethod.Name = "cmbResamplingMethod";
             this.cmbResamplingMethod.SelectedIndexChanged += new System.EventHandler(this.cmbResamplingMethod_SelectedIndexChanged);
             // 
+            // chkResamplingMethod
+            // 
+            resources.ApplyResources(this.chkResamplingMethod, "chkResamplingMethod");
+            this.chkResamplingMethod.Name = "chkResamplingMethod";
+            this.chkResamplingMethod.UseVisualStyleBackColor = true;
+            this.chkResamplingMethod.CheckedChanged += new System.EventHandler(this.chkResamplingMethod_CheckedChanged);
+            // 
             // GdalProviderCtrl
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -125,6 +127,6 @@
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.TextBox txtStatus;
         private System.Windows.Forms.ComboBox cmbResamplingMethod;
-        private System.Windows.Forms.Label lblResamplingMethod;
+        private System.Windows.Forms.CheckBox chkResamplingMethod;
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.cs	2013-06-28 06:47:04 UTC (rev 7651)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.cs	2013-06-30 14:49:53 UTC (rev 7652)
@@ -59,27 +59,35 @@
                 _bSupportsResample = false;
                 _service = service;
                 _fs = (IFeatureSource)_service.GetEditedResource();
-
+                
                 var provInfo = _service.FeatureService.GetFeatureProvider("OSGeo.Gdal"); //NOXLATE
                 foreach (var prop in provInfo.ConnectionProperties)
                 {
                     if (prop.Name == "ResamplingMethod") //NOXLATE
                     {
-                        lblResamplingMethod.Visible =
+                        chkResamplingMethod.Visible =
                             cmbResamplingMethod.Visible =
                                 cmbResamplingMethod.Enabled = true;
 
                         cmbResamplingMethod.DataSource = new List<string>(prop.Value);
                         var method = _fs.GetConnectionProperty("ResamplingMethod"); //NOXLATE
                         if (!string.IsNullOrEmpty(method))
+                        {
+                            chkResamplingMethod.Checked = true;
                             cmbResamplingMethod.SelectedItem = method;
+                        }
                         else
+                        {
                             cmbResamplingMethod.SelectedIndex = 0;
+                            chkResamplingMethod.Checked = false;
+                        }
                         _bSupportsResample = true;
                         break;
                     }
                 }
 
+                cmbResamplingMethod.Enabled = chkResamplingMethod.Checked;
+
                 _sing.Bind(service);
                 _comp.Bind(service);
                 if (!string.IsNullOrEmpty(_fs.GetConfigurationContent()))
@@ -128,11 +136,28 @@
 
         private void cmbResamplingMethod_SelectedIndexChanged(object sender, EventArgs e)
         {
-            if (!_bSupportsResample)
+            if (_init || !_bSupportsResample || !chkResamplingMethod.Checked)
                 return;
 
             if (cmbResamplingMethod.SelectedItem != null)
-                _fs.SetConnectionProperty("ResamplingMethod", cmbResamplingMethod.SelectedItem.ToString());
+                _fs.SetConnectionProperty("ResamplingMethod", cmbResamplingMethod.SelectedItem.ToString()); //NOXLATE
         }
+
+        private void chkResamplingMethod_CheckedChanged(object sender, EventArgs e)
+        {
+            if (_init)
+                return;
+
+            cmbResamplingMethod.Enabled = chkResamplingMethod.Checked;
+            if (chkResamplingMethod.Checked)
+            {
+                if (cmbResamplingMethod.SelectedItem != null)
+                    _fs.SetConnectionProperty("ResamplingMethod", cmbResamplingMethod.SelectedItem.ToString()); //NOXLATE
+            }
+            else
+            {
+                _fs.SetConnectionProperty("ResamplingMethod", null); //NOXLATE
+            }
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.resx	2013-06-28 06:47:04 UTC (rev 7651)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.resx	2013-06-30 14:49:53 UTC (rev 7652)
@@ -117,18 +117,51 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="chkResamplingMethod.AutoSize" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="chkResamplingMethod.Location" type="System.Drawing.Point, System.Drawing">
+    <value>195, 16</value>
+  </data>
+  <data name="chkResamplingMethod.Size" type="System.Drawing.Size, System.Drawing">
+    <value>120, 17</value>
+  </data>
+  <data name="chkResamplingMethod.TabIndex" type="System.Int32, mscorlib">
+    <value>8</value>
+  </data>
+  <data name="chkResamplingMethod.Text" xml:space="preserve">
+    <value>Resampling Method</value>
+  </data>
+  <data name="chkResamplingMethod.Visible" type="System.Boolean, mscorlib">
+    <value>False</value>
+  </data>
+  <data name=">>chkResamplingMethod.Name" xml:space="preserve">
+    <value>chkResamplingMethod</value>
+  </data>
+  <data name=">>chkResamplingMethod.Type" xml:space="preserve">
+    <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>chkResamplingMethod.Parent" xml:space="preserve">
+    <value>contentPanel</value>
+  </data>
+  <data name=">>chkResamplingMethod.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
   <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="cmbResamplingMethod.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Top, Left, Right</value>
   </data>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="cmbResamplingMethod.Enabled" type="System.Boolean, mscorlib">
+    <value>False</value>
+  </data>
   <data name="cmbResamplingMethod.Location" type="System.Drawing.Point, System.Drawing">
-    <value>316, 14</value>
+    <value>321, 14</value>
   </data>
   <data name="cmbResamplingMethod.Size" type="System.Drawing.Size, System.Drawing">
-    <value>119, 21</value>
+    <value>114, 21</value>
   </data>
-  <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="cmbResamplingMethod.TabIndex" type="System.Int32, mscorlib">
     <value>7</value>
   </data>
@@ -145,36 +178,6 @@
     <value>contentPanel</value>
   </data>
   <data name=">>cmbResamplingMethod.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
-  <data name="lblResamplingMethod.AutoSize" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
-  <data name="lblResamplingMethod.Location" type="System.Drawing.Point, System.Drawing">
-    <value>209, 17</value>
-  </data>
-  <data name="lblResamplingMethod.Size" type="System.Drawing.Size, System.Drawing">
-    <value>101, 13</value>
-  </data>
-  <data name="lblResamplingMethod.TabIndex" type="System.Int32, mscorlib">
-    <value>6</value>
-  </data>
-  <data name="lblResamplingMethod.Text" xml:space="preserve">
-    <value>Resampling Method</value>
-  </data>
-  <data name="lblResamplingMethod.Visible" type="System.Boolean, mscorlib">
-    <value>False</value>
-  </data>
-  <data name=">>lblResamplingMethod.Name" xml:space="preserve">
-    <value>lblResamplingMethod</value>
-  </data>
-  <data name=">>lblResamplingMethod.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>lblResamplingMethod.Parent" xml:space="preserve">
-    <value>contentPanel</value>
-  </data>
-  <data name=">>lblResamplingMethod.ZOrder" xml:space="preserve">
     <value>1</value>
   </data>
   <data name="txtStatus.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">



More information about the mapguide-commits mailing list