[mapguide-commits] r4878 - in sandbox/maestro-2.5: Maestro.Base/Editor Maestro.Base/UI OSGeo.MapGuide.MaestroAPI.Http

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri May 14 03:48:50 EDT 2010


Author: jng
Date: 2010-05-14 03:48:49 -0400 (Fri, 14 May 2010)
New Revision: 4878

Modified:
   sandbox/maestro-2.5/Maestro.Base/Editor/EditorContentBase.cs
   sandbox/maestro-2.5/Maestro.Base/Editor/IEditorViewContent.cs
   sandbox/maestro-2.5/Maestro.Base/UI/EmbeddedWebBrowser.Designer.cs
   sandbox/maestro-2.5/Maestro.Base/UI/EmbeddedWebBrowser.cs
   sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs
Log:
 - Update the http capabilities to return the correct max supported resource version based on the site version.
 - Add an IsDirty property to the IEditorViewContent 
 - Update the url in the EmbeddedWebBrowser when going back/forward

Modified: sandbox/maestro-2.5/Maestro.Base/Editor/EditorContentBase.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Editor/EditorContentBase.cs	2010-05-14 07:14:02 UTC (rev 4877)
+++ sandbox/maestro-2.5/Maestro.Base/Editor/EditorContentBase.cs	2010-05-14 07:48:49 UTC (rev 4878)
@@ -62,5 +62,11 @@
         {
             get { return false; }
         }
+
+        public bool IsDirty
+        {
+            get;
+            private set;
+        }
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Base/Editor/IEditorViewContent.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/Editor/IEditorViewContent.cs	2010-05-14 07:14:02 UTC (rev 4877)
+++ sandbox/maestro-2.5/Maestro.Base/Editor/IEditorViewContent.cs	2010-05-14 07:48:49 UTC (rev 4878)
@@ -46,5 +46,10 @@
         /// Indicates whether the resource being edited can be previewed
         /// </summary>
         bool CanBePreviewed { get; }
+
+        /// <summary>
+        /// Indicates whether the resource being edited has unsaved changes
+        /// </summary>
+        bool IsDirty { get; }
     }
 }

Modified: sandbox/maestro-2.5/Maestro.Base/UI/EmbeddedWebBrowser.Designer.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/UI/EmbeddedWebBrowser.Designer.cs	2010-05-14 07:14:02 UTC (rev 4877)
+++ sandbox/maestro-2.5/Maestro.Base/UI/EmbeddedWebBrowser.Designer.cs	2010-05-14 07:48:49 UTC (rev 4878)
@@ -170,6 +170,7 @@
             this.browser.Size = new System.Drawing.Size(497, 339);
             this.browser.TabIndex = 4;
             this.browser.ProgressChanged += new System.Windows.Forms.WebBrowserProgressChangedEventHandler(this.browser_ProgressChanged);
+            this.browser.Navigating += new System.Windows.Forms.WebBrowserNavigatingEventHandler(this.browser_Navigating);
             this.browser.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.browser_DocumentCompleted);
             // 
             // EmbeddedWebBrowser

Modified: sandbox/maestro-2.5/Maestro.Base/UI/EmbeddedWebBrowser.cs
===================================================================
--- sandbox/maestro-2.5/Maestro.Base/UI/EmbeddedWebBrowser.cs	2010-05-14 07:14:02 UTC (rev 4877)
+++ sandbox/maestro-2.5/Maestro.Base/UI/EmbeddedWebBrowser.cs	2010-05-14 07:48:49 UTC (rev 4878)
@@ -190,6 +190,7 @@
 
         private void browser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
         {
+            this.Url = e.Url.ToString();
             var handler = this.BrowserLoading;
             if (handler != null)
                 handler(this, EventArgs.Empty);

Modified: sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs
===================================================================
--- sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs	2010-05-14 07:14:02 UTC (rev 4877)
+++ sandbox/maestro-2.5/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs	2010-05-14 07:48:49 UTC (rev 4878)
@@ -41,6 +41,9 @@
                 case "LayerDefinition":
                     ver = GetMaxLayerDefinitionVersion();
                     break;
+                case "LoadProcedure":
+                    ver = GetMaxLoadProcedureVersion();
+                    break;
                 case "WebLayout":
                     ver = GetMaxWebLayoutVersion();
                     break;
@@ -51,9 +54,22 @@
             return ver;
         }
 
+        private Version GetMaxLoadProcedureVersion()
+        {
+            if (_parent.SiteVersion >= new Version(2, 2))
+                return new Version(2, 2, 0);
+
+            if (_parent.SiteVersion >= new Version(2, 0))
+                return new Version(1, 1, 0);
+
+            return new Version(1, 0, 0);
+        }
+
         private Version GetMaxSymbolDefinitionVersion()
         {
-            //TODO: There are more versions. Just gotta work out which ones
+            if (_parent.SiteVersion >= new Version(2, 2))
+                return new Version(1, 1, 0);
+           
             return new Version(1, 0, 0);
         }
 
@@ -66,7 +82,12 @@
 
         private Version GetMaxLayerDefinitionVersion()
         {
-            //TODO: There are more versions. Just gotta work out which ones
+            if (_parent.SiteVersion >= new Version(2, 1))
+                return new Version(1, 3, 0);
+            if (_parent.SiteVersion >= new Version(2, 0))
+                return new Version(1, 2, 0);
+            if (_parent.SiteVersion >= new Version(1, 2))
+                return new Version(1, 1, 0);
             return new Version(1, 0, 0);
         }
 
@@ -83,14 +104,27 @@
         {
             get 
             {
-                return new int[] {
-                    (int)ServiceType.Resource,
-                    (int)ServiceType.Feature,
-                    (int)ServiceType.Fusion,
-                    (int)ServiceType.Mapping,
-                    (int)ServiceType.Tile
-                    //(int)ServiceType.Drawing
-                };
+                if (_parent.SiteVersion >= new Version(2, 0))
+                {
+                    return new int[] {
+                        (int)ServiceType.Resource,
+                        (int)ServiceType.Feature,
+                        (int)ServiceType.Fusion,
+                        (int)ServiceType.Mapping,
+                        (int)ServiceType.Tile
+                        //(int)ServiceType.Drawing
+                    };
+                }
+                else //Fusion doesn't exist pre-2.0
+                {
+                    return new int[] {
+                        (int)ServiceType.Resource,
+                        (int)ServiceType.Feature,
+                        (int)ServiceType.Mapping,
+                        (int)ServiceType.Tile
+                        //(int)ServiceType.Drawing
+                    };
+                }
             }
         }
 



More information about the mapguide-commits mailing list