[mapguide-commits] r5691 - trunk/Tools/Maestro/Maestro.Base/Editor

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Apr 11 05:59:00 EDT 2011


Author: jng
Date: 2011-04-11 02:58:59 -0700 (Mon, 11 Apr 2011)
New Revision: 5691

Modified:
   trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.Designer.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.resx
   trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.Designer.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.resx
   trunk/Tools/Maestro/Maestro.Base/Editor/FusionEditor.Designer.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/FusionEditor.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/FusionEditor.resx
   trunk/Tools/Maestro/Maestro.Base/Editor/LayerDefinitionEditor.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.Designer.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.resx
   trunk/Tools/Maestro/Maestro.Base/Editor/MapDefinitionEditor.Designer.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/MapDefinitionEditor.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/MapDefinitionEditor.resx
   trunk/Tools/Maestro/Maestro.Base/Editor/PrintLayoutEditor.Designer.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/PrintLayoutEditor.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/PrintLayoutEditor.resx
   trunk/Tools/Maestro/Maestro.Base/Editor/WebLayoutEditor.Designer.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/WebLayoutEditor.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/WebLayoutEditor.resx
   trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditor.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditorDialog.cs
Log:
#1656: Fix the implementation of Bind() for all top-level editors. This allows seamless transition and consistent behaviour when using the Edit As XML command.


Modified: trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.Designer.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.Designer.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -28,31 +28,17 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DrawingSourceEditor));
-            this.dsEditorCtrl = new Maestro.Editors.DrawingSource.DrawingSourceEditorCtrl();
-            this.panelBody.SuspendLayout();
             this.SuspendLayout();
             // 
-            // panelBody
-            // 
-            this.panelBody.Controls.Add(this.dsEditorCtrl);
-            // 
-            // dsEditorCtrl
-            // 
-            resources.ApplyResources(this.dsEditorCtrl, "dsEditorCtrl");
-            this.dsEditorCtrl.Name = "dsEditorCtrl";
-            // 
             // DrawingSourceEditor
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
             this.Name = "DrawingSourceEditor";
-            this.panelBody.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
 
         #endregion
 
-        private Maestro.Editors.DrawingSource.DrawingSourceEditorCtrl dsEditorCtrl;
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -40,12 +40,23 @@
         private IResource _res;
         private IEditorService _edsvc;
 
+        private bool _init = false;
+
         protected override void Bind(IEditorService service)
         {
-            _edsvc = service;
-            _res = _edsvc.GetEditedResource();
-            _edsvc.BeforeSave += new CancelEventHandler(OnBeforeSave);
-            dsEditorCtrl.Bind(service);
+            if (!_init)
+            {
+                _edsvc = service;
+                _res = _edsvc.GetEditedResource();
+                //_edsvc.BeforeSave += new CancelEventHandler(OnBeforeSave);
+                _init = true;
+            }
+            
+            var dsEditor = new DrawingSourceEditor();
+            dsEditor.Dock = DockStyle.Fill;
+            dsEditor.Controls.Add(dsEditor);
+
+            dsEditor.Bind(_edsvc);
         }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.resx	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.resx	2011-04-11 09:58:59 UTC (rev 5691)
@@ -117,33 +117,6 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="dsEditorCtrl.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
-    <value>Fill</value>
-  </data>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-  <data name="dsEditorCtrl.Location" type="System.Drawing.Point, System.Drawing">
-    <value>0, 0</value>
-  </data>
-  <data name="dsEditorCtrl.Size" type="System.Drawing.Size, System.Drawing">
-    <value>614, 520</value>
-  </data>
-  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="dsEditorCtrl.TabIndex" type="System.Int32, mscorlib">
-    <value>0</value>
-  </data>
-  <data name="&gt;&gt;dsEditorCtrl.Name" xml:space="preserve">
-    <value>dsEditorCtrl</value>
-  </data>
-  <data name="&gt;&gt;dsEditorCtrl.Type" xml:space="preserve">
-    <value>Maestro.Editors.DrawingSource.DrawingSourceEditorCtrl, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
-  </data>
-  <data name="&gt;&gt;dsEditorCtrl.Parent" xml:space="preserve">
-    <value>panelBody</value>
-  </data>
-  <data name="&gt;&gt;dsEditorCtrl.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
   <data name="&gt;&gt;panelBody.Name" xml:space="preserve">
     <value>panelBody</value>
   </data>
@@ -163,6 +136,6 @@
     <value>DrawingSourceEditor</value>
   </data>
   <data name="&gt;&gt;$this.Type" xml:space="preserve">
-    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=3.0.0.5676, Culture=neutral, PublicKeyToken=null</value>
   </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -76,6 +76,8 @@
                 this.CanUpgrade = _svc.IsUpgradeAvailable;
 
                 Bind(_svc);
+                //Do dirty state check
+                OnDirtyStateChanged(this, EventArgs.Empty);
             }
         }
 

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.Designer.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.Designer.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -28,31 +28,17 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FeatureSourceEditor));
-            this.fsEditorCtrl = new Maestro.Editors.FeatureSource.FeatureSourceEditorCtrl();
-            this.panelBody.SuspendLayout();
             this.SuspendLayout();
             // 
-            // panelBody
-            // 
-            this.panelBody.Controls.Add(this.fsEditorCtrl);
-            // 
-            // fsEditorCtrl
-            // 
-            resources.ApplyResources(this.fsEditorCtrl, "fsEditorCtrl");
-            this.fsEditorCtrl.Name = "fsEditorCtrl";
-            // 
             // FeatureSourceEditor
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
             this.Name = "FeatureSourceEditor";
-            this.panelBody.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
 
         #endregion
 
-        private Maestro.Editors.FeatureSource.FeatureSourceEditorCtrl fsEditorCtrl;
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -28,6 +28,7 @@
 using Maestro.Editors;
 using ICSharpCode.Core;
 using OSGeo.MapGuide.ObjectModels.MapDefinition;
+using Maestro.Editors.FeatureSource;
 
 namespace Maestro.Base.Editor
 {
@@ -40,16 +41,29 @@
 
         private IResource _res;
         private IEditorService _edsvc;
+        private bool _init = false;
 
         protected override void Bind(IEditorService service)
         {
-            _edsvc = service;
-            _res = _edsvc.GetEditedResource();
+            if (!_init)
+            {
+                _edsvc = service;
+                _res = _edsvc.GetEditedResource();
+                _init = true;
+            }
+
+            panelBody.Controls.Clear();
+
+            var fsEditor = new FeatureSourceEditorCtrl();
+            fsEditor.Dock = DockStyle.Fill;
+            panelBody.Controls.Add(fsEditor);
+
             var fsOpts = new FsEditorOptionPanel();
             fsOpts.Dock = DockStyle.Top;
-            fsOpts.Bind(service);
-            fsEditorCtrl.Controls.Add(fsOpts);
-            fsEditorCtrl.Bind(service);
+            fsOpts.Bind(_edsvc);
+            fsEditor.Controls.Add(fsOpts);
+
+            fsEditor.Bind(_edsvc);
         }
 
         protected override void OnBeforeSave(object sender, CancelEventArgs e)

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.resx	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.resx	2011-04-11 09:58:59 UTC (rev 5691)
@@ -117,36 +117,6 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="fsEditorCtrl.AutoScroll" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
-  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="fsEditorCtrl.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
-    <value>Fill</value>
-  </data>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-  <data name="fsEditorCtrl.Location" type="System.Drawing.Point, System.Drawing">
-    <value>0, 0</value>
-  </data>
-  <data name="fsEditorCtrl.Size" type="System.Drawing.Size, System.Drawing">
-    <value>614, 520</value>
-  </data>
-  <data name="fsEditorCtrl.TabIndex" type="System.Int32, mscorlib">
-    <value>0</value>
-  </data>
-  <data name="&gt;&gt;fsEditorCtrl.Name" xml:space="preserve">
-    <value>fsEditorCtrl</value>
-  </data>
-  <data name="&gt;&gt;fsEditorCtrl.Type" xml:space="preserve">
-    <value>Maestro.Editors.FeatureSource.FeatureSourceEditorCtrl, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
-  </data>
-  <data name="&gt;&gt;fsEditorCtrl.Parent" xml:space="preserve">
-    <value>panelBody</value>
-  </data>
-  <data name="&gt;&gt;fsEditorCtrl.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
   <data name="&gt;&gt;panelBody.Name" xml:space="preserve">
     <value>panelBody</value>
   </data>
@@ -166,6 +136,6 @@
     <value>FeatureSourceEditor</value>
   </data>
   <data name="&gt;&gt;$this.Type" xml:space="preserve">
-    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=3.0.0.5676, Culture=neutral, PublicKeyToken=null</value>
   </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/FusionEditor.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/FusionEditor.Designer.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/FusionEditor.Designer.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -28,32 +28,17 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FusionEditor));
-            this.flexEditor = new Maestro.Editors.Fusion.FlexibleLayoutEditor();
-            this.panelBody.SuspendLayout();
             this.SuspendLayout();
             // 
-            // panelBody
-            // 
-            this.panelBody.Controls.Add(this.flexEditor);
-            // 
-            // flexEditor
-            // 
-            resources.ApplyResources(this.flexEditor, "flexEditor");
-            this.flexEditor.Name = "flexEditor";
-            // 
             // FusionEditor
             // 
-            resources.ApplyResources(this, "$this");
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
             this.Name = "FusionEditor";
-            this.panelBody.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
 
         #endregion
 
-        private Maestro.Editors.Fusion.FlexibleLayoutEditor flexEditor;
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/FusionEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/FusionEditor.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/FusionEditor.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -39,13 +39,24 @@
 
         private IResource _res;
         private IEditorService _edsvc;
+        private bool _init = false;
 
         protected override void Bind(IEditorService service)
         {
-            _edsvc = service;
-            _res = _edsvc.GetEditedResource();
+            if (!_init)
+            {
+                _edsvc = service;
+                _res = _edsvc.GetEditedResource();
+                _init = true;
+            }
 
-            flexEditor.Bind(service);
+            panelBody.Controls.Clear();
+
+            var flexEditor = new FlexibleLayoutEditor();
+            flexEditor.Dock = DockStyle.Fill;
+            panelBody.Controls.Add(flexEditor);
+
+            flexEditor.Bind(_edsvc);
         }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/FusionEditor.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/FusionEditor.resx	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/FusionEditor.resx	2011-04-11 09:58:59 UTC (rev 5691)
@@ -117,36 +117,6 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="flexEditor.AutoScroll" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
-  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="flexEditor.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
-    <value>Fill</value>
-  </data>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-  <data name="flexEditor.Location" type="System.Drawing.Point, System.Drawing">
-    <value>0, 0</value>
-  </data>
-  <data name="flexEditor.Size" type="System.Drawing.Size, System.Drawing">
-    <value>614, 520</value>
-  </data>
-  <data name="flexEditor.TabIndex" type="System.Int32, mscorlib">
-    <value>0</value>
-  </data>
-  <data name="&gt;&gt;flexEditor.Name" xml:space="preserve">
-    <value>flexEditor</value>
-  </data>
-  <data name="&gt;&gt;flexEditor.Type" xml:space="preserve">
-    <value>Maestro.Editors.Fusion.FlexibleLayoutEditor, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
-  </data>
-  <data name="&gt;&gt;flexEditor.Parent" xml:space="preserve">
-    <value>panelBody</value>
-  </data>
-  <data name="&gt;&gt;flexEditor.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
   <data name="&gt;&gt;panelBody.Name" xml:space="preserve">
     <value>panelBody</value>
   </data>
@@ -162,13 +132,10 @@
   <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
-    <value>6, 13</value>
-  </data>
   <data name="&gt;&gt;$this.Name" xml:space="preserve">
     <value>FusionEditor</value>
   </data>
   <data name="&gt;&gt;$this.Type" xml:space="preserve">
-    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=3.0.0.5676, Culture=neutral, PublicKeyToken=null</value>
   </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/LayerDefinitionEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/LayerDefinitionEditor.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/LayerDefinitionEditor.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -45,15 +45,20 @@
 
         private ILayerDefinition _res;
         private IEditorService _edsvc;
+        private bool _init = false;
 
         protected override void Bind(Maestro.Editors.IEditorService service)
         {
+            if (!_init)
+            {
+                _edsvc = service;
+                _res = service.GetEditedResource() as ILayerDefinition;
+                Debug.Assert(_res != null);
+                _init = true;
+            }
+
             panelBody.Controls.Clear();
 
-            _edsvc = service;
-            _res = service.GetEditedResource() as ILayerDefinition;
-            Debug.Assert(_res != null);
-
             var vl = _res.SubLayer as IVectorLayerDefinition;
             var gl = _res.SubLayer as IRasterLayerDefinition;
             var dl = _res.SubLayer as IDrawingLayerDefinition;

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.Designer.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.Designer.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -28,31 +28,17 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoadProcedureEditor));
-            this.lpEditor = new Maestro.Editors.LoadProcedure.LoadProcedureEditorCtrl();
-            this.panelBody.SuspendLayout();
             this.SuspendLayout();
             // 
-            // panelBody
-            // 
-            this.panelBody.Controls.Add(this.lpEditor);
-            // 
-            // lpEditor
-            // 
-            resources.ApplyResources(this.lpEditor, "lpEditor");
-            this.lpEditor.Name = "lpEditor";
-            // 
             // LoadProcedureEditor
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
             this.Name = "LoadProcedureEditor";
-            this.panelBody.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
 
         #endregion
 
-        private Maestro.Editors.LoadProcedure.LoadProcedureEditorCtrl lpEditor;
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -24,6 +24,7 @@
 using System.Data;
 using System.Text;
 using System.Windows.Forms;
+using Maestro.Editors.LoadProcedure;
 
 namespace Maestro.Base.Editor
 {
@@ -36,6 +37,12 @@
 
         protected override void Bind(Maestro.Editors.IEditorService service)
         {
+            panelBody.Controls.Clear();
+
+            var lpEditor = new LoadProcedureEditorCtrl();
+            lpEditor.Dock = DockStyle.Fill;
+            panelBody.Controls.Add(lpEditor);
+
             lpEditor.Bind(service);
         }
     }

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.resx	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/LoadProcedureEditor.resx	2011-04-11 09:58:59 UTC (rev 5691)
@@ -117,36 +117,6 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="lpEditor.AutoScroll" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
-  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="lpEditor.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
-    <value>Fill</value>
-  </data>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-  <data name="lpEditor.Location" type="System.Drawing.Point, System.Drawing">
-    <value>0, 0</value>
-  </data>
-  <data name="lpEditor.Size" type="System.Drawing.Size, System.Drawing">
-    <value>614, 520</value>
-  </data>
-  <data name="lpEditor.TabIndex" type="System.Int32, mscorlib">
-    <value>0</value>
-  </data>
-  <data name="&gt;&gt;lpEditor.Name" xml:space="preserve">
-    <value>lpEditor</value>
-  </data>
-  <data name="&gt;&gt;lpEditor.Type" xml:space="preserve">
-    <value>Maestro.Editors.LoadProcedure.LoadProcedureEditorCtrl, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
-  </data>
-  <data name="&gt;&gt;lpEditor.Parent" xml:space="preserve">
-    <value>panelBody</value>
-  </data>
-  <data name="&gt;&gt;lpEditor.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
   <data name="&gt;&gt;panelBody.Name" xml:space="preserve">
     <value>panelBody</value>
   </data>
@@ -166,6 +136,6 @@
     <value>LoadProcedureEditor</value>
   </data>
   <data name="&gt;&gt;$this.Type" xml:space="preserve">
-    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=3.0.0.5676, Culture=neutral, PublicKeyToken=null</value>
   </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/MapDefinitionEditor.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/MapDefinitionEditor.Designer.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/MapDefinitionEditor.Designer.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -28,31 +28,17 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MapDefinitionEditor));
-            this.mapEditorCtrl = new Maestro.Editors.MapDefinition.MapDefinitionEditorCtrl();
-            this.panelBody.SuspendLayout();
             this.SuspendLayout();
             // 
-            // panelBody
-            // 
-            this.panelBody.Controls.Add(this.mapEditorCtrl);
-            // 
-            // mapEditorCtrl
-            // 
-            resources.ApplyResources(this.mapEditorCtrl, "mapEditorCtrl");
-            this.mapEditorCtrl.Name = "mapEditorCtrl";
-            // 
             // MapDefinitionEditor
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
             this.Name = "MapDefinitionEditor";
-            this.panelBody.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
 
         #endregion
 
-        private Maestro.Editors.MapDefinition.MapDefinitionEditorCtrl mapEditorCtrl;
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/MapDefinitionEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/MapDefinitionEditor.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/MapDefinitionEditor.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -28,6 +28,7 @@
 using Maestro.Editors;
 using ICSharpCode.Core;
 using OSGeo.MapGuide.ObjectModels.MapDefinition;
+using Maestro.Editors.MapDefinition;
 
 namespace Maestro.Base.Editor
 {
@@ -40,11 +41,22 @@
 
         private IResource _res;
         private IEditorService _edsvc;
+        private bool _init = false;
 
         protected override void Bind(IEditorService service)
         {
-            _edsvc = service;
-            _res = _edsvc.GetEditedResource();
+            if (!_init)
+            {
+                _edsvc = service;
+                _res = _edsvc.GetEditedResource();
+                _init = true;
+            }
+
+            panelBody.Controls.Clear();
+            var mapEditorCtrl = new MapDefinitionEditorCtrl();
+            mapEditorCtrl.Dock = DockStyle.Fill;
+            panelBody.Controls.Add(mapEditorCtrl);
+
             mapEditorCtrl.Bind(service);
         }
 

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/MapDefinitionEditor.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/MapDefinitionEditor.resx	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/MapDefinitionEditor.resx	2011-04-11 09:58:59 UTC (rev 5691)
@@ -117,36 +117,6 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="mapEditorCtrl.AutoScroll" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
-  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="mapEditorCtrl.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
-    <value>Fill</value>
-  </data>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-  <data name="mapEditorCtrl.Location" type="System.Drawing.Point, System.Drawing">
-    <value>0, 0</value>
-  </data>
-  <data name="mapEditorCtrl.Size" type="System.Drawing.Size, System.Drawing">
-    <value>614, 520</value>
-  </data>
-  <data name="mapEditorCtrl.TabIndex" type="System.Int32, mscorlib">
-    <value>0</value>
-  </data>
-  <data name="&gt;&gt;mapEditorCtrl.Name" xml:space="preserve">
-    <value>mapEditorCtrl</value>
-  </data>
-  <data name="&gt;&gt;mapEditorCtrl.Type" xml:space="preserve">
-    <value>Maestro.Editors.MapDefinition.MapDefinitionEditorCtrl, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
-  </data>
-  <data name="&gt;&gt;mapEditorCtrl.Parent" xml:space="preserve">
-    <value>panelBody</value>
-  </data>
-  <data name="&gt;&gt;mapEditorCtrl.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
   <data name="&gt;&gt;panelBody.Name" xml:space="preserve">
     <value>panelBody</value>
   </data>
@@ -166,6 +136,6 @@
     <value>MapDefinitionEditor</value>
   </data>
   <data name="&gt;&gt;$this.Type" xml:space="preserve">
-    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=3.0.0.5676, Culture=neutral, PublicKeyToken=null</value>
   </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/PrintLayoutEditor.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/PrintLayoutEditor.Designer.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/PrintLayoutEditor.Designer.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -28,31 +28,17 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PrintLayoutEditor));
-            this.printLayoutEditorCtrl = new Maestro.Editors.PrintLayout.PrintLayoutEditorCtrl();
-            this.panelBody.SuspendLayout();
             this.SuspendLayout();
             // 
-            // panelBody
-            // 
-            this.panelBody.Controls.Add(this.printLayoutEditorCtrl);
-            // 
-            // printLayoutEditorCtrl
-            // 
-            resources.ApplyResources(this.printLayoutEditorCtrl, "printLayoutEditorCtrl");
-            this.printLayoutEditorCtrl.Name = "printLayoutEditorCtrl";
-            // 
             // PrintLayoutEditor
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
             this.Name = "PrintLayoutEditor";
-            this.panelBody.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
 
         #endregion
 
-        private Maestro.Editors.PrintLayout.PrintLayoutEditorCtrl printLayoutEditorCtrl;
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/PrintLayoutEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/PrintLayoutEditor.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/PrintLayoutEditor.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -24,6 +24,7 @@
 using System.Data;
 using System.Text;
 using System.Windows.Forms;
+using Maestro.Editors.PrintLayout;
 
 namespace Maestro.Base.Editor
 {
@@ -36,6 +37,12 @@
 
         protected override void Bind(Maestro.Editors.IEditorService service)
         {
+            panelBody.Controls.Clear();
+
+            var printLayoutEditorCtrl = new PrintLayoutEditorCtrl();
+            printLayoutEditorCtrl.Dock = DockStyle.Fill;
+            panelBody.Controls.Add(printLayoutEditorCtrl);
+
             printLayoutEditorCtrl.Bind(service);   
         }
     }

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/PrintLayoutEditor.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/PrintLayoutEditor.resx	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/PrintLayoutEditor.resx	2011-04-11 09:58:59 UTC (rev 5691)
@@ -117,36 +117,6 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="printLayoutEditorCtrl.AutoScroll" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
-  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="printLayoutEditorCtrl.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
-    <value>Fill</value>
-  </data>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-  <data name="printLayoutEditorCtrl.Location" type="System.Drawing.Point, System.Drawing">
-    <value>0, 0</value>
-  </data>
-  <data name="printLayoutEditorCtrl.Size" type="System.Drawing.Size, System.Drawing">
-    <value>614, 520</value>
-  </data>
-  <data name="printLayoutEditorCtrl.TabIndex" type="System.Int32, mscorlib">
-    <value>0</value>
-  </data>
-  <data name="&gt;&gt;printLayoutEditorCtrl.Name" xml:space="preserve">
-    <value>printLayoutEditorCtrl</value>
-  </data>
-  <data name="&gt;&gt;printLayoutEditorCtrl.Type" xml:space="preserve">
-    <value>Maestro.Editors.PrintLayout.PrintLayoutEditorCtrl, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
-  </data>
-  <data name="&gt;&gt;printLayoutEditorCtrl.Parent" xml:space="preserve">
-    <value>panelBody</value>
-  </data>
-  <data name="&gt;&gt;printLayoutEditorCtrl.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
   <data name="&gt;&gt;panelBody.Name" xml:space="preserve">
     <value>panelBody</value>
   </data>
@@ -166,6 +136,6 @@
     <value>PrintLayoutEditor</value>
   </data>
   <data name="&gt;&gt;$this.Type" xml:space="preserve">
-    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=3.0.0.5676, Culture=neutral, PublicKeyToken=null</value>
   </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/WebLayoutEditor.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/WebLayoutEditor.Designer.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/WebLayoutEditor.Designer.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -28,32 +28,18 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WebLayoutEditor));
-            this.webLayoutEditorCtrl = new Maestro.Editors.WebLayout.WebLayoutEditorCtrl();
-            this.panelBody.SuspendLayout();
             this.SuspendLayout();
             // 
-            // panelBody
-            // 
-            this.panelBody.Controls.Add(this.webLayoutEditorCtrl);
-            // 
-            // webLayoutEditorCtrl
-            // 
-            resources.ApplyResources(this.webLayoutEditorCtrl, "webLayoutEditorCtrl");
-            this.webLayoutEditorCtrl.Name = "webLayoutEditorCtrl";
-            // 
             // WebLayoutEditor
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
             this.Name = "WebLayoutEditor";
-            this.panelBody.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
 
         #endregion
 
-        private Maestro.Editors.WebLayout.WebLayoutEditorCtrl webLayoutEditorCtrl;
 
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/WebLayoutEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/WebLayoutEditor.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/WebLayoutEditor.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -24,6 +24,7 @@
 using System.Data;
 using System.Text;
 using System.Windows.Forms;
+using Maestro.Editors.WebLayout;
 
 namespace Maestro.Base.Editor
 {
@@ -34,11 +35,14 @@
             InitializeComponent();
         }
 
-        private Maestro.Editors.IEditorService _edSvc;
-
         protected override void Bind(Maestro.Editors.IEditorService service)
         {
-            _edSvc = service;
+            panelBody.Controls.Clear();
+
+            var webLayoutEditorCtrl = new WebLayoutEditorCtrl();
+            webLayoutEditorCtrl.Dock = DockStyle.Fill;
+            panelBody.Controls.Add(webLayoutEditorCtrl);
+
             webLayoutEditorCtrl.Bind(service);
         }
     }

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/WebLayoutEditor.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/WebLayoutEditor.resx	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/WebLayoutEditor.resx	2011-04-11 09:58:59 UTC (rev 5691)
@@ -117,36 +117,6 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="webLayoutEditorCtrl.AutoScroll" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
-  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="webLayoutEditorCtrl.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
-    <value>Fill</value>
-  </data>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-  <data name="webLayoutEditorCtrl.Location" type="System.Drawing.Point, System.Drawing">
-    <value>0, 0</value>
-  </data>
-  <data name="webLayoutEditorCtrl.Size" type="System.Drawing.Size, System.Drawing">
-    <value>614, 520</value>
-  </data>
-  <data name="webLayoutEditorCtrl.TabIndex" type="System.Int32, mscorlib">
-    <value>0</value>
-  </data>
-  <data name="&gt;&gt;webLayoutEditorCtrl.Name" xml:space="preserve">
-    <value>webLayoutEditorCtrl</value>
-  </data>
-  <data name="&gt;&gt;webLayoutEditorCtrl.Type" xml:space="preserve">
-    <value>Maestro.Editors.WebLayout.WebLayoutEditorCtrl, Maestro.Editors, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
-  </data>
-  <data name="&gt;&gt;webLayoutEditorCtrl.Parent" xml:space="preserve">
-    <value>panelBody</value>
-  </data>
-  <data name="&gt;&gt;webLayoutEditorCtrl.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
   <data name="&gt;&gt;panelBody.Name" xml:space="preserve">
     <value>panelBody</value>
   </data>
@@ -166,6 +136,6 @@
     <value>WebLayoutEditor</value>
   </data>
   <data name="&gt;&gt;$this.Type" xml:space="preserve">
-    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=3.0.0.5334, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Base.Editor.EditorContentBase, Maestro.Base, Version=3.0.0.5676, Culture=neutral, PublicKeyToken=null</value>
   </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditor.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditor.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -91,6 +91,9 @@
 
         protected override void Bind(IEditorService service)
         {
+            //NOTE: This is exempt from #1656 requirements because this will never be called when returing
+            //from an XML editor because IT IS the xml editor!
+
             _edSvc = service;
             _edSvc.RegisterCustomNotifier(editor);
             editor.Bind(_edSvc);

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditorDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditorDialog.cs	2011-04-07 14:47:30 UTC (rev 5690)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditorDialog.cs	2011-04-11 09:58:59 UTC (rev 5691)
@@ -32,7 +32,7 @@
 
 namespace Maestro.Base.Editor
 {
-    public partial class XmlEditorDialog : Form
+    public partial class XmlEditorDialog : Form, INotifyResourceChanged
     {
         private XmlEditorCtrl _ed;
         private IEditorService _edSvc;
@@ -50,8 +50,25 @@
             : this()
         {
             _edSvc = edsvc;
+            _edSvc.RegisterCustomNotifier(this);
+            this.Disposed += new EventHandler(OnDisposed);
         }
 
+        void OnDisposed(object sender, EventArgs e)
+        {
+            //Same as EditorBindableCollapsiblePanel.UnsubscribeEventHandlers()
+            var handler = this.ResourceChanged;
+            if (handler != null)
+            {
+                foreach (var h in handler.GetInvocationList())
+                {
+                    this.ResourceChanged -= (EventHandler)h;
+                }
+                //In case we left out something (shouldn't be)
+                this.ResourceChanged = null;
+            }
+        }
+
         protected override void OnLoad(EventArgs e)
         {
             if (_edSvc != null)
@@ -116,13 +133,15 @@
             _enableResourceTypeValidation = true;
         }
 
+        private string _lastSnapshot;
+
         /// <summary>
         /// Gets or sets the XML content for this dialog.
         /// </summary>
         public string XmlContent
         {
             get { return _ed.XmlContent; }
-            set { _ed.XmlContent = value; }
+            set { _ed.XmlContent = _lastSnapshot = value; }
         }
 
         private void btnCancel_Click(object sender, EventArgs e)
@@ -132,7 +151,18 @@
 
         private void btnSave_Click(object sender, EventArgs e)
         {
+            if (_lastSnapshot != _ed.XmlContent)
+                OnResourceChanged();
             this.DialogResult = DialogResult.OK;
         }
+
+        private void OnResourceChanged()
+        {
+            var handler = this.ResourceChanged;
+            if (handler != null)
+                handler(this, EventArgs.Empty);
+        }
+
+        public event EventHandler ResourceChanged;
     }
 }
\ No newline at end of file



More information about the mapguide-commits mailing list