[mapguide-commits] r5265 - in sandbox/maestro-3.0/Maestro.ResourceValidation: . Properties

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sun Oct 10 21:36:58 EDT 2010


Author: jng
Date: 2010-10-10 18:36:57 -0700 (Sun, 10 Oct 2010)
New Revision: 5265

Modified:
   sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.Designer.cs
   sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.resx
   sandbox/maestro-3.0/Maestro.ResourceValidation/WebLayoutValidator.cs
Log:
Forward-port r5264 to 3.0 sandbox


Modified: sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.Designer.cs	2010-10-11 01:30:38 UTC (rev 5264)
+++ sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.Designer.cs	2010-10-11 01:36:57 UTC (rev 5265)
@@ -421,6 +421,33 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Context Menu contains a reference to a command that doesn&apos;t exist: {0}.
+        /// </summary>
+        internal static string WL_NonExistentMenuCommandReference {
+            get {
+                return ResourceManager.GetString("WL_NonExistentMenuCommandReference", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Task Pane contains a reference to a command that does not exist: {0}.
+        /// </summary>
+        internal static string WL_NonExistentTaskPaneCommandReference {
+            get {
+                return ResourceManager.GetString("WL_NonExistentTaskPaneCommandReference", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Toolbar contains a reference to a command that does not exist: {0}.
+        /// </summary>
+        internal static string WL_NonExistentToolbarCommandReference {
+            get {
+                return ResourceManager.GetString("WL_NonExistentToolbarCommandReference", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to Layout specifies a start view that is outside the map&apos;s initial extents.
         /// </summary>
         internal static string WL_StartViewOutsideExtentsWarning {

Modified: sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.resx	2010-10-11 01:30:38 UTC (rev 5264)
+++ sandbox/maestro-3.0/Maestro.ResourceValidation/Properties/Resources.resx	2010-10-11 01:36:57 UTC (rev 5265)
@@ -275,6 +275,15 @@
     <value>Layout does not specify a map</value>
     <comment>An error message that is displayed if no map is specified in the layout</comment>
   </data>
+  <data name="WL_NonExistentMenuCommandReference" xml:space="preserve">
+    <value>Context Menu contains a reference to a command that doesn't exist: {0}</value>
+  </data>
+  <data name="WL_NonExistentTaskPaneCommandReference" xml:space="preserve">
+    <value>Task Pane contains a reference to a command that does not exist: {0}</value>
+  </data>
+  <data name="WL_NonExistentToolbarCommandReference" xml:space="preserve">
+    <value>Toolbar contains a reference to a command that does not exist: {0}</value>
+  </data>
   <data name="WL_StartViewOutsideExtentsWarning" xml:space="preserve">
     <value>Layout specifies a start view that is outside the map's initial extents</value>
     <comment>A warning message that is displayed if the layout specifies a start center point that is outside the map's specified extents</comment>

Modified: sandbox/maestro-3.0/Maestro.ResourceValidation/WebLayoutValidator.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.ResourceValidation/WebLayoutValidator.cs	2010-10-11 01:30:38 UTC (rev 5264)
+++ sandbox/maestro-3.0/Maestro.ResourceValidation/WebLayoutValidator.cs	2010-10-11 01:36:57 UTC (rev 5265)
@@ -72,6 +72,37 @@
                     }
                 }
 
+                //Check for command references to non-existent commands
+                foreach (UIItemType item in layout.ContextMenu.MenuItem)
+                {
+                    if (item.Function == UIItemFunctionType.Command)
+                    {
+                        CommandItemType cmdRef = (CommandItemType)item;
+                        if (!cmds.ContainsKey(cmdRef.Command))
+                            issues.Add(new ValidationIssue(layout, ValidationStatus.Error, string.Format(Properties.Resources.WL_NonExistentMenuCommandReference, cmdRef.Command)));
+                    }
+                }
+
+                foreach (UIItemType item in layout.TaskPane.TaskBar.MenuButton)
+                {
+                    if (item.Function == UIItemFunctionType.Command)
+                    {
+                        CommandItemType cmdRef = (CommandItemType)item;
+                        if (!cmds.ContainsKey(cmdRef.Command))
+                            issues.Add(new ValidationIssue(layout, ValidationStatus.Error, string.Format(Properties.Resources.WL_NonExistentTaskPaneCommandReference, cmdRef.Command)));
+                    }
+                }
+
+                foreach (UIItemType item in layout.ToolBar.Button)
+                {
+                    if (item.Function == UIItemFunctionType.Command)
+                    {
+                        CommandItemType cmdRef = (CommandItemType)item;
+                        if (!cmds.ContainsKey(cmdRef.Command))
+                            issues.Add(new ValidationIssue(layout, ValidationStatus.Error, string.Format(Properties.Resources.WL_NonExistentToolbarCommandReference, cmdRef.Command)));
+                    }
+                }
+
                 if (recurse)
                 {
                     try



More information about the mapguide-commits mailing list