[mapguide-commits] r5276 - in sandbox/maestro-3.0: Generated Maestro.Base/Commands Maestro.Base/Editor Maestro.Base/Templates Maestro.Editors Maestro.Editors/Common Maestro.Editors/DrawingSource Maestro.ResourceValidation Maestro.ResourceValidation/Properties OSGeo.MapGuide.MaestroAPI OSGeo.MapGuide.MaestroAPI/ObjectModels

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Oct 12 20:14:32 EDT 2010


Author: jng
Date: 2010-10-12 17:14:32 -0700 (Tue, 12 Oct 2010)
New Revision: 5276

Added:
   sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/DrawingSourceInterfaces.cs
Removed:
   sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SheetSectionControl.Designer.cs
   sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SheetSectionControl.cs
   sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SheetSectionControl.resx
Modified:
   sandbox/maestro-3.0/Generated/DrawingSource-1.0.0.designer.cs
   sandbox/maestro-3.0/Maestro.Base/Commands/ValidateResourceCommand.cs
   sandbox/maestro-3.0/Maestro.Base/Editor/EditorContentBase.cs
   sandbox/maestro-3.0/Maestro.Base/Editor/IEditorViewContent.cs
   sandbox/maestro-3.0/Maestro.Base/Editor/ResourceEditorService.cs
   sandbox/maestro-3.0/Maestro.Base/Templates/DrawingLayerDefinitionItemTemplate.cs
   sandbox/maestro-3.0/Maestro.Editors/Common/ResourceDataCtrl.Designer.cs
   sandbox/maestro-3.0/Maestro.Editors/Common/ResourceDataCtrl.cs
   sandbox/maestro-3.0/Maestro.Editors/Common/ResourceDataCtrl.resx
   sandbox/maestro-3.0/Maestro.Editors/DrawingSource/DrawingSourceEditorCtrl.Designer.cs
   sandbox/maestro-3.0/Maestro.Editors/DrawingSource/DrawingSourceEditorCtrl.cs
   sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SourceSectionCtrl.Designer.cs
   sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SourceSectionCtrl.cs
   sandbox/maestro-3.0/Maestro.Editors/IEditorService.cs
   sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj
   sandbox/maestro-3.0/Maestro.ResourceValidation/DrawingSourceValidator.cs
   sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.Designer.cs
   sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.resx
   sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
   sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/DrawingSource.cs
   sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaceExtensions.cs
   sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/ObjectFactory.cs
   sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ResourceTypeRegistry.cs
Log:
3.0 sandbox changes:
 - Introduce interfaces for the Drawing Source resource type
 - Complete implementation of the drawing source editor
 - Update resource data control to show tooltips (name) of the resource data items
 - Add new API to IEditorViewContent to allow in-memory and session copies of a resource to remain in sync. This is required for validation.


Modified: sandbox/maestro-3.0/Generated/DrawingSource-1.0.0.designer.cs
===================================================================
--- sandbox/maestro-3.0/Generated/DrawingSource-1.0.0.designer.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Generated/DrawingSource-1.0.0.designer.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -4,7 +4,7 @@
 //    <NameSpace>OSGeo.MapGuide.ObjectModels.Common</NameSpace><Collection>BindingList</Collection><codeType>CSharp</codeType><EnableDataBinding>True</EnableDataBinding><EnableLasyLoading>False</EnableLasyLoading><HidePrivateFieldInIDE>True</HidePrivateFieldInIDE><EnableSummaryComment>True</EnableSummaryComment><IncludeSerializeMethod>True</IncludeSerializeMethod><UseBaseClass>False</UseBaseClass><GenerateCloneMethod>True</GenerateCloneMethod><GenerateDataContracts>False</GenerateDataContracts><CodeBaseTag>Net20</CodeBaseTag><SerializeMethodName>Serialize</SerializeMethodName><DeserializeMethodName>Deserialize</DeserializeMethodName><SaveToFileMethodName>SaveToFile</SaveToFileMethodName><LoadFromFileMethodName>LoadFromFile</LoadFromFileMethodName><GenerateXMLAttributes>True</GenerateXMLAttributes><AutomaticProperties>False</AutomaticProperties><DisableDebug>False</DisableDebug><CustomUsings></CustomUsings><ExcludeIncludedTypes>False</ExcludeIncludedTypes><EnableInitializeFie
 lds>False</EnableInitializeFields>
 //  </auto-generated>
 // ------------------------------------------------------------------------------
-namespace OSGeo.MapGuide.ObjectModels.Common {
+namespace OSGeo.MapGuide.ObjectModels.DrawingSource {
     using System;
     using System.Diagnostics;
     using System.Xml.Serialization;

Modified: sandbox/maestro-3.0/Maestro.Base/Commands/ValidateResourceCommand.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Commands/ValidateResourceCommand.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Base/Commands/ValidateResourceCommand.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -51,6 +51,7 @@
                 var pdlg = new ProgressDialog();
                 pdlg.CancelAbortsThread = true;
 
+                ed.SyncSessionCopy();
                 var issues = (ValidationIssue[])pdlg.RunOperationAsync(wb, new ProgressDialog.DoBackgroundWork(BackgroundValidate), ed.Resource.ResourceID);
 
                 if (issues != null)

Modified: sandbox/maestro-3.0/Maestro.Base/Editor/EditorContentBase.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Editor/EditorContentBase.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Base/Editor/EditorContentBase.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -246,5 +246,10 @@
             //Now feed it to the preview engine
             return new ResourcePreviewEngine(mapguideRootUrl, this.EditorService).GeneratePreviewUrl(previewCopy);
         }
+
+        public void SyncSessionCopy()
+        {
+            this.EditorService.SyncSessionCopy();
+        }
     }
 }

Modified: sandbox/maestro-3.0/Maestro.Base/Editor/IEditorViewContent.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Editor/IEditorViewContent.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Base/Editor/IEditorViewContent.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -92,5 +92,11 @@
         /// Raised when the value of <see cref="IsDirty"/> changes
         /// </summary>
         event EventHandler DirtyStateChanged;
+
+        /// <summary>
+        /// Instructs the editor to write the in-memory edited resource back to the session
+        /// repository. This is called before the edited resource is to be validated
+        /// </summary>
+        void SyncSessionCopy();
     }
 }

Modified: sandbox/maestro-3.0/Maestro.Base/Editor/ResourceEditorService.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Editor/ResourceEditorService.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Base/Editor/ResourceEditorService.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -192,29 +192,6 @@
             }
         }
 
-        /*
-        public void AddResourceData(string dataName, OSGeo.MapGuide.ObjectModels.Common.ResourceDataType type, System.IO.Stream stream)
-        {
-            //_conn.ResourceService.SetResourceData(_editCopy.ResourceID, dataName, type, stream);
-            _editCopy.SetResourceData(dataName, type, stream);
-            this.IsDirty = true;
-            OnDirtyStateChanged();
-        }
-
-        public System.IO.MemoryStream GetResourceData(string dataName)
-        {
-            //return _conn.ResourceService.GetResourceData(_editCopy.ResourceID, dataName);
-            _editCopy.GetResourceData(dataName);
-        }
-
-        public void RemoveResourceData(string dataName)
-        {
-            //_conn.ResourceService.DeleteResourceData(_editCopy.ResourceID, dataName);
-            _editCopy.DeleteResourceData(dataName);
-            OnDirtyStateChanged();
-        }
-         */
-
         public string EditedResourceID
         {
             get { return _editCopy.ResourceID; }
@@ -316,5 +293,10 @@
         }
 
         public event EventHandler Saved;
+
+        public void SyncSessionCopy()
+        {
+            this.ResourceService.SetResourceXmlData(_editCopy.ResourceID, _editCopy.SerializeToStream());
+        }
     }
 }

Modified: sandbox/maestro-3.0/Maestro.Base/Templates/DrawingLayerDefinitionItemTemplate.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Templates/DrawingLayerDefinitionItemTemplate.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Base/Templates/DrawingLayerDefinitionItemTemplate.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -24,6 +24,8 @@
 using OSGeo.MapGuide.MaestroAPI;
 using OSGeo.MapGuide.MaestroAPI.ObjectModels;
 using OSGeo.MapGuide.MaestroAPI.Resource;
+using Maestro.Editors.Generic;
+using OSGeo.MapGuide.ObjectModels.LayerDefinition;
 
 namespace Maestro.Base.Templates
 {
@@ -40,7 +42,16 @@
 
         public override IResource CreateItem(IServerConnection conn)
         {
-            return ObjectFactory.CreateDefaultLayer(conn, OSGeo.MapGuide.ObjectModels.LayerDefinition.LayerType.Drawing, new Version(1, 0, 0));
+            using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.DrawingSource, ResourcePickerMode.OpenResource))
+            {
+                if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+                {
+                    var ldf = ObjectFactory.CreateDefaultLayer(conn, OSGeo.MapGuide.ObjectModels.LayerDefinition.LayerType.Drawing, new Version(1, 0, 0));
+                    ldf.SubLayer.ResourceId = picker.ResourceID;
+                    return ldf;
+                }
+                return null;
+            }
         }
     }
 }

Modified: sandbox/maestro-3.0/Maestro.Editors/Common/ResourceDataCtrl.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Common/ResourceDataCtrl.Designer.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Editors/Common/ResourceDataCtrl.Designer.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -96,6 +96,7 @@
             this.lstDataFiles.Location = new System.Drawing.Point(0, 25);
             this.lstDataFiles.MultiSelect = false;
             this.lstDataFiles.Name = "lstDataFiles";
+            this.lstDataFiles.ShowItemToolTips = true;
             this.lstDataFiles.Size = new System.Drawing.Size(453, 185);
             this.lstDataFiles.SmallImageList = this.imgIcons;
             this.lstDataFiles.TabIndex = 3;

Modified: sandbox/maestro-3.0/Maestro.Editors/Common/ResourceDataCtrl.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Common/ResourceDataCtrl.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Editors/Common/ResourceDataCtrl.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -252,6 +252,7 @@
                 item.Tag = f;
                 item.Text = f.Name;
                 item.Name = f.Name;
+                item.ToolTipText = f.Name;
 
                 if (_defaultFont == null)
                     _defaultFont = item.Font;

Modified: sandbox/maestro-3.0/Maestro.Editors/Common/ResourceDataCtrl.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Common/ResourceDataCtrl.resx	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Editors/Common/ResourceDataCtrl.resx	2010-10-13 00:14:32 UTC (rev 5276)
@@ -128,7 +128,7 @@
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
         ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAK
-        CAAAAk1TRnQBSQFMAwEBAAEYAQABGAEAARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
+        CAAAAk1TRnQBSQFMAwEBAAEgAQABIAEAARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
         AUADAAEQAwABAQEAAQgGAAEEGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA
         AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA
         AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm

Modified: sandbox/maestro-3.0/Maestro.Editors/DrawingSource/DrawingSourceEditorCtrl.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/DrawingSource/DrawingSourceEditorCtrl.Designer.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Editors/DrawingSource/DrawingSourceEditorCtrl.Designer.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -28,49 +28,35 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.sourceDataCtrl = new Maestro.Editors.DrawingSource.SourceSectionCtrl();
-            this.sheetConfigCtrl = new Maestro.Editors.DrawingSource.SheetSectionControl();
+            this.sourceSectionCtrl = new Maestro.Editors.DrawingSource.SourceSectionCtrl();
             this.SuspendLayout();
             // 
-            // sourceDataCtrl
+            // sourceSectionCtrl
             // 
-            this.sourceDataCtrl.ContentBackgroundColor = System.Drawing.SystemColors.Control;
-            this.sourceDataCtrl.Dock = System.Windows.Forms.DockStyle.Top;
-            this.sourceDataCtrl.HeaderBackgroundColor = System.Drawing.Color.LightSteelBlue;
-            this.sourceDataCtrl.HeaderFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.sourceDataCtrl.HeaderText = "DWF File Source";
-            this.sourceDataCtrl.Location = new System.Drawing.Point(0, 0);
-            this.sourceDataCtrl.Name = "sourceDataCtrl";
-            this.sourceDataCtrl.Size = new System.Drawing.Size(509, 265);
-            this.sourceDataCtrl.TabIndex = 0;
+            this.sourceSectionCtrl.ContentBackgroundColor = System.Drawing.SystemColors.Control;
+            this.sourceSectionCtrl.Dock = System.Windows.Forms.DockStyle.Top;
+            this.sourceSectionCtrl.HeaderBackgroundColor = System.Drawing.Color.LightSteelBlue;
+            this.sourceSectionCtrl.HeaderFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.sourceSectionCtrl.HeaderText = "DWF Drawing Source";
+            this.sourceSectionCtrl.Location = new System.Drawing.Point(0, 0);
+            this.sourceSectionCtrl.Name = "sourceSectionCtrl";
+            this.sourceSectionCtrl.Size = new System.Drawing.Size(509, 265);
+            this.sourceSectionCtrl.TabIndex = 0;
             // 
-            // sheetConfigCtrl
-            // 
-            this.sheetConfigCtrl.ContentBackgroundColor = System.Drawing.SystemColors.Control;
-            this.sheetConfigCtrl.Dock = System.Windows.Forms.DockStyle.Top;
-            this.sheetConfigCtrl.HeaderBackgroundColor = System.Drawing.Color.LightSteelBlue;
-            this.sheetConfigCtrl.HeaderFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.sheetConfigCtrl.HeaderText = "Sheet Configuration";
-            this.sheetConfigCtrl.Location = new System.Drawing.Point(0, 265);
-            this.sheetConfigCtrl.Name = "sheetConfigCtrl";
-            this.sheetConfigCtrl.Size = new System.Drawing.Size(509, 196);
-            this.sheetConfigCtrl.TabIndex = 1;
-            // 
             // DrawingSourceEditorCtrl
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.Controls.Add(this.sheetConfigCtrl);
-            this.Controls.Add(this.sourceDataCtrl);
+            this.Controls.Add(this.sourceSectionCtrl);
             this.Name = "DrawingSourceEditorCtrl";
-            this.Size = new System.Drawing.Size(509, 422);
+            this.Size = new System.Drawing.Size(509, 267);
             this.ResumeLayout(false);
 
         }
 
         #endregion
 
-        private SourceSectionCtrl sourceDataCtrl;
-        private SheetSectionControl sheetConfigCtrl;
+        private SourceSectionCtrl sourceSectionCtrl;
+
     }
 }

Modified: sandbox/maestro-3.0/Maestro.Editors/DrawingSource/DrawingSourceEditorCtrl.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/DrawingSource/DrawingSourceEditorCtrl.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Editors/DrawingSource/DrawingSourceEditorCtrl.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -33,5 +33,11 @@
         {
             InitializeComponent();
         }
+
+        public override void Bind(IEditorService service)
+        {
+            service.RegisterCustomNotifier(this);
+            sourceSectionCtrl.Bind(service);
+        }
     }
 }

Deleted: sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SheetSectionControl.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SheetSectionControl.Designer.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SheetSectionControl.Designer.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -1,185 +0,0 @@
-namespace Maestro.Editors.DrawingSource
-{
-    partial class SheetSectionControl
-    {
-        /// <summary> 
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary> 
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Component Designer generated code
-
-        /// <summary> 
-        /// Required method for Designer support - do not modify 
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.label1 = new System.Windows.Forms.Label();
-            this.lstSheets = new System.Windows.Forms.ListBox();
-            this.groupBox1 = new System.Windows.Forms.GroupBox();
-            this.label2 = new System.Windows.Forms.Label();
-            this.label3 = new System.Windows.Forms.Label();
-            this.label4 = new System.Windows.Forms.Label();
-            this.label5 = new System.Windows.Forms.Label();
-            this.numMinX = new System.Windows.Forms.TextBox();
-            this.numMinY = new System.Windows.Forms.TextBox();
-            this.numMaxX = new System.Windows.Forms.TextBox();
-            this.numMaxY = new System.Windows.Forms.TextBox();
-            this.contentPanel.SuspendLayout();
-            this.groupBox1.SuspendLayout();
-            this.SuspendLayout();
-            // 
-            // contentPanel
-            // 
-            this.contentPanel.Controls.Add(this.groupBox1);
-            this.contentPanel.Controls.Add(this.lstSheets);
-            this.contentPanel.Controls.Add(this.label1);
-            this.contentPanel.Size = new System.Drawing.Size(449, 169);
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(18, 24);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(86, 13);
-            this.label1.TabIndex = 0;
-            this.label1.Text = "Available Sheets";
-            // 
-            // lstSheets
-            // 
-            this.lstSheets.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                        | System.Windows.Forms.AnchorStyles.Left)));
-            this.lstSheets.FormattingEnabled = true;
-            this.lstSheets.Location = new System.Drawing.Point(21, 40);
-            this.lstSheets.Name = "lstSheets";
-            this.lstSheets.Size = new System.Drawing.Size(148, 108);
-            this.lstSheets.TabIndex = 1;
-            // 
-            // groupBox1
-            // 
-            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.numMaxY);
-            this.groupBox1.Controls.Add(this.numMaxX);
-            this.groupBox1.Controls.Add(this.numMinY);
-            this.groupBox1.Controls.Add(this.numMinX);
-            this.groupBox1.Controls.Add(this.label5);
-            this.groupBox1.Controls.Add(this.label4);
-            this.groupBox1.Controls.Add(this.label3);
-            this.groupBox1.Controls.Add(this.label2);
-            this.groupBox1.Location = new System.Drawing.Point(186, 24);
-            this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(248, 133);
-            this.groupBox1.TabIndex = 2;
-            this.groupBox1.TabStop = false;
-            this.groupBox1.Text = "Sheet Extents";
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(15, 22);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(34, 13);
-            this.label2.TabIndex = 0;
-            this.label2.Text = "Min X";
-            // 
-            // label3
-            // 
-            this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(15, 48);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(34, 13);
-            this.label3.TabIndex = 1;
-            this.label3.Text = "Min Y";
-            // 
-            // label4
-            // 
-            this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(15, 74);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(37, 13);
-            this.label4.TabIndex = 2;
-            this.label4.Text = "Max X";
-            // 
-            // label5
-            // 
-            this.label5.AutoSize = true;
-            this.label5.Location = new System.Drawing.Point(15, 100);
-            this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(37, 13);
-            this.label5.TabIndex = 3;
-            this.label5.Text = "Max Y";
-            // 
-            // numMinX
-            // 
-            this.numMinX.Location = new System.Drawing.Point(73, 19);
-            this.numMinX.Name = "numMinX";
-            this.numMinX.Size = new System.Drawing.Size(151, 20);
-            this.numMinX.TabIndex = 4;
-            // 
-            // numMinY
-            // 
-            this.numMinY.Location = new System.Drawing.Point(73, 45);
-            this.numMinY.Name = "numMinY";
-            this.numMinY.Size = new System.Drawing.Size(151, 20);
-            this.numMinY.TabIndex = 5;
-            // 
-            // numMaxX
-            // 
-            this.numMaxX.Location = new System.Drawing.Point(73, 71);
-            this.numMaxX.Name = "numMaxX";
-            this.numMaxX.Size = new System.Drawing.Size(151, 20);
-            this.numMaxX.TabIndex = 6;
-            // 
-            // numMaxY
-            // 
-            this.numMaxY.Location = new System.Drawing.Point(73, 97);
-            this.numMaxY.Name = "numMaxY";
-            this.numMaxY.Size = new System.Drawing.Size(151, 20);
-            this.numMaxY.TabIndex = 7;
-            // 
-            // SheetSectionControl
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.HeaderText = "Sheet Configuration";
-            this.Name = "SheetSectionControl";
-            this.Size = new System.Drawing.Size(449, 196);
-            this.contentPanel.ResumeLayout(false);
-            this.contentPanel.PerformLayout();
-            this.groupBox1.ResumeLayout(false);
-            this.groupBox1.PerformLayout();
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-
-        private System.Windows.Forms.GroupBox groupBox1;
-        private System.Windows.Forms.ListBox lstSheets;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.TextBox numMaxY;
-        private System.Windows.Forms.TextBox numMaxX;
-        private System.Windows.Forms.TextBox numMinY;
-        private System.Windows.Forms.TextBox numMinX;
-        private System.Windows.Forms.Label label5;
-        private System.Windows.Forms.Label label4;
-        private System.Windows.Forms.Label label3;
-        private System.Windows.Forms.Label label2;
-    }
-}

Deleted: sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SheetSectionControl.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SheetSectionControl.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SheetSectionControl.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -1,39 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2010, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-// 
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-// 
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-// 
-#endregion
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Drawing;
-using System.Data;
-using System.Text;
-using System.Windows.Forms;
-using Maestro.Shared.UI;
-
-namespace Maestro.Editors.DrawingSource
-{
-    [ToolboxItem(true)]
-    internal partial class SheetSectionControl : CollapsiblePanel
-    {
-        public SheetSectionControl()
-        {
-            InitializeComponent();
-        }
-    }
-}

Deleted: sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SheetSectionControl.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SheetSectionControl.resx	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SheetSectionControl.resx	2010-10-13 00:14:32 UTC (rev 5276)
@@ -1,120 +0,0 @@
-<?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-3.0/Maestro.Editors/DrawingSource/SourceSectionCtrl.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SourceSectionCtrl.Designer.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SourceSectionCtrl.Designer.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -28,31 +28,23 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.sourceDataCtrl1 = new Maestro.Editors.Common.SourceDataCtrl();
             this.label1 = new System.Windows.Forms.Label();
             this.txtSourceCs = new System.Windows.Forms.TextBox();
             this.btnBrowseCs = new System.Windows.Forms.Button();
+            this.resDataCtrl = new Maestro.Editors.Common.ResourceDataCtrl();
+            this.label2 = new System.Windows.Forms.Label();
             this.contentPanel.SuspendLayout();
             this.SuspendLayout();
             // 
             // contentPanel
             // 
+            this.contentPanel.Controls.Add(this.label2);
+            this.contentPanel.Controls.Add(this.resDataCtrl);
             this.contentPanel.Controls.Add(this.btnBrowseCs);
             this.contentPanel.Controls.Add(this.txtSourceCs);
             this.contentPanel.Controls.Add(this.label1);
-            this.contentPanel.Controls.Add(this.sourceDataCtrl1);
             this.contentPanel.Size = new System.Drawing.Size(449, 238);
             // 
-            // sourceDataCtrl1
-            // 
-            this.sourceDataCtrl1.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.sourceDataCtrl1.Location = new System.Drawing.Point(0, 0);
-            this.sourceDataCtrl1.Name = "sourceDataCtrl1";
-            this.sourceDataCtrl1.Size = new System.Drawing.Size(449, 199);
-            this.sourceDataCtrl1.TabIndex = 0;
-            // 
             // label1
             // 
             this.label1.AutoSize = true;
@@ -77,12 +69,34 @@
             this.btnBrowseCs.TabIndex = 3;
             this.btnBrowseCs.Text = "...";
             this.btnBrowseCs.UseVisualStyleBackColor = true;
+            this.btnBrowseCs.Click += new System.EventHandler(this.btnBrowseCs_Click);
             // 
+            // resDataCtrl
+            // 
+            this.resDataCtrl.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.resDataCtrl.Location = new System.Drawing.Point(17, 28);
+            this.resDataCtrl.MarkedFile = "";
+            this.resDataCtrl.MarkEnabled = true;
+            this.resDataCtrl.Name = "resDataCtrl";
+            this.resDataCtrl.Size = new System.Drawing.Size(419, 171);
+            this.resDataCtrl.TabIndex = 4;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(17, 9);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(190, 13);
+            this.label2.TabIndex = 5;
+            this.label2.Text = "Data File (Mark the designated source)";
+            // 
             // SourceSectionCtrl
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.HeaderText = "DWF File Source";
+            this.HeaderText = "DWF Drawing Source";
             this.Name = "SourceSectionCtrl";
             this.Size = new System.Drawing.Size(449, 265);
             this.contentPanel.ResumeLayout(false);
@@ -93,10 +107,11 @@
 
         #endregion
 
-        private Maestro.Editors.Common.SourceDataCtrl sourceDataCtrl1;
         private System.Windows.Forms.TextBox txtSourceCs;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Button btnBrowseCs;
+        private Maestro.Editors.Common.ResourceDataCtrl resDataCtrl;
+        private System.Windows.Forms.Label label2;
 
     }
 }

Modified: sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SourceSectionCtrl.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SourceSectionCtrl.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Editors/DrawingSource/SourceSectionCtrl.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -25,15 +25,60 @@
 using System.Text;
 using System.Windows.Forms;
 using Maestro.Shared.UI;
+using Maestro.Editors.Common;
+using OSGeo.MapGuide.MaestroAPI.ObjectModels;
+using OSGeo.MapGuide.MaestroAPI.Services;
 
 namespace Maestro.Editors.DrawingSource
 {
     [ToolboxItem(true)]
-    internal partial class SourceSectionCtrl : CollapsiblePanel
+    internal partial class SourceSectionCtrl : EditorBindableCollapsiblePanel
     {
         public SourceSectionCtrl()
         {
             InitializeComponent();
         }
+
+        private IDrawingSource _dws;
+        private IEditorService _edSvc;
+
+        public override void Bind(IEditorService service)
+        {
+            _edSvc = service;
+            _edSvc.RegisterCustomNotifier(this);
+            _dws = (IDrawingSource)service.GetEditedResource();
+
+            resDataCtrl.Init(service);
+            resDataCtrl.DataListChanged += (sender, e) => { OnResourceChanged(); };
+            resDataCtrl.ResourceDataMarked += new ResourceDataSelectionEventHandler(OnResourceDataMarked);
+            TextBoxBinder.BindText(txtSourceCs, _dws, "CoordinateSpace");
+            MarkSelected();
+        }
+
+        private void MarkSelected()
+        {
+            var file = _dws.SourceName;
+            if (!string.IsNullOrEmpty(file))
+            {
+                resDataCtrl.MarkedFile = file;
+            }
+        }
+
+        void OnResourceDataMarked(object sender, string dataName)
+        {
+            if (!dataName.Equals(_dws.SourceName))
+            {
+                _dws.SourceName = dataName;
+            }
+        }
+
+        private void btnBrowseCs_Click(object sender, EventArgs e)
+        {
+            var cs = _edSvc.GetCoordinateSystem();
+            if (!string.IsNullOrEmpty(cs))
+            {
+                _dws.CoordinateSpace = cs;
+            }
+        }
     }
 }

Modified: sandbox/maestro-3.0/Maestro.Editors/IEditorService.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/IEditorService.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Editors/IEditorService.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -199,5 +199,7 @@
         /// Raised when the edited resource is saved
         /// </summary>
         event EventHandler Saved;
+
+        void SyncSessionCopy();
     }
 }

Modified: sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj	2010-10-13 00:14:32 UTC (rev 5276)
@@ -119,12 +119,6 @@
     <Compile Include="DrawingSource\DrawingSourceEditorCtrl.Designer.cs">
       <DependentUpon>DrawingSourceEditorCtrl.cs</DependentUpon>
     </Compile>
-    <Compile Include="DrawingSource\SheetSectionControl.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="DrawingSource\SheetSectionControl.Designer.cs">
-      <DependentUpon>SheetSectionControl.cs</DependentUpon>
-    </Compile>
     <Compile Include="DrawingSource\SourceSectionCtrl.cs">
       <SubType>UserControl</SubType>
     </Compile>
@@ -592,10 +586,6 @@
       <DependentUpon>DrawingSourceEditorCtrl.cs</DependentUpon>
       <SubType>Designer</SubType>
     </EmbeddedResource>
-    <EmbeddedResource Include="DrawingSource\SheetSectionControl.resx">
-      <DependentUpon>SheetSectionControl.cs</DependentUpon>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
     <EmbeddedResource Include="DrawingSource\SourceSectionCtrl.resx">
       <DependentUpon>SourceSectionCtrl.cs</DependentUpon>
       <SubType>Designer</SubType>

Modified: sandbox/maestro-3.0/Maestro.ResourceValidation/DrawingSourceValidator.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.ResourceValidation/DrawingSourceValidator.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.ResourceValidation/DrawingSourceValidator.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -22,6 +22,7 @@
 using System.Text;
 using OSGeo.MapGuide.MaestroAPI.Resource;
 using OSGeo.MapGuide.MaestroAPI;
+using OSGeo.MapGuide.MaestroAPI.ObjectModels;
 
 namespace Maestro.ResourceValidation
 {
@@ -32,7 +33,16 @@
             if (resource.ResourceType != ResourceTypes.DrawingSource)
                 return null;
 
-            return new ValidationIssue[0];
+            var issues = new List<ValidationIssue>();
+
+            IDrawingSource dws = (IDrawingSource)resource;
+            if (string.IsNullOrEmpty(dws.SourceName))
+                issues.Add(new ValidationIssue(resource, ValidationStatus.Error, Properties.Resources.DS_NoSourceSpecified));
+
+            if (string.IsNullOrEmpty(dws.CoordinateSpace))
+                issues.Add(new ValidationIssue(resource, ValidationStatus.Information, Properties.Resources.DS_NoCoordinateSpace));
+
+            return issues.ToArray();
         }
 
         public ResourceTypeDescriptor SupportedResourceAndVersion

Modified: sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.Designer.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.Designer.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -97,6 +97,24 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to No coordinate system specified. The coordinate system if not specified will default to LL84.
+        /// </summary>
+        internal static string DS_NoCoordinateSpace {
+            get {
+                return ResourceManager.GetString("DS_NoCoordinateSpace", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to No source DWF file specified.
+        /// </summary>
+        internal static string DS_NoSourceSpecified {
+            get {
+                return ResourceManager.GetString("DS_NoSourceSpecified", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to Connection test failed.
         /// </summary>
         internal static string FS_ConnectionTestFailed {

Modified: sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.resx	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.resx	2010-10-13 00:14:32 UTC (rev 5276)
@@ -133,6 +133,12 @@
     <value>Fusion application specifies a start view that is outside the map's initial extents</value>
     <comment>An error message that is displayed if the start view is outside the defined map</comment>
   </data>
+  <data name="DS_NoCoordinateSpace" xml:space="preserve">
+    <value>No coordinate system specified. The coordinate system if not specified will default to LL84</value>
+  </data>
+  <data name="DS_NoSourceSpecified" xml:space="preserve">
+    <value>No source DWF file specified</value>
+  </data>
   <data name="FS_ConnectionTestFailed" xml:space="preserve">
     <value>Connection test failed</value>
     <comment>An error message that is displayed if a connection test on the feature source failed</comment>

Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj	2010-10-13 00:14:32 UTC (rev 5276)
@@ -190,6 +190,7 @@
     <Compile Include="Mapping\RuntimeMapBase.cs" />
     <Compile Include="ObjectModels\ApplicationDefinition.cs" />
     <Compile Include="ObjectModels\DrawingSource.cs" />
+    <Compile Include="ObjectModels\DrawingSourceInterfaces.cs" />
     <Compile Include="ObjectModels\FeatureSourceInterfaces.cs" />
     <Compile Include="ObjectModels\GridLayerDefinitionImpl.cs" />
     <Compile Include="ObjectModels\IDynamicInvokable.cs" />

Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/DrawingSource.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/DrawingSource.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/DrawingSource.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -23,10 +23,11 @@
 using OSGeo.MapGuide.MaestroAPI.Resource;
 using System.Xml.Serialization;
 using OSGeo.MapGuide.MaestroAPI;
+using OSGeo.MapGuide.MaestroAPI.ObjectModels;
 
-namespace OSGeo.MapGuide.ObjectModels.Common
+namespace OSGeo.MapGuide.ObjectModels.DrawingSource
 {
-    partial class DrawingSource : IResource
+    partial class DrawingSource : IDrawingSource
     {
         internal DrawingSource() { }
 
@@ -97,5 +98,76 @@
         {
             get { return true; }
         }
+
+        void IDrawingSource.RemoveAllSheets()
+        {
+            this.Sheet.Clear();
+        }
+
+        IEnumerable<IDrawingSourceSheet> IDrawingSource.Sheet
+        {
+            get 
+            {
+                foreach (var sht in this.Sheet)
+                {
+                    yield return sht;
+                }
+            }
+        }
+
+        void IDrawingSource.AddSheet(IDrawingSourceSheet sheet)
+        {
+            var sht = sheet as DrawingSourceSheet;
+            if (sht != null)
+                this.Sheet.Add(sht);
+        }
+
+        void IDrawingSource.RemoveSheet(IDrawingSourceSheet sheet)
+        {
+            var sht = sheet as DrawingSourceSheet;
+            if (sht != null)
+                this.Sheet.Remove(sht);
+        }
     }
+
+    partial class DrawingSourceSheet : IDrawingSourceSheet
+    {
+        OSGeo.MapGuide.ObjectModels.Common.Envelope IDrawingSourceSheet.Extent
+        {
+            get
+            {
+                if (this.Extent == null)
+                {
+                    return null;
+                }
+                else
+                {
+                    return new OSGeo.MapGuide.ObjectModels.Common.Envelope()
+                    {
+                        MaxX = this.Extent.MaxX,
+                        MaxY = this.Extent.MaxY,
+                        MinX = this.Extent.MinX,
+                        MinY = this.Extent.MinY
+                    };
+                }
+            }
+            set
+            {
+                if (value == null)
+                {
+                    this.Extent = null;
+                }
+                else
+                {
+                    if (this.Extent == null)
+                        this.Extent = new DrawingSourceSheetExtent();
+
+                    this.Extent.MaxX = value.MaxX;
+                    this.Extent.MaxY = value.MaxY;
+                    this.Extent.MinX = value.MinX;
+                    this.Extent.MinY = value.MinY;
+                }
+            }
+        }
+    }
 }

Added: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/DrawingSourceInterfaces.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/DrawingSourceInterfaces.cs	                        (rev 0)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/DrawingSourceInterfaces.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -0,0 +1,49 @@
+#region Disclaimer / License
+// Copyright (C) 2010, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+// 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+// 
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OSGeo.MapGuide.MaestroAPI.Resource;
+using OSGeo.MapGuide.ObjectModels.Common;
+
+namespace OSGeo.MapGuide.MaestroAPI.ObjectModels
+{
+    public interface IDrawingSource : IResource
+    {
+        string SourceName { get; set; }
+
+        string CoordinateSpace { get; set; }
+
+        void RemoveAllSheets();
+
+        IEnumerable<IDrawingSourceSheet> Sheet { get; }
+
+        void AddSheet(IDrawingSourceSheet sheet);
+
+        void RemoveSheet(IDrawingSourceSheet sheet);
+    }
+
+    public interface IDrawingSourceSheet
+    {
+        string Name { get; set; }
+
+        Envelope Extent { get; set; }
+    }
+}

Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaceExtensions.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaceExtensions.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaceExtensions.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -155,7 +155,7 @@
                         if (Array.IndexOf(services, (int)ServiceType.Drawing) >= 0)
                         {
                             var sheet = ((IDrawingLayerDefinition)layer.SubLayer).Sheet;
-                            var dws = (DrawingSource)conn.ResourceService.GetResource(((IDrawingLayerDefinition)layer.SubLayer).ResourceId);
+                            var dws = (IDrawingSource)conn.ResourceService.GetResource(((IDrawingLayerDefinition)layer.SubLayer).ResourceId);
 
                             var csCat = conn.CoordinateSystemCatalog;
                             return csCat.ConvertCoordinateSystemCodeToWkt(dws.CoordinateSpace);
@@ -194,7 +194,7 @@
                         if (Array.IndexOf(services, (int)ServiceType.Drawing) >= 0)
                         {
                             var sheet = ((IDrawingLayerDefinition)layer.SubLayer).Sheet;
-                            var dws = (DrawingSource)conn.ResourceService.GetResource(((IDrawingLayerDefinition)layer.SubLayer).ResourceId);
+                            var dws = (IDrawingSource)conn.ResourceService.GetResource(((IDrawingLayerDefinition)layer.SubLayer).ResourceId);
 
                             //find matching sheet
                             foreach (var sht in dws.Sheet)

Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/ObjectFactory.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/ObjectFactory.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/ObjectFactory.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -33,6 +33,7 @@
 using OSGeo.MapGuide.ObjectModels.Common;
 using System.Drawing;
 using OSGeo.MapGuide.MaestroAPI.Services;
+using OSGeo.MapGuide.ObjectModels.DrawingSource;
 
 namespace OSGeo.MapGuide.MaestroAPI.ObjectModels
 {
@@ -86,11 +87,16 @@
             return layer;
         }
 
-        public static DrawingSource CreateDrawingSource(IServerConnection owner)
+        public static IDrawingSource CreateDrawingSource(IServerConnection owner)
         {
             Check.NotNull(owner, "owner");
 
-            return new DrawingSource() { CurrentConnection = owner };
+            return new DrawingSource() 
+            { 
+                CurrentConnection = owner,
+                SourceName = string.Empty,
+                CoordinateSpace = string.Empty
+            };
         }
 
         public static IFeatureSource CreateFeatureSource(IServerConnection owner, string provider)

Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ResourceTypeRegistry.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ResourceTypeRegistry.cs	2010-10-12 12:31:54 UTC (rev 5275)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ResourceTypeRegistry.cs	2010-10-13 00:14:32 UTC (rev 5276)
@@ -36,6 +36,7 @@
 using OSGeo.MapGuide.MaestroAPI.ObjectModels;
 using OSGeo.MapGuide.ObjectModels.FeatureSource;
 using OSGeo.MapGuide.ObjectModels.MapDefinition;
+using OSGeo.MapGuide.ObjectModels.DrawingSource;
 
 namespace OSGeo.MapGuide.MaestroAPI
 {



More information about the mapguide-commits mailing list