[mapguide-commits] r4921 - in sandbox/maestro-2.5: Maestro.Base Maestro.Base/Editor Maestro.Editors Maestro.Editors/LoadProcedure

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri May 21 07:16:39 EDT 2010


Author: jng
Date: 2010-05-21 07:16:39 -0400 (Fri, 21 May 2010)
New Revision: 4921

Added:
   sandbox/maestro-2.5/Maestro.Base/Editor/LoadProcedureEditor.resx
Modified:
   sandbox/maestro-2.5/Maestro.Base/Editor/LoadProcedureEditor.Designer.cs
   sandbox/maestro-2.5/Maestro.Base/Editor/LoadProcedureEditor.cs
   sandbox/maestro-2.5/Maestro.Base/Editor/ResourceEditorService.cs
   sandbox/maestro-2.5/Maestro.Base/Maestro.Base.csproj
   sandbox/maestro-2.5/Maestro.Editors/IEditorBindable.cs
   sandbox/maestro-2.5/Maestro.Editors/IEditorService.cs
   sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/InputFilesCtrl.cs
   sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadProcedureEditorCtrl.Designer.cs
   sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadProcedureEditorCtrl.cs
   sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadTargetCtrl.Designer.cs
   sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadTargetCtrl.cs
   sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/SdfTransformationCtrl.Designer.cs
   sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/SdfTransformationCtrl.cs
   sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/ShpTransformationCtrl.Designer.cs
   sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/ShpTransformationCtrl.cs
Log:
This submission fleshes out the implementation of the Load Procedure editors


Modified: sandbox/maestro-2.5/Maestro.Base/Editor/LoadProcedureEditor.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Editor/LoadProcedureEditor.Designer.cs	2010-05-21 10:38:46 UTC (rev 4920)
+++ sandbox/maestro-2.5/Maestro.Base/Editor/LoadProcedureEditor.Designer.cs	2010-05-21 11:16:39 UTC (rev 4921)
@@ -28,10 +28,35 @@
         /// </summary>
         private void InitializeComponent()
         {
-            components = new System.ComponentModel.Container();
+            this.lpEditor = new Maestro.Editors.LoadProcedure.LoadProcedureEditorCtrl();
+            this.panelBody.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // panelBody
+            // 
+            this.panelBody.Controls.Add(this.lpEditor);
+            // 
+            // lpEditor
+            // 
+            this.lpEditor.AutoScroll = true;
+            this.lpEditor.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lpEditor.Location = new System.Drawing.Point(0, 0);
+            this.lpEditor.Name = "lpEditor";
+            this.lpEditor.Size = new System.Drawing.Size(614, 520);
+            this.lpEditor.TabIndex = 0;
+            // 
+            // LoadProcedureEditor
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Name = "LoadProcedureEditor";
+            this.panelBody.ResumeLayout(false);
+            this.ResumeLayout(false);
+
         }
 
         #endregion
+
+        private Maestro.Editors.LoadProcedure.LoadProcedureEditorCtrl lpEditor;
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Base/Editor/LoadProcedureEditor.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Editor/LoadProcedureEditor.cs	2010-05-21 10:38:46 UTC (rev 4920)
+++ sandbox/maestro-2.5/Maestro.Base/Editor/LoadProcedureEditor.cs	2010-05-21 11:16:39 UTC (rev 4921)
@@ -36,7 +36,7 @@
 
         protected override void Bind(Maestro.Editors.IEditorService service)
         {
-            
+            lpEditor.Bind(service);
         }
     }
 }

Added: sandbox/maestro-2.5/Maestro.Base/Editor/LoadProcedureEditor.resx
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Editor/LoadProcedureEditor.resx	                        (rev 0)
+++ sandbox/maestro-2.5/Maestro.Base/Editor/LoadProcedureEditor.resx	2010-05-21 11:16:39 UTC (rev 4921)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <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>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
\ No newline at end of file

Modified: sandbox/maestro-2.5/Maestro.Base/Editor/ResourceEditorService.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Editor/ResourceEditorService.cs	2010-05-21 10:38:46 UTC (rev 4920)
+++ sandbox/maestro-2.5/Maestro.Base/Editor/ResourceEditorService.cs	2010-05-21 11:16:39 UTC (rev 4921)
@@ -28,6 +28,7 @@
 using Maestro.Editors.Generic;
 using System.ComponentModel;
 using System.IO;
+using Maestro.Editors.Common;
 
 namespace Maestro.Base.Editor
 {
@@ -233,5 +234,16 @@
         {
             get { return _conn.ResourceService; }
         }
+
+
+        public string GetCoordinateSystem()
+        {
+            var dlg = new CoordinateSystemPicker(_conn.CoordinateSystemCatalog);
+            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                return dlg.SelectedCoordSys.WKT;
+            }
+            return string.Empty;
+        }
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Base/Maestro.Base.csproj
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Maestro.Base.csproj	2010-05-21 10:38:46 UTC (rev 4920)
+++ sandbox/maestro-2.5/Maestro.Base/Maestro.Base.csproj	2010-05-21 11:16:39 UTC (rev 4921)
@@ -254,6 +254,9 @@
     <EmbeddedResource Include="Editor\LayerDefinitionEditor.resx">
       <DependentUpon>LayerDefinitionEditor.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Editor\LoadProcedureEditor.resx">
+      <DependentUpon>LoadProcedureEditor.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Editor\WebLayoutEditor.resx">
       <DependentUpon>WebLayoutEditor.cs</DependentUpon>
       <SubType>Designer</SubType>

Modified: sandbox/maestro-2.5/Maestro.Editors/IEditorBindable.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/IEditorBindable.cs	2010-05-21 10:38:46 UTC (rev 4920)
+++ sandbox/maestro-2.5/Maestro.Editors/IEditorBindable.cs	2010-05-21 11:16:39 UTC (rev 4921)
@@ -25,6 +25,12 @@
 {
     public interface IEditorBindable : INotifyResourceChanged
     {
+        /// <summary>
+        /// Sets the initial state of this editor and sets up any databinding
+        /// within such that user interface changes will propagate back to the
+        /// model.
+        /// </summary>
+        /// <param name="service"></param>
         void Bind(IEditorService service);
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Editors/IEditorService.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/IEditorService.cs	2010-05-21 10:38:46 UTC (rev 4920)
+++ sandbox/maestro-2.5/Maestro.Editors/IEditorService.cs	2010-05-21 11:16:39 UTC (rev 4921)
@@ -169,5 +169,11 @@
         /// Raised when the edited resource has changed
         /// </summary>
         event EventHandler DirtyStateChanged;
+
+        /// <summary>
+        /// Invokes a prompt to select the coordinate system
+        /// </summary>
+        /// <returns></returns>
+        string GetCoordinateSystem();
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/InputFilesCtrl.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/InputFilesCtrl.cs	2010-05-21 10:38:46 UTC (rev 4920)
+++ sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/InputFilesCtrl.cs	2010-05-21 11:16:39 UTC (rev 4921)
@@ -25,14 +25,26 @@
 using System.Text;
 using System.Windows.Forms;
 using Maestro.Shared.UI;
+using System.Diagnostics;
 
 namespace Maestro.Editors.LoadProcedure
 {
-    public partial class InputFilesCtrl : CollapsiblePanel
+    public partial class InputFilesCtrl : CollapsiblePanel, IEditorBindable
     {
         public InputFilesCtrl()
         {
             InitializeComponent();
         }
+
+        public void Bind(IEditorService service)
+        {
+            var lp = service.GetEditedResource() as OSGeo.MapGuide.ObjectModels.LoadProcedure.LoadProcedure;
+            Debug.Assert(lp != null);
+
+            service.RegisterCustomNotifier(this);
+            lstInputFiles.DataSource = lp.Item.SourceFile;
+        }
+
+        public event EventHandler ResourceChanged;
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadProcedureEditorCtrl.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadProcedureEditorCtrl.Designer.cs	2010-05-21 10:38:46 UTC (rev 4920)
+++ sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadProcedureEditorCtrl.Designer.cs	2010-05-21 11:16:39 UTC (rev 4921)
@@ -30,11 +30,12 @@
         {
             this.SuspendLayout();
             // 
-            // LoadProcedureEditor
+            // LoadProcedureEditorCtrl
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.Name = "LoadProcedureEditor";
+            this.AutoScroll = true;
+            this.Name = "LoadProcedureEditorCtrl";
             this.Size = new System.Drawing.Size(565, 447);
             this.ResumeLayout(false);
 

Modified: sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadProcedureEditorCtrl.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadProcedureEditorCtrl.cs	2010-05-21 10:38:46 UTC (rev 4920)
+++ sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadProcedureEditorCtrl.cs	2010-05-21 11:16:39 UTC (rev 4921)
@@ -24,14 +24,62 @@
 using System.Data;
 using System.Text;
 using System.Windows.Forms;
+using OSGeo.MapGuide.ObjectModels.LoadProcedure;
+using System.Diagnostics;
+using Maestro.Shared.UI;
 
 namespace Maestro.Editors.LoadProcedure
 {
-    public partial class LoadProcedureEditorCtrl : UserControl
+    public partial class LoadProcedureEditorCtrl : UserControl, IEditorBindable
     {
         public LoadProcedureEditorCtrl()
         {
             InitializeComponent();
         }
+
+        private OSGeo.MapGuide.ObjectModels.LoadProcedure.LoadProcedure _lp;
+
+        public void Bind(IEditorService service)
+        {
+            _lp = service.GetEditedResource() as OSGeo.MapGuide.ObjectModels.LoadProcedure.LoadProcedure;
+            Debug.Assert(_lp != null);
+            
+            service.RegisterCustomNotifier(this);
+
+            CollapsiblePanel tp = null;
+
+            if (_lp.Item is SdfLoadProcedureType)
+            {
+                var trans = new SdfTransformationCtrl();
+                trans.Bind(service);
+                tp = trans;
+            }
+            else if (_lp.Item is ShpLoadProcedureType)
+            {
+                var trans = new ShpTransformationCtrl();
+                trans.Bind(service);
+                tp = trans;
+            }
+            else
+            {
+                throw new NotSupportedException();
+            }
+
+            var input = new InputFilesCtrl();
+            input.Bind(service);
+
+            var target = new LoadTargetCtrl();
+            target.Bind(service);
+
+            tp.Dock = DockStyle.Top;
+            input.Dock = DockStyle.Top;
+            target.Dock = DockStyle.Top;
+
+            this.Controls.Add(target);
+            this.Controls.Add(tp);
+            this.Controls.Add(input);
+        }
+
+        public event EventHandler ResourceChanged;
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadTargetCtrl.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadTargetCtrl.Designer.cs	2010-05-21 10:38:46 UTC (rev 4920)
+++ sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadTargetCtrl.Designer.cs	2010-05-21 11:16:39 UTC (rev 4921)
@@ -28,18 +28,205 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.chkCreateFeatureSources = new System.Windows.Forms.CheckBox();
+            this.chkCreateLayers = new System.Windows.Forms.CheckBox();
+            this.txtFeatureSourceRoot = new System.Windows.Forms.TextBox();
+            this.txtLayerRoot = new System.Windows.Forms.TextBox();
+            this.txtTargetRoot = new System.Windows.Forms.TextBox();
+            this.txtFeatureFolderName = new System.Windows.Forms.TextBox();
+            this.txtLayerFolderName = new System.Windows.Forms.TextBox();
+            this.btnBrowseRoot = new System.Windows.Forms.Button();
+            this.btnBrowseLayerRoot = new System.Windows.Forms.Button();
+            this.btnBrowseFeatureRoot = new System.Windows.Forms.Button();
+            this.contentPanel.SuspendLayout();
             this.SuspendLayout();
             // 
+            // contentPanel
+            // 
+            this.contentPanel.Controls.Add(this.btnBrowseFeatureRoot);
+            this.contentPanel.Controls.Add(this.btnBrowseLayerRoot);
+            this.contentPanel.Controls.Add(this.btnBrowseRoot);
+            this.contentPanel.Controls.Add(this.txtLayerFolderName);
+            this.contentPanel.Controls.Add(this.txtFeatureFolderName);
+            this.contentPanel.Controls.Add(this.txtTargetRoot);
+            this.contentPanel.Controls.Add(this.txtLayerRoot);
+            this.contentPanel.Controls.Add(this.txtFeatureSourceRoot);
+            this.contentPanel.Controls.Add(this.chkCreateLayers);
+            this.contentPanel.Controls.Add(this.chkCreateFeatureSources);
+            this.contentPanel.Controls.Add(this.label4);
+            this.contentPanel.Controls.Add(this.label3);
+            this.contentPanel.Controls.Add(this.label2);
+            this.contentPanel.Controls.Add(this.label1);
+            this.contentPanel.Size = new System.Drawing.Size(485, 145);
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(18, 17);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(138, 13);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "Load Resources Into Folder";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label2.Location = new System.Drawing.Point(21, 46);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(44, 13);
+            this.label2.TabIndex = 1;
+            this.label2.Text = "Create";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label3.Location = new System.Drawing.Point(135, 46);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(71, 13);
+            this.label3.TabIndex = 2;
+            this.label3.Text = "In this path";
+            // 
+            // label4
+            // 
+            this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label4.Location = new System.Drawing.Point(360, 46);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(78, 13);
+            this.label4.TabIndex = 3;
+            this.label4.Text = "Folder Name";
+            // 
+            // chkCreateFeatureSources
+            // 
+            this.chkCreateFeatureSources.AutoSize = true;
+            this.chkCreateFeatureSources.Location = new System.Drawing.Point(21, 73);
+            this.chkCreateFeatureSources.Name = "chkCreateFeatureSources";
+            this.chkCreateFeatureSources.Size = new System.Drawing.Size(104, 17);
+            this.chkCreateFeatureSources.TabIndex = 4;
+            this.chkCreateFeatureSources.Text = "Feature Sources";
+            this.chkCreateFeatureSources.UseVisualStyleBackColor = true;
+            // 
+            // chkCreateLayers
+            // 
+            this.chkCreateLayers.AutoSize = true;
+            this.chkCreateLayers.Location = new System.Drawing.Point(21, 102);
+            this.chkCreateLayers.Name = "chkCreateLayers";
+            this.chkCreateLayers.Size = new System.Drawing.Size(104, 17);
+            this.chkCreateLayers.TabIndex = 5;
+            this.chkCreateLayers.Text = "Layer Definitions";
+            this.chkCreateLayers.UseVisualStyleBackColor = true;
+            // 
+            // txtFeatureSourceRoot
+            // 
+            this.txtFeatureSourceRoot.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
+            this.txtFeatureSourceRoot.Location = new System.Drawing.Point(138, 71);
+            this.txtFeatureSourceRoot.Name = "txtFeatureSourceRoot";
+            this.txtFeatureSourceRoot.Size = new System.Drawing.Size(179, 20);
+            this.txtFeatureSourceRoot.TabIndex = 6;
+            // 
+            // txtLayerRoot
+            // 
+            this.txtLayerRoot.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
+            this.txtLayerRoot.Location = new System.Drawing.Point(138, 99);
+            this.txtLayerRoot.Name = "txtLayerRoot";
+            this.txtLayerRoot.Size = new System.Drawing.Size(179, 20);
+            this.txtLayerRoot.TabIndex = 7;
+            // 
+            // txtTargetRoot
+            // 
+            this.txtTargetRoot.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
+            this.txtTargetRoot.Location = new System.Drawing.Point(162, 14);
+            this.txtTargetRoot.Name = "txtTargetRoot";
+            this.txtTargetRoot.Size = new System.Drawing.Size(276, 20);
+            this.txtTargetRoot.TabIndex = 8;
+            // 
+            // txtFeatureFolderName
+            // 
+            this.txtFeatureFolderName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.txtFeatureFolderName.Location = new System.Drawing.Point(363, 71);
+            this.txtFeatureFolderName.Name = "txtFeatureFolderName";
+            this.txtFeatureFolderName.Size = new System.Drawing.Size(100, 20);
+            this.txtFeatureFolderName.TabIndex = 9;
+            // 
+            // txtLayerFolderName
+            // 
+            this.txtLayerFolderName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.txtLayerFolderName.Location = new System.Drawing.Point(363, 100);
+            this.txtLayerFolderName.Name = "txtLayerFolderName";
+            this.txtLayerFolderName.Size = new System.Drawing.Size(100, 20);
+            this.txtLayerFolderName.TabIndex = 10;
+            // 
+            // btnBrowseRoot
+            // 
+            this.btnBrowseRoot.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnBrowseRoot.Location = new System.Drawing.Point(444, 12);
+            this.btnBrowseRoot.Name = "btnBrowseRoot";
+            this.btnBrowseRoot.Size = new System.Drawing.Size(34, 23);
+            this.btnBrowseRoot.TabIndex = 11;
+            this.btnBrowseRoot.Text = "...";
+            this.btnBrowseRoot.UseVisualStyleBackColor = true;
+            this.btnBrowseRoot.Click += new System.EventHandler(this.btnBrowseRoot_Click);
+            // 
+            // btnBrowseLayerRoot
+            // 
+            this.btnBrowseLayerRoot.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnBrowseLayerRoot.Location = new System.Drawing.Point(323, 98);
+            this.btnBrowseLayerRoot.Name = "btnBrowseLayerRoot";
+            this.btnBrowseLayerRoot.Size = new System.Drawing.Size(34, 23);
+            this.btnBrowseLayerRoot.TabIndex = 12;
+            this.btnBrowseLayerRoot.Text = "...";
+            this.btnBrowseLayerRoot.UseVisualStyleBackColor = true;
+            this.btnBrowseLayerRoot.Click += new System.EventHandler(this.btnBrowseLayerRoot_Click);
+            // 
+            // btnBrowseFeatureRoot
+            // 
+            this.btnBrowseFeatureRoot.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnBrowseFeatureRoot.Location = new System.Drawing.Point(323, 69);
+            this.btnBrowseFeatureRoot.Name = "btnBrowseFeatureRoot";
+            this.btnBrowseFeatureRoot.Size = new System.Drawing.Size(34, 23);
+            this.btnBrowseFeatureRoot.TabIndex = 13;
+            this.btnBrowseFeatureRoot.Text = "...";
+            this.btnBrowseFeatureRoot.UseVisualStyleBackColor = true;
+            this.btnBrowseFeatureRoot.Click += new System.EventHandler(this.btnBrowseFeatureRoot_Click);
+            // 
             // LoadTargetCtrl
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.HeaderText = "Load Settings";
             this.Name = "LoadTargetCtrl";
+            this.Size = new System.Drawing.Size(485, 172);
+            this.contentPanel.ResumeLayout(false);
+            this.contentPanel.PerformLayout();
             this.ResumeLayout(false);
 
         }
 
         #endregion
+
+        private System.Windows.Forms.Button btnBrowseFeatureRoot;
+        private System.Windows.Forms.Button btnBrowseLayerRoot;
+        private System.Windows.Forms.Button btnBrowseRoot;
+        private System.Windows.Forms.TextBox txtLayerFolderName;
+        private System.Windows.Forms.TextBox txtFeatureFolderName;
+        private System.Windows.Forms.TextBox txtTargetRoot;
+        private System.Windows.Forms.TextBox txtLayerRoot;
+        private System.Windows.Forms.TextBox txtFeatureSourceRoot;
+        private System.Windows.Forms.CheckBox chkCreateLayers;
+        private System.Windows.Forms.CheckBox chkCreateFeatureSources;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label1;
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadTargetCtrl.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadTargetCtrl.cs	2010-05-21 10:38:46 UTC (rev 4920)
+++ sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/LoadTargetCtrl.cs	2010-05-21 11:16:39 UTC (rev 4921)
@@ -28,11 +28,46 @@
 
 namespace Maestro.Editors.LoadProcedure
 {
-    public partial class LoadTargetCtrl : CollapsiblePanel
+    public partial class LoadTargetCtrl : CollapsiblePanel, IEditorBindable
     {
         public LoadTargetCtrl()
         {
             InitializeComponent();
         }
+
+        private IEditorService _service;
+
+        public void Bind(IEditorService service)
+        {
+            service.RegisterCustomNotifier(this);
+
+            _service = service;
+            var lp = _service.GetEditedResource() as OSGeo.MapGuide.ObjectModels.LoadProcedure.LoadProcedure;
+
+            txtTargetRoot.DataBindings.Add("Text", lp.Item, "RootPath");
+            chkCreateFeatureSources.DataBindings.Add("Checked", lp.Item, "GenerateSpatialDataSources");
+            chkCreateLayers.DataBindings.Add("Checked", lp.Item, "GenerateLayers");
+            txtFeatureSourceRoot.DataBindings.Add("Text", lp.Item, "SpatialDataSourcesPath");
+            txtFeatureFolderName.DataBindings.Add("Text", lp.Item, "SpatialDataSourcesFolder");
+            txtLayerRoot.DataBindings.Add("Text", lp.Item, "LayersPath");
+            txtLayerFolderName.DataBindings.Add("Text", lp.Item, "LayersFolder");
+        }
+
+        public event EventHandler ResourceChanged;
+
+        private void btnBrowseRoot_Click(object sender, EventArgs e)
+        {
+            txtTargetRoot.Text = _service.SelectFolder();
+        }
+
+        private void btnBrowseFeatureRoot_Click(object sender, EventArgs e)
+        {
+            txtFeatureSourceRoot.Text = _service.SelectFolder();
+        }
+
+        private void btnBrowseLayerRoot_Click(object sender, EventArgs e)
+        {
+            txtLayerRoot.Text = _service.SelectFolder();
+        }
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/SdfTransformationCtrl.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/SdfTransformationCtrl.Designer.cs	2010-05-21 10:38:46 UTC (rev 4920)
+++ sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/SdfTransformationCtrl.Designer.cs	2010-05-21 11:16:39 UTC (rev 4921)
@@ -52,6 +52,7 @@
             this.contentPanel.Controls.Add(this.btnBrowseCs);
             this.contentPanel.Controls.Add(this.txtCoordinateSystem);
             this.contentPanel.Controls.Add(this.label1);
+            this.contentPanel.Size = new System.Drawing.Size(449, 236);
             // 
             // label1
             // 
@@ -81,6 +82,7 @@
             this.btnBrowseCs.TabIndex = 2;
             this.btnBrowseCs.Text = "...";
             this.btnBrowseCs.UseVisualStyleBackColor = true;
+            this.btnBrowseCs.Click += new System.EventHandler(this.btnBrowseCs_Click);
             // 
             // label2
             // 
@@ -147,6 +149,7 @@
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.HeaderText = "Transformation";
             this.Name = "SdfTransformationCtrl";
+            this.Size = new System.Drawing.Size(449, 263);
             this.contentPanel.ResumeLayout(false);
             this.contentPanel.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.numGeneralizePercentage)).EndInit();

Modified: sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/SdfTransformationCtrl.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/SdfTransformationCtrl.cs	2010-05-21 10:38:46 UTC (rev 4920)
+++ sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/SdfTransformationCtrl.cs	2010-05-21 11:16:39 UTC (rev 4921)
@@ -25,14 +25,46 @@
 using System.Text;
 using System.Windows.Forms;
 using Maestro.Shared.UI;
+using System.Diagnostics;
+using OSGeo.MapGuide.ObjectModels.LoadProcedure;
 
 namespace Maestro.Editors.LoadProcedure
 {
-    public partial class SdfTransformationCtrl : CollapsiblePanel
+    public partial class SdfTransformationCtrl : CollapsiblePanel, IEditorBindable
     {
         public SdfTransformationCtrl()
         {
             InitializeComponent();
         }
+
+        private IEditorService _service;
+
+        public void Bind(IEditorService service)
+        {
+            _service = service;
+
+            var lp = service.GetEditedResource() as OSGeo.MapGuide.ObjectModels.LoadProcedure.LoadProcedure;
+            Debug.Assert(lp != null);
+
+            service.RegisterCustomNotifier(this);
+
+            var sdflp = lp.Item as OSGeo.MapGuide.ObjectModels.LoadProcedure.SdfLoadProcedureType;
+
+            txtCoordinateSystem.DataBindings.Add("Text", sdflp, "CoordinateSystem");
+            numGeneralizePercentage.DataBindings.Add("Value", sdflp, "Generalization");
+            cmbSdfConflictStrategy.DataSource = Enum.GetValues(typeof(SdfKeyTreatmentType));
+            //cmbSdfConflictStrategy.DataBindings.Add("SelectedItem", sdflp, "SdfKeyTreatement");
+        }
+
+        public event EventHandler ResourceChanged;
+
+        private void btnBrowseCs_Click(object sender, EventArgs e)
+        {
+            string cs = _service.GetCoordinateSystem();
+            if (!string.IsNullOrEmpty(cs) && cs != txtCoordinateSystem.Text)
+            {
+                txtCoordinateSystem.Text = cs;
+            }
+        }
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/ShpTransformationCtrl.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/ShpTransformationCtrl.Designer.cs	2010-05-21 10:38:46 UTC (rev 4920)
+++ sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/ShpTransformationCtrl.Designer.cs	2010-05-21 11:16:39 UTC (rev 4921)
@@ -34,24 +34,27 @@
             this.btnBrowseCs = new System.Windows.Forms.Button();
             this.txtCoordinateSystem = new System.Windows.Forms.TextBox();
             this.label1 = new System.Windows.Forms.Label();
+            this.chkConvertToSdf = new System.Windows.Forms.CheckBox();
             this.contentPanel.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.numGeneralizePercentage)).BeginInit();
             this.SuspendLayout();
             // 
             // contentPanel
             // 
+            this.contentPanel.Controls.Add(this.chkConvertToSdf);
             this.contentPanel.Controls.Add(this.label4);
             this.contentPanel.Controls.Add(this.numGeneralizePercentage);
             this.contentPanel.Controls.Add(this.label2);
             this.contentPanel.Controls.Add(this.btnBrowseCs);
             this.contentPanel.Controls.Add(this.txtCoordinateSystem);
             this.contentPanel.Controls.Add(this.label1);
+            this.contentPanel.Size = new System.Drawing.Size(449, 182);
             // 
             // label4
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.label4.Location = new System.Drawing.Point(18, 118);
+            this.label4.Location = new System.Drawing.Point(18, 142);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(311, 13);
             this.label4.TabIndex = 13;
@@ -104,12 +107,24 @@
             this.label1.TabIndex = 8;
             this.label1.Text = "Use the following Coordinate System (if none found)";
             // 
+            // chkConvertToSdf
+            // 
+            this.chkConvertToSdf.AutoSize = true;
+            this.chkConvertToSdf.Enabled = false;
+            this.chkConvertToSdf.Location = new System.Drawing.Point(21, 113);
+            this.chkConvertToSdf.Name = "chkConvertToSdf";
+            this.chkConvertToSdf.Size = new System.Drawing.Size(99, 17);
+            this.chkConvertToSdf.TabIndex = 14;
+            this.chkConvertToSdf.Text = "Convert to SDF";
+            this.chkConvertToSdf.UseVisualStyleBackColor = true;
+            // 
             // ShpTransformationCtrl
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.HeaderText = "Transformation";
             this.Name = "ShpTransformationCtrl";
+            this.Size = new System.Drawing.Size(449, 209);
             this.contentPanel.ResumeLayout(false);
             this.contentPanel.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.numGeneralizePercentage)).EndInit();
@@ -125,5 +140,6 @@
         private System.Windows.Forms.Button btnBrowseCs;
         private System.Windows.Forms.TextBox txtCoordinateSystem;
         private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.CheckBox chkConvertToSdf;
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/ShpTransformationCtrl.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/ShpTransformationCtrl.cs	2010-05-21 10:38:46 UTC (rev 4920)
+++ sandbox/maestro-2.5/Maestro.Editors/LoadProcedure/ShpTransformationCtrl.cs	2010-05-21 11:16:39 UTC (rev 4921)
@@ -25,14 +25,35 @@
 using System.Text;
 using System.Windows.Forms;
 using Maestro.Shared.UI;
+using System.Diagnostics;
 
 namespace Maestro.Editors.LoadProcedure
 {
-    public partial class ShpTransformationCtrl : CollapsiblePanel
+    public partial class ShpTransformationCtrl : CollapsiblePanel, IEditorBindable
     {
         public ShpTransformationCtrl()
         {
             InitializeComponent();
         }
+
+        private IEditorService _service;
+        
+        public void Bind(IEditorService service)
+        {
+            _service = service;
+
+            var lp = service.GetEditedResource() as OSGeo.MapGuide.ObjectModels.LoadProcedure.LoadProcedure;
+            Debug.Assert(lp != null);
+
+            service.RegisterCustomNotifier(this);
+
+            var shplp = lp.Item as OSGeo.MapGuide.ObjectModels.LoadProcedure.ShpLoadProcedureType;
+
+            txtCoordinateSystem.DataBindings.Add("Text", shplp, "CoordinateSystem");
+            numGeneralizePercentage.DataBindings.Add("Value", shplp, "Generalization");
+            chkConvertToSdf.DataBindings.Add("Checked", shplp, "ConvertToSdf");
+        }
+
+        public event EventHandler ResourceChanged;
     }
 }



More information about the mapguide-commits mailing list