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

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Sep 5 08:53:16 EDT 2011


Author: jng
Date: 2011-09-05 05:53:16 -0700 (Mon, 05 Sep 2011)
New Revision: 6116

Modified:
   trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs
Log:
Small editor cleanup

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.cs	2011-09-05 11:58:32 UTC (rev 6115)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/DrawingSourceEditor.cs	2011-09-05 12:53:16 UTC (rev 6116)
@@ -38,7 +38,6 @@
             InitializeComponent();
         }
 
-        private IResource _res;
         private IEditorService _edsvc;
 
         private bool _init = false;
@@ -48,11 +47,12 @@
             if (!_init)
             {
                 _edsvc = service;
-                _res = _edsvc.GetEditedResource();
                 //_edsvc.BeforeSave += new CancelEventHandler(OnBeforeSave);
                 _init = true;
             }
-            
+
+            panelBody.Controls.Clear();
+
             var dsEditor = new DrawingSourceEditorCtrl();
             dsEditor.Dock = DockStyle.Fill;
             panelBody.Controls.Add(dsEditor);

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs	2011-09-05 11:58:32 UTC (rev 6115)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs	2011-09-05 12:53:16 UTC (rev 6116)
@@ -74,7 +74,6 @@
                 _svc.Saved += OnSaved;
                 _svc.BeforeSave += OnBeforeSave;
 
-                this.Resource = _svc.GetEditedResource();
                 UpdateTitle();
                 
                 this.CanUpgrade = _svc.IsUpgradeAvailable;
@@ -101,6 +100,8 @@
             }
         }
 
+        public IResource Resource { get { return this.EditorService.GetEditedResource(); } }
+
         /// <summary>
         /// Performs any pre-save validation logic. The base implementation performs
         /// a <see cref="ResourceValidatorSet"/> validation (non-casccading) on the 
@@ -197,8 +198,6 @@
             }
         }
 
-        public IResource Resource { get; private set; }
-
         /// <summary>
         /// Binds the specified resource to this control. This effectively initializes
         /// all the fields in this control and sets up databinding on all fields. All



More information about the mapguide-commits mailing list