[mapguide-commits] r6124 - trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Sep 7 05:19:29 EDT 2011


Author: jng
Date: 2011-09-07 02:19:29 -0700 (Wed, 07 Sep 2011)
New Revision: 6124

Modified:
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs
Log:
#1799: SizeContext was introduced after v1.0.0 of the Layer Definition schema, and available via the IStroke2 interface. Thus we test if the given stroke is an IStroke2 instance. We enable the combo box and handle change events if this is the case. Otherwise we disable and ignore change events.

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs	2011-09-07 07:21:22 UTC (rev 6123)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs	2011-09-07 09:19:29 UTC (rev 6124)
@@ -327,7 +327,16 @@
 				if (m_item.Stroke != null)
 				{
 					sizeUnitsCombo.SelectedValue = m_item.Stroke.Unit.ToString();
-                    //sizeContextCombo.SelectedValue = m_item.Stroke.SizeContext.ToString();
+                    var s2 = m_item.Stroke as IStroke2;
+                    if (s2 != null)
+                    {
+                        sizeContextCombo.Enabled = true;
+                        sizeContextCombo.SelectedValue = s2.SizeContext.ToString();
+                    }
+                    else
+                    {
+                        sizeContextCombo.Enabled = false;
+                    }
                     if (!string.IsNullOrEmpty(m_item.Stroke.Color))
                         lineStyleEditor.colorCombo.CurrentColor = Utility.ParseHTMLColor(m_item.Stroke.Color);
 					lineStyleEditor.fillCombo.SelectedIndex = lineStyleEditor.fillCombo.FindString(m_item.Stroke.LineStyle);
@@ -514,10 +523,12 @@
 
         private void sizeContextCombo_SelectedIndexChanged(object sender, EventArgs e)
         {
-            if (m_inUpdate || m_item.Stroke == null)
+            var s2 = m_item.Stroke as IStroke2;
+            if (m_inUpdate || s2 == null)
                 return;
 
-            //m_item.Stroke.SizeContext = (SizeContextType)Enum.Parse(typeof(SizeContextType), (string)sizeContextCombo.SelectedValue);
+            if (s2 != null)
+                s2.SizeContext = (SizeContextType)Enum.Parse(typeof(SizeContextType), (string)sizeContextCombo.SelectedValue);
         }
 
         private void sizeUnitsCombo_SelectedIndexChanged(object sender, EventArgs e)



More information about the mapguide-commits mailing list