[mapguide-commits] r5264 - in
trunk/Tools/Maestro/Maestro/ResourceValidators: . Strings
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Sun Oct 10 21:30:38 EDT 2010
Author: jng
Date: 2010-10-10 18:30:38 -0700 (Sun, 10 Oct 2010)
New Revision: 5264
Modified:
trunk/Tools/Maestro/Maestro/ResourceValidators/Strings/WebLayoutValidator.Designer.cs
trunk/Tools/Maestro/Maestro/ResourceValidators/Strings/WebLayoutValidator.resx
trunk/Tools/Maestro/Maestro/ResourceValidators/WebLayoutValidator.cs
Log:
Update web layout validator to detect dangling menu commands
Modified: trunk/Tools/Maestro/Maestro/ResourceValidators/Strings/WebLayoutValidator.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceValidators/Strings/WebLayoutValidator.Designer.cs 2010-10-11 00:28:00 UTC (rev 5263)
+++ trunk/Tools/Maestro/Maestro/ResourceValidators/Strings/WebLayoutValidator.Designer.cs 2010-10-11 01:30:38 UTC (rev 5264)
@@ -97,6 +97,33 @@
}
/// <summary>
+ /// Looks up a localized string similar to Context Menu contains a reference to a command that doesn't exist: {0}.
+ /// </summary>
+ internal static string NonExistentMenuCommandReference {
+ get {
+ return ResourceManager.GetString("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 NonExistentTaskPaneCommandReference {
+ get {
+ return ResourceManager.GetString("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 NonExistentToolbarCommandReference {
+ get {
+ return ResourceManager.GetString("NonExistentToolbarCommandReference", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Layout specifies a start view that is outside the map's initial extents.
/// </summary>
internal static string StartViewOutsideExtentsWarning {
Modified: trunk/Tools/Maestro/Maestro/ResourceValidators/Strings/WebLayoutValidator.resx
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceValidators/Strings/WebLayoutValidator.resx 2010-10-11 00:28:00 UTC (rev 5263)
+++ trunk/Tools/Maestro/Maestro/ResourceValidators/Strings/WebLayoutValidator.resx 2010-10-11 01:30:38 UTC (rev 5264)
@@ -131,6 +131,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="NonExistentMenuCommandReference" xml:space="preserve">
+ <value>Context Menu contains a reference to a command that doesn't exist: {0}</value>
+ </data>
+ <data name="NonExistentTaskPaneCommandReference" xml:space="preserve">
+ <value>Task Pane contains a reference to a command that does not exist: {0}</value>
+ </data>
+ <data name="NonExistentToolbarCommandReference" xml:space="preserve">
+ <value>Toolbar contains a reference to a command that does not exist: {0}</value>
+ </data>
<data name="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: trunk/Tools/Maestro/Maestro/ResourceValidators/WebLayoutValidator.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceValidators/WebLayoutValidator.cs 2010-10-11 00:28:00 UTC (rev 5263)
+++ trunk/Tools/Maestro/Maestro/ResourceValidators/WebLayoutValidator.cs 2010-10-11 01:30:38 UTC (rev 5264)
@@ -70,6 +70,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(Strings.WebLayoutValidator.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(Strings.WebLayoutValidator.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(Strings.WebLayoutValidator.NonExistentToolbarCommandReference, cmdRef.Command)));
+ }
+ }
+
if (recurse)
{
try
More information about the mapguide-commits
mailing list