[mapguide-commits] r6271 - in trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI: Properties Resource/Validation

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Dec 1 09:43:47 EST 2011


Author: jng
Date: 2011-12-01 06:43:47 -0800 (Thu, 01 Dec 2011)
New Revision: 6271

Modified:
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLayerDefinitionValidator.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ValidationStatusCode.cs
Log:
Add a new Layer Definition validation rule to check if a composite style is defined alongside a area/point/line style. If such a case is found, the composite style will always take precedence over the area/point/line style, thus that style will always be ignored.

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs	2011-12-01 14:16:38 UTC (rev 6270)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs	2011-12-01 14:43:47 UTC (rev 6271)
@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:2.0.50727.4963
+//     Runtime Version:2.0.50727.5448
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.
@@ -548,6 +548,24 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Infinity.
+        /// </summary>
+        internal static string Infinity {
+            get {
+                return ResourceManager.GetString("Infinity", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to The scale range {0} to {1} contains a composite style defined alongside a area/point/line style. The composite style takes precedence in such cases meaning the area/point/line style is always ignored.
+        /// </summary>
+        internal static string LDF_CompositeStyleDefinedAlongsideBasicStyle {
+            get {
+                return ResourceManager.GetString("LDF_CompositeStyleDefinedAlongsideBasicStyle", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to Failed to load specified Drawing Source.
         /// </summary>
         internal static string LDF_DrawingSourceError {

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx	2011-12-01 14:16:38 UTC (rev 6270)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx	2011-12-01 14:43:47 UTC (rev 6271)
@@ -539,4 +539,10 @@
   <data name="DuplicateKeyExceptionMessage" xml:space="preserve">
     <value>An item with the key value ({0}) already exists in the collection</value>
   </data>
+  <data name="LDF_CompositeStyleDefinedAlongsideBasicStyle" xml:space="preserve">
+    <value>The scale range {0} to {1} contains a composite style defined alongside a area/point/line style. The composite style takes precedence in such cases meaning the area/point/line style is always ignored</value>
+  </data>
+  <data name="Infinity" xml:space="preserve">
+    <value>Infinity</value>
+  </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLayerDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLayerDefinitionValidator.cs	2011-12-01 14:16:38 UTC (rev 6270)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLayerDefinitionValidator.cs	2011-12-01 14:43:47 UTC (rev 6271)
@@ -91,6 +91,23 @@
                     List<KeyValuePair<double, double>> ranges = new List<KeyValuePair<double, double>>();
                     foreach (IVectorScaleRange vsr in vldef.VectorScaleRange)
                     {
+                        IVectorScaleRange2 vsr2 = vsr as IVectorScaleRange2;
+                        if (vsr2 != null)
+                        {
+                            var area = vsr2.AreaStyle;
+                            var line = vsr2.LineStyle;
+                            var point = vsr2.PointStyle;
+                            var comp = vsr2.CompositeStyle;
+
+                            if (comp != null && (area != null || line != null || point != null))
+                            {
+                                issues.Add(new ValidationIssue(resource, ValidationStatus.Warning, ValidationStatusCode.Warning_LayerDefinition_CompositeStyleDefinedAlongsideBasicStyle, string.Format(
+                                    Properties.Resources.LDF_CompositeStyleDefinedAlongsideBasicStyle,
+                                    vsr2.MinScale.HasValue ? vsr2.MinScale.Value : 0,
+                                    vsr2.MaxScale.HasValue ? vsr2.MaxScale.Value.ToString() : Properties.Resources.Infinity))); 
+                            }
+                        }
+
                         ranges.Add(new KeyValuePair<double, double>(
                             vsr.MaxScale.HasValue ? vsr.MaxScale.Value : double.PositiveInfinity,
                             vsr.MinScale.HasValue ? vsr.MinScale.Value : double.NegativeInfinity));

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ValidationStatusCode.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ValidationStatusCode.cs	2011-12-01 14:16:38 UTC (rev 6270)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ValidationStatusCode.cs	2011-12-01 14:43:47 UTC (rev 6271)
@@ -176,6 +176,12 @@
         Warning_LayerDefinition_MultipleGridScaleRanges,
 
         /// <summary>
+        /// A scale range was found in a Layer Definition which has a composite style defined along side a point, line or area style. In such cases, the 
+        /// composite style will always take precedence and the point/line/area style will have no effect
+        /// </summary>
+        Warning_LayerDefinition_CompositeStyleDefinedAlongsideBasicStyle,
+
+        /// <summary>
         /// The web layout's initial view lies outside the referenced map definition's extents. Usually means you will see nothing when the AJAX viewer loads.
         /// </summary>
         Warning_WebLayout_InitialViewOutsideMapExtents = 3601,



More information about the mapguide-commits mailing list