[mapguide-commits] r5355 - in sandbox/maestro-3.0: Maestro.Editors/Common Maestro.Editors/WebLayout OSGeo.MapGuide.MaestroAPI/ObjectModels

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Oct 28 08:21:41 EDT 2010


Author: jng
Date: 2010-10-28 05:21:41 -0700 (Thu, 28 Oct 2010)
New Revision: 5355

Modified:
   sandbox/maestro-3.0/Maestro.Editors/Common/ResourcePicker.cs
   sandbox/maestro-3.0/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.cs
   sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/WebLayoutInterfaces.cs
Log:
3.0 sandbox changes:
 - Fix null reference exception in ResourcePicker
 - Add missing INotifyPropertyChanged interfaces for the Web Layout interfaces. Dirty state checking should now be working again in the Web Layout editor

Modified: sandbox/maestro-3.0/Maestro.Editors/Common/ResourcePicker.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Common/ResourcePicker.cs	2010-10-28 12:16:48 UTC (rev 5354)
+++ sandbox/maestro-3.0/Maestro.Editors/Common/ResourcePicker.cs	2010-10-28 12:21:41 UTC (rev 5355)
@@ -283,21 +283,24 @@
         }
 
         private void UpdateDocumentList()
-        {
-            RepositoryFolder folder = _model.SelectedFolder;
-            if (folder != null)
+        {   
+            if (_model != null)
             {
-                txtFolder.Text = folder.ResourceId;
-
-                if (!this.SelectFoldersOnly)
+                RepositoryFolder folder = _model.SelectedFolder;
+                if (folder != null)
                 {
-                    ResourceList list = null;
-                    if (!this.UseFilter)
-                        list = _resSvc.GetRepositoryResources(folder.ResourceId, 1);
-                    else
-                        list = _resSvc.GetRepositoryResources(folder.ResourceId, this.Filter.ToString(), 1);
+                    txtFolder.Text = folder.ResourceId;
 
-                    PopulateDocumentList(list);
+                    if (!this.SelectFoldersOnly)
+                    {
+                        ResourceList list = null;
+                        if (!this.UseFilter)
+                            list = _resSvc.GetRepositoryResources(folder.ResourceId, 1);
+                        else
+                            list = _resSvc.GetRepositoryResources(folder.ResourceId, this.Filter.ToString(), 1);
+
+                        PopulateDocumentList(list);
+                    }
                 }
             }
         }

Modified: sandbox/maestro-3.0/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.cs	2010-10-28 12:16:48 UTC (rev 5354)
+++ sandbox/maestro-3.0/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.cs	2010-10-28 12:21:41 UTC (rev 5355)
@@ -100,6 +100,13 @@
             TextBoxBinder.BindText(numTaskPaneWidth, _wl.TaskPane, "Width");
 
             _wl.PropertyChanged += OnWebLayoutPropertyChanged;
+            _view.PropertyChanged += OnWebLayoutPropertyChanged;
+            _wl.Map.PropertyChanged += OnWebLayoutPropertyChanged;
+            _wl.ContextMenu.PropertyChanged += OnWebLayoutPropertyChanged;
+            _wl.InformationPane.PropertyChanged += OnWebLayoutPropertyChanged;
+            _wl.StatusBar.PropertyChanged += OnWebLayoutPropertyChanged;
+            _wl.TaskPane.PropertyChanged += OnWebLayoutPropertyChanged;
+            _wl.ZoomControl.PropertyChanged += OnWebLayoutPropertyChanged;
         }
 
         void OnWebLayoutPropertyChanged(object sender, PropertyChangedEventArgs e)
@@ -109,9 +116,24 @@
 
         protected override void UnsubscribeEventHandlers()
         {
-            if (_wl != null)
-                _wl.PropertyChanged -= OnWebLayoutPropertyChanged;
+            try
+            {
+                if (_wl != null)
+                {
+                    _wl.PropertyChanged -= OnWebLayoutPropertyChanged;
+                    _wl.Map.PropertyChanged -= OnWebLayoutPropertyChanged;
+                    _wl.ContextMenu.PropertyChanged -= OnWebLayoutPropertyChanged;
+                    _wl.InformationPane.PropertyChanged -= OnWebLayoutPropertyChanged;
+                    _wl.StatusBar.PropertyChanged -= OnWebLayoutPropertyChanged;
+                    _wl.TaskPane.PropertyChanged -= OnWebLayoutPropertyChanged;
+                    _wl.ZoomControl.PropertyChanged -= OnWebLayoutPropertyChanged;
+                }
 
+                if (_view != null)
+                    _view.PropertyChanged -= OnWebLayoutPropertyChanged;
+            }
+            catch { }
+
             base.UnsubscribeEventHandlers();
         }
 

Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/WebLayoutInterfaces.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/WebLayoutInterfaces.cs	2010-10-28 12:16:48 UTC (rev 5354)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/WebLayoutInterfaces.cs	2010-10-28 12:21:41 UTC (rev 5355)
@@ -554,7 +554,7 @@
     /// <summary>
     /// A UI element with localizable features
     /// </summary>
-    public interface ILocalizable
+    public interface ILocalizable : INotifyPropertyChanged
     {
         /// <summary>
         /// Gets or sets the tooltip.
@@ -692,7 +692,7 @@
     /// <summary>
     /// The viewer toolbar
     /// </summary>
-    public interface IToolbar : IMenu, IWebLayoutControl
+    public interface IToolbar : IMenu, IWebLayoutControl, INotifyPropertyChanged
     { 
         
     }
@@ -700,7 +700,7 @@
     /// <summary>
     /// The legend and property pane
     /// </summary>
-    public interface IInformationPane : IWebLayoutResizableControl
+    public interface IInformationPane : IWebLayoutResizableControl, INotifyPropertyChanged
     {
         /// <summary>
         /// Gets or sets a value indicating whether [legend visible].
@@ -718,14 +718,14 @@
     /// <summary>
     /// The viewer context menu
     /// </summary>
-    public interface IContextMenu : IMenu, IWebLayoutControl
+    public interface IContextMenu : IMenu, IWebLayoutControl, INotifyPropertyChanged
     {
     }
 
     /// <summary>
     /// The task pane
     /// </summary>
-    public interface ITaskPane : IWebLayoutResizableControl
+    public interface ITaskPane : IWebLayoutResizableControl, INotifyPropertyChanged
     {
         /// <summary>
         /// Gets or sets the url of the initial task.
@@ -743,7 +743,7 @@
     /// <summary>
     /// The task bar
     /// </summary>
-    public interface ITaskBar : IWebLayoutControl, IMenu
+    public interface ITaskBar : IWebLayoutControl, IMenu, INotifyPropertyChanged
     {
         /// <summary>
         /// Gets the home button.
@@ -781,14 +781,14 @@
     /// <summary>
     /// The status bar
     /// </summary>
-    public interface IStatusBar : IWebLayoutControl
+    public interface IStatusBar : IWebLayoutControl, INotifyPropertyChanged
     {
     }
 
     /// <summary>
     /// The zoom slider
     /// </summary>
-    public interface IZoomControl : IWebLayoutControl
+    public interface IZoomControl : IWebLayoutControl, INotifyPropertyChanged
     {
     }
 



More information about the mapguide-commits mailing list