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

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Feb 15 00:54:00 PST 2013


Author: jng
Date: 2013-02-15 00:54:00 -0800 (Fri, 15 Feb 2013)
New Revision: 7352

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:
#2217: Support the new resampling method parameter in 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-02-13 11:00:29 UTC (rev 7351)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.Designer.cs	2013-02-15 08:54:00 UTC (rev 7352)
@@ -35,11 +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.contentPanel.SuspendLayout();
             this.SuspendLayout();
             // 
             // contentPanel
             // 
+            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);
@@ -88,12 +92,24 @@
             this.txtStatus.Name = "txtStatus";
             this.txtStatus.ReadOnly = true;
             // 
+            // lblResamplingMethod
+            // 
+            resources.ApplyResources(this.lblResamplingMethod, "lblResamplingMethod");
+            this.lblResamplingMethod.Name = "lblResamplingMethod";
+            // 
+            // cmbResamplingMethod
+            // 
+            resources.ApplyResources(this.cmbResamplingMethod, "cmbResamplingMethod");
+            this.cmbResamplingMethod.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cmbResamplingMethod.FormattingEnabled = true;
+            this.cmbResamplingMethod.Name = "cmbResamplingMethod";
+            this.cmbResamplingMethod.SelectedIndexChanged += new System.EventHandler(this.cmbResamplingMethod_SelectedIndexChanged);
+            // 
             // GdalProviderCtrl
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
-            this.HeaderText = "GDAL Feature Source";
+            resources.ApplyResources(this, "$this");
             this.Name = "GdalProviderCtrl";
-            resources.ApplyResources(this, "$this");
             this.contentPanel.ResumeLayout(false);
             this.contentPanel.PerformLayout();
             this.ResumeLayout(false);
@@ -108,5 +124,7 @@
         private System.Windows.Forms.Button btnTest;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.TextBox txtStatus;
+        private System.Windows.Forms.ComboBox cmbResamplingMethod;
+        private System.Windows.Forms.Label lblResamplingMethod;
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.cs	2013-02-13 11:00:29 UTC (rev 7351)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.cs	2013-02-15 08:54:00 UTC (rev 7352)
@@ -49,13 +49,37 @@
 
         private bool _init = false;
 
+        private bool _bSupportsResample = false;
+
         public override void Bind(IEditorService service)
         {
             try
             {
                 _init = true;
+                _bSupportsResample = false;
                 _service = service;
                 _fs = (IFeatureSource)_service.GetEditedResource();
+
+                var provInfo = _service.FeatureService.GetFeatureProvider("OSGeo.Gdal");
+                foreach (var prop in provInfo.ConnectionProperties)
+                {
+                    if (prop.Name == "ResamplingMethod")
+                    {
+                        lblResamplingMethod.Visible =
+                            cmbResamplingMethod.Visible =
+                                cmbResamplingMethod.Enabled = true;
+
+                        cmbResamplingMethod.DataSource = new List<string>(prop.Value);
+                        var method = _fs.GetConnectionProperty("ResamplingMethod");
+                        if (!string.IsNullOrEmpty(method))
+                            cmbResamplingMethod.SelectedItem = method;
+                        else
+                            cmbResamplingMethod.SelectedIndex = 0;
+                        _bSupportsResample = true;
+                        break;
+                    }
+                }
+
                 _sing.Bind(service);
                 _comp.Bind(service);
                 if (!string.IsNullOrEmpty(_fs.GetConfigurationContent()))
@@ -101,5 +125,14 @@
             string result = _fs.TestConnection();
             txtStatus.Text = string.Format(Strings.FdoConnectionStatus, result);
         }
+
+        private void cmbResamplingMethod_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (!_bSupportsResample)
+                return;
+
+            if (cmbResamplingMethod.SelectedItem != null)
+                _fs.SetConnectionProperty("ResamplingMethod", cmbResamplingMethod.SelectedItem.ToString());
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.resx	2013-02-13 11:00:29 UTC (rev 7351)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/GdalProviderCtrl.resx	2013-02-15 08:54:00 UTC (rev 7352)
@@ -112,20 +112,77 @@
     <value>2.0</value>
   </resheader>
   <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <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.Location" type="System.Drawing.Point, System.Drawing">
+    <value>316, 14</value>
+  </data>
+  <data name="cmbResamplingMethod.Size" type="System.Drawing.Size, System.Drawing">
+    <value>119, 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>
+  <data name="cmbResamplingMethod.Visible" type="System.Boolean, mscorlib">
+    <value>False</value>
+  </data>
+  <data name=">>cmbResamplingMethod.Name" xml:space="preserve">
+    <value>cmbResamplingMethod</value>
+  </data>
+  <data name=">>cmbResamplingMethod.Type" xml:space="preserve">
+    <value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>cmbResamplingMethod.Parent" xml:space="preserve">
+    <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">
     <value>Top, Bottom, Left, Right</value>
   </data>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="txtStatus.Location" type="System.Drawing.Point, System.Drawing">
     <value>125, 209</value>
   </data>
-  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="txtStatus.Multiline" type="System.Boolean, mscorlib">
     <value>True</value>
   </data>
@@ -139,13 +196,13 @@
     <value>txtStatus</value>
   </data>
   <data name=">>txtStatus.Type" xml:space="preserve">
-    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>txtStatus.Parent" xml:space="preserve">
     <value>contentPanel</value>
   </data>
   <data name=">>txtStatus.ZOrder" xml:space="preserve">
-    <value>0</value>
+    <value>2</value>
   </data>
   <data name="label1.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
@@ -166,13 +223,13 @@
     <value>label1</value>
   </data>
   <data name=">>label1.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>label1.Parent" xml:space="preserve">
     <value>contentPanel</value>
   </data>
   <data name=">>label1.ZOrder" xml:space="preserve">
-    <value>1</value>
+    <value>3</value>
   </data>
   <data name="btnTest.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Bottom, Left</value>
@@ -193,13 +250,13 @@
     <value>btnTest</value>
   </data>
   <data name=">>btnTest.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>btnTest.Parent" xml:space="preserve">
     <value>contentPanel</value>
   </data>
   <data name=">>btnTest.ZOrder" xml:space="preserve">
-    <value>2</value>
+    <value>4</value>
   </data>
   <data name="panel1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Top, Bottom, Left, Right</value>
@@ -217,19 +274,19 @@
     <value>panel1</value>
   </data>
   <data name=">>panel1.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>panel1.Parent" xml:space="preserve">
     <value>contentPanel</value>
   </data>
   <data name=">>panel1.ZOrder" xml:space="preserve">
-    <value>3</value>
+    <value>5</value>
   </data>
   <data name="rdComposite.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
   </data>
   <data name="rdComposite.Location" type="System.Drawing.Point, System.Drawing">
-    <value>125, 15</value>
+    <value>115, 15</value>
   </data>
   <data name="rdComposite.Size" type="System.Drawing.Size, System.Drawing">
     <value>74, 17</value>
@@ -244,19 +301,19 @@
     <value>rdComposite</value>
   </data>
   <data name=">>rdComposite.Type" xml:space="preserve">
-    <value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>rdComposite.Parent" xml:space="preserve">
     <value>contentPanel</value>
   </data>
   <data name=">>rdComposite.ZOrder" xml:space="preserve">
-    <value>4</value>
+    <value>6</value>
   </data>
   <data name="rdSingle.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
   </data>
   <data name="rdSingle.Location" type="System.Drawing.Point, System.Drawing">
-    <value>65, 15</value>
+    <value>55, 15</value>
   </data>
   <data name="rdSingle.Size" type="System.Drawing.Size, System.Drawing">
     <value>54, 17</value>
@@ -271,13 +328,13 @@
     <value>rdSingle</value>
   </data>
   <data name=">>rdSingle.Type" xml:space="preserve">
-    <value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>rdSingle.Parent" xml:space="preserve">
     <value>contentPanel</value>
   </data>
   <data name=">>rdSingle.ZOrder" xml:space="preserve">
-    <value>5</value>
+    <value>7</value>
   </data>
   <data name="contentPanel.Size" type="System.Drawing.Size, System.Drawing">
     <value>449, 250</value>
@@ -286,7 +343,7 @@
     <value>contentPanel</value>
   </data>
   <data name=">>contentPanel.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>contentPanel.Parent" xml:space="preserve">
     <value>$this</value>
@@ -294,9 +351,12 @@
   <data name=">>contentPanel.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">
+  <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <data name="$this.HeaderText" xml:space="preserve">
+    <value>GDAL Feature Source</value>
+  </data>
   <data name="$this.Size" type="System.Drawing.Size, System.Drawing">
     <value>449, 277</value>
   </data>
@@ -304,6 +364,6 @@
     <value>GdalProviderCtrl</value>
   </data>
   <data name=">>$this.Type" xml:space="preserve">
-    <value>Maestro.Editors.Common.EditorBindableCollapsiblePanel, Maestro.Editors, Version=3.0.0.5475, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Editors.Common.EditorBindableCollapsiblePanel, Maestro.Editors, Version=5.0.0.6640, Culture=neutral, PublicKeyToken=f526c48929fda856</value>
   </data>
 </root>
\ No newline at end of file



More information about the mapguide-commits mailing list