[mapguide-commits] r6978 - in trunk/Tools/Maestro: Maestro.Editors Maestro.Editors/LayerDefinition/Vector Maestro.Editors/LayerDefinition/Vector/Scales Maestro.Editors/LayerDefinition/Vector/StyleEditors OSGeo.MapGuide.MaestroAPI/ObjectModels

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Sep 3 09:35:16 PDT 2012


Author: jng
Date: 2012-09-03 09:35:12 -0700 (Mon, 03 Sep 2012)
New Revision: 6978

Added:
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/ILayerStylePreviewable.cs
Modified:
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/Condition.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionList.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionListButtons.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ItemStyle.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.resx
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.resx
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.resx
   trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerFactory.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs
Log:
#1875: 2nd attempt to do this right. GETLEGENDIMAGE previews are enabled for Line/Area/Point(non-label) style dialogs. These previews are way more accurate than what we currently have, which is to simulate what the style would be like using System.Drawing APIs. We do still use the imperfect System.Drawing method for the top-level view because using GETLEGENDIMAGE here is woefully inefficient, especially if there are lots of style rules involved.

Added: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/ILayerStylePreviewable.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/ILayerStylePreviewable.cs	                        (rev 0)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/ILayerStylePreviewable.cs	2012-09-03 16:35:12 UTC (rev 6978)
@@ -0,0 +1,91 @@
+#region Disclaimer / License
+// Copyright (C) 2012, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+// 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+// 
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Maestro.Editors.LayerDefinition.Vector
+{
+    internal interface ILayerStylePreviewable
+    {
+        string LayerDefinition { get; }
+
+        double Scale { get; }
+
+        int Width { get; }
+
+        int Height { get; }
+
+        string ImageFormat { get; }
+
+        int ThemeCategory { get; }
+    }
+
+    internal class LayerStylePreviewable : ILayerStylePreviewable
+    {
+        public LayerStylePreviewable(string layerDefinition, double scale, int width, int height, string imgFormat, int themeCat)
+        {
+            this.LayerDefinition = layerDefinition;
+            this.Scale = scale;
+            this.Width = width;
+            this.Height = height;
+            this.ImageFormat = imgFormat;
+            this.ThemeCategory = themeCat;
+        }
+
+        public string LayerDefinition
+        {
+            get;
+            private set;
+        }
+
+        public double Scale
+        {
+            get;
+            private set;
+        }
+
+        public int Width
+        {
+            get;
+            private set;
+        }
+
+        public int Height
+        {
+            get;
+            private set;
+        }
+
+        public string ImageFormat
+        {
+            get;
+            private set;
+        }
+
+        public int ThemeCategory
+        {
+            get;
+            private set;
+        }
+    }
+}

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/Condition.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/Condition.cs	2012-09-03 13:38:24 UTC (rev 6977)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/Condition.cs	2012-09-03 16:35:12 UTC (rev 6978)
@@ -68,27 +68,27 @@
             _conn = conn;
         }
 
-        public void SetItem(IPointRule prt)
+        public void SetItem(IPointRule prt, double previewScale, int themeCategory)
         {
-            SetItemInternal(prt);
+            SetItemInternal(prt, previewScale, themeCategory);
         }
 
-        public void SetItem(ILineRule lrt)
+        public void SetItem(ILineRule lrt, double previewScale, int themeCategory)
         {
-            SetItemInternal(lrt);
+            SetItemInternal(lrt, previewScale, themeCategory);
         }
 
-        public void SetItem(IAreaRule art)
+        public void SetItem(IAreaRule art, double previewScale, int themeCategory)
         {
-            SetItemInternal(art);
+            SetItemInternal(art, previewScale, themeCategory);
         }
 
-        public void SetItem(ICompositeRule comp)
+        public void SetItem(ICompositeRule comp, double previewScale, int themeCategory)
         {
-            SetItemInternal(comp);
+            SetItemInternal(comp, previewScale, themeCategory);
         }
 
-        private void SetItemInternal(object item)
+        private void SetItemInternal(object item, double previewScale, int themeCategory)
         {
             m_prt = item as IPointRule;
             m_lrt = item as ILineRule;
@@ -112,31 +112,31 @@
                             w2d = SymbolPicker.GetSymbol(_conn, sym.W2DSymbol.ResourceId, sym.W2DSymbol.LibraryItemName);
                         }
                     }
-                    FeatureStyle.SetItem(m_prt, m_prt.PointSymbolization2D, w2d);
-                    LabelStyle.SetItem(m_prt, m_prt.Label);
+                    FeatureStyle.SetItem(m_prt, m_prt.PointSymbolization2D, w2d, previewScale, themeCategory);
+                    LabelStyle.SetItem(m_prt, m_prt.Label, previewScale, themeCategory);
                     LabelStyle.Visible = true;
                 }
                 else if (m_lrt != null)
                 {
                     RuleCondition.Text = m_lrt.Filter;
                     LegendLabel.Text = m_lrt.LegendLabel;
-                    FeatureStyle.SetItem(m_lrt, m_lrt.Strokes);
-                    LabelStyle.SetItem(m_lrt, m_lrt.Label);
+                    FeatureStyle.SetItem(m_lrt, m_lrt.Strokes, previewScale, themeCategory);
+                    LabelStyle.SetItem(m_lrt, m_lrt.Label, previewScale, themeCategory);
                     LabelStyle.Visible = true;
                 }
                 else if (m_art != null)
                 {
                     RuleCondition.Text = m_art.Filter;
                     LegendLabel.Text = m_art.LegendLabel;
-                    FeatureStyle.SetItem(m_art, m_art.AreaSymbolization2D);
-                    LabelStyle.SetItem(m_art, m_art.Label);
+                    FeatureStyle.SetItem(m_art, m_art.AreaSymbolization2D, previewScale, themeCategory);
+                    LabelStyle.SetItem(m_art, m_art.Label, previewScale, themeCategory);
                     LabelStyle.Visible = true;
                 }
                 else if (m_comp != null)
                 {
                     RuleCondition.Text = m_comp.Filter;
                     LegendLabel.Text = m_comp.LegendLabel;
-                    FeatureStyle.SetItem(m_comp, m_comp.CompositeSymbolization);
+                    FeatureStyle.SetItem(m_comp, m_comp.CompositeSymbolization, previewScale, themeCategory);
                     LabelStyle.Visible = false;
                 }
             }

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionList.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionList.cs	2012-09-03 13:38:24 UTC (rev 6977)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionList.cs	2012-09-03 16:35:12 UTC (rev 6978)
@@ -118,23 +118,39 @@
 
                 if (m_point != null)
                 {
+                    int idx = 0;
                     foreach (IPointRule prt in m_point.Rules)
-                        AddRuleControl(prt);
+                    {
+                        AddRuleControl(prt, idx);
+                        idx++;
+                    }
                 }
                 else if (m_line != null)
                 {
+                    int idx = 0;
                     foreach (ILineRule lrt in m_line.Rules)
-                        AddRuleControl(lrt);
+                    {
+                        AddRuleControl(lrt, idx);
+                        idx++;
+                    }
                 }
                 else if (m_area != null)
                 {
+                    int idx = 0;
                     foreach (IAreaRule art in m_area.Rules)
-                        AddRuleControl(art);
+                    {
+                        AddRuleControl(art, idx);
+                        idx++;
+                    }
                 }
                 else if (m_comp != null)
                 {
+                    int idx = 0;
                     foreach (ICompositeRule comp in m_comp.CompositeRule)
-                        AddRuleControl(comp);
+                    {
+                        AddRuleControl(comp, idx);
+                        idx++;
+                    }
                 }
             }
             finally
@@ -144,22 +160,54 @@
             }
         }
 
-        public Condition AddRuleControl(object rule)
+        private double GetApplicablePreviewScale()
         {
+            double scale = default(double);
+            if (m_parent != null)
+            {
+                if (m_parent.MinScale.HasValue)
+                {
+                    if (m_parent.MaxScale.HasValue)
+                    {
+                        scale = (m_parent.MinScale.Value + m_parent.MaxScale.Value) / 2.0;
+                    }
+                    else //min = true, max = false
+                    {
+                        scale = m_parent.MinScale.Value + 1.0;
+                    }
+                }
+                else
+                {
+                    if (m_parent.MaxScale.HasValue) //min = false
+                    {
+                        scale = Math.Floor(m_parent.MaxScale.Value - 0.0001);
+                    }
+                    else //both false 
+                    {
+                        scale = 42; //Any number will do
+                    }
+                }
+            }
+            return scale;
+        }
+
+        public Condition AddRuleControl(object rule, int themeCategory)
+        {
             if (rule == null)
                 return null;
 
+            double scale = GetApplicablePreviewScale();
             //Not pretty, but we need a server connection to fetch DWF symbol thumbnails for previewing
             Condition c = new Condition(m_owner.EditorService.GetEditedResource().CurrentConnection);
 
             if (rule as IPointRule != null)
-                c.SetItem(rule as IPointRule);
+                c.SetItem(rule as IPointRule, scale, themeCategory);
             else if (rule as ILineRule != null)
-                c.SetItem(rule as ILineRule);
+                c.SetItem(rule as ILineRule, scale, themeCategory);
             else if (rule as IAreaRule != null)
-                c.SetItem(rule as IAreaRule);
+                c.SetItem(rule as IAreaRule, scale, themeCategory);
             else if (rule as ICompositeRule != null)
-                c.SetItem(rule as ICompositeRule);
+                c.SetItem(rule as ICompositeRule, scale, themeCategory);
 
             c.Owner = m_owner;
             c.Dock = DockStyle.Top;

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionListButtons.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionListButtons.cs	2012-09-03 13:38:24 UTC (rev 6977)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionListButtons.cs	2012-09-03 16:35:12 UTC (rev 6978)
@@ -133,25 +133,29 @@
             if (m_point != null)
             {
                 IPointRule prt = _factory.CreateDefaultPointRule();
-                conditionList.AddRuleControl(prt).Focus();
+                int idx = m_point.RuleCount;
+                conditionList.AddRuleControl(prt, idx).Focus();
                 m_point.AddRule(prt);
             }
             else if (m_line != null)
             {
                 ILineRule lrt = _factory.CreateDefaultLineRule();
-                conditionList.AddRuleControl(lrt).Focus();
+                int idx = m_line.RuleCount;
+                conditionList.AddRuleControl(lrt, idx).Focus();
                 m_line.AddRule(lrt);
             }
             else if (m_area != null)
             {
                 IAreaRule art = _factory.CreateDefaultAreaRule();
-                conditionList.AddRuleControl(art).Focus();
+                int idx = m_area.RuleCount;
+                conditionList.AddRuleControl(art, idx).Focus();
                 m_area.AddRule(art);
             }
             else if (m_comp != null)
             {
                 ICompositeRule cr = _factory.CreateDefaultCompositeRule();
-                conditionList.AddRuleControl(cr).Focus();
+                int idx = m_area.RuleCount;
+                conditionList.AddRuleControl(cr, idx).Focus();
                 m_comp.AddCompositeRule(cr);
             }
 
@@ -215,23 +219,26 @@
 
             object rule = Utility.XmlDeepCopy(conditionList.SelectedItem);
 
-
+            int idx = -1;
             if (m_point != null)
             {
+                idx = m_point.RuleCount;
                 m_point.AddRule((IPointRule)rule);
             }
             else if (m_line != null)
             {
+                idx = m_line.RuleCount;
                 m_line.AddRule((ILineRule)rule);
             }
             else if (m_area != null)
             {
+                idx = m_area.RuleCount;
                 m_area.AddRule((IAreaRule)rule);
             }
             else
                 return;
 
-            conditionList.AddRuleControl(rule).Focus();
+            conditionList.AddRuleControl(rule, idx).Focus();
 
             if (ItemChanged != null)
                 ItemChanged(this, null);

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ItemStyle.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ItemStyle.cs	2012-09-03 13:38:24 UTC (rev 6977)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ItemStyle.cs	2012-09-03 16:35:12 UTC (rev 6978)
@@ -64,20 +64,13 @@
             InitializeComponent();
         }
 
-        private ILayerElementFactory _factory;
-
-        public ItemStyle(ILayerElementFactory factory)
+        public void SetItem(object parent, ITextSymbol label, double previewScale, int themeCategory)
         {
-            _factory = factory;
-        }
-
-        public void SetItem(object parent, ITextSymbol label)
-        {
             isLabel = true;
-            SetItemInternal(parent, label);
+            SetItemInternal(parent, label, previewScale, themeCategory);
         }
 
-        public void SetItem(IPointRule parent, IPointSymbolization2D point, Image img)
+        public void SetItem(IPointRule parent, IPointSymbolization2D point, Image img, double previewScale, int themeCategory)
         {
             if (point == null)
             {
@@ -89,29 +82,29 @@
                 isPoint = (point.Symbol.Type != PointSymbolType.W2D);
                 isW2dSymbol = (point.Symbol.Type == PointSymbolType.W2D);
             }
-            SetItemInternal(parent, point);
+            SetItemInternal(parent, point, previewScale, themeCategory);
             m_w2dsymbol = img;
         }
 
-        public void SetItem(ILineRule parent, IEnumerable<IStroke> line)
+        public void SetItem(ILineRule parent, IEnumerable<IStroke> line, double previewScale, int themeCategory)
         {
             isLine = true;
-            SetItemInternal(parent, line);
+            SetItemInternal(parent, line, previewScale, themeCategory);
         }
 
-        public void SetItem(IAreaRule parent, IAreaSymbolizationFill area)
+        public void SetItem(IAreaRule parent, IAreaSymbolizationFill area, double previewScale, int themeCategory)
         {
             isArea = true;
-            SetItemInternal(parent, area);
+            SetItemInternal(parent, area, previewScale, themeCategory);
         }
 
-        public void SetItem(ICompositeRule parent, ICompositeSymbolization comp)
+        public void SetItem(ICompositeRule parent, ICompositeSymbolization comp, double previewScale, int themeCategory)
         {
             isComp = true;
-            SetItemInternal(parent, comp);
+            SetItemInternal(parent, comp, previewScale, themeCategory);
         }
 
-        private void SetItemInternal(object parent, object item)
+        private void SetItemInternal(object parent, object item, double previewScale, int themeCategory)
         {
             m_parent = parent;
             m_label = item as ITextSymbol;
@@ -119,6 +112,8 @@
             m_area = item as IAreaSymbolizationFill;
             m_comp = item as ICompositeSymbolization;
             m_w2dsymbol = item as Image;
+            this.PreviewScale = previewScale;
+            this.ThemeCategory = themeCategory;
 
             if (item is IEnumerable<IStroke>)
                 m_line = new List<IStroke>((IEnumerable<IStroke>)item);
@@ -142,7 +137,7 @@
                     FeaturePreviewRender.RenderPreviewFontSymbol(e.Graphics, rect, m_point.Symbol as IFontSymbol);
                 else if (m_point.Symbol.Type == PointSymbolType.W2D)
                     FeaturePreviewRender.RenderW2DImage(e.Graphics, rect, m_point.Symbol as IW2DSymbol, m_w2dsymbol);
-			}
+            }
             else if (m_line != null)
             {
                 FeaturePreviewRender.RenderPreviewLine(e.Graphics, rect, m_line);
@@ -159,37 +154,182 @@
                 FeaturePreviewRender.RenderPreviewFont(e.Graphics, rect, null);
         }
 
+        public double PreviewScale { get; private set; }
+
+        public int ThemeCategory { get; private set; }
+
+        private ITextSymbol m_editLabel;
+        private IPointSymbolization2D m_editPoint;
+        private IList<IStroke> m_editLine;
+        private IAreaSymbolizationFill m_editArea;
+
+        private ITextSymbol m_origLabel;
+        private IPointSymbolization2D m_origPoint;
+        private IList<IStroke> m_origLine;
+        private IAreaSymbolizationFill m_origArea;
+
         private void EditButton_Click(object sender, EventArgs e)
         {
             UserControl uc = null;
+            ILayerStylePreviewable prev = new LayerStylePreviewable(m_owner.EditorService.EditedResourceID,
+                                                                    this.PreviewScale,
+                                                                    80,
+                                                                    40,
+                                                                    "PNG",
+                                                                    this.ThemeCategory);
+
+            //TODO: This is obviously a mess and could do with some future cleanup, but the idea here should be
+            //easy to understand. Each primitive basic style (that's not a label) has 3 actions.
+            // - Commit (When user clicks OK on dialog)
+            // - Rollback (When user clicks Cancel on dialog)
+            // - Edit Commit (When user invokes refresh)
+            //Those that support GETLEGENDIMAGE-based previews will be passed an edit commit action. Invoking the
+            //edit commit action will update the session-based layer with this edit-copy rule, allowing for the changes
+            //to be reflected when we do the GETLEGENDIMAGE call
+            //
+            //Labels are exempt as those previews can be sufficiently simulated with System.Drawing API
+            var factory = (ILayerElementFactory)m_owner.Editor.GetEditedResource();
+            Action commit = null;
+            Action rollback = null;
             if (isLabel)
             {
+                m_origLabel = m_label;
+                m_editLabel = (m_label == null) ? null : (ITextSymbol)m_label.Clone();
+
                 uc = new FontStyleEditor(m_owner.Editor, m_owner.SelectedClass, m_owner.FeatureSourceId);
-                ((FontStyleEditor)uc).Item = m_label == null ? null : (ITextSymbol)m_label.Clone(); //(ITextSymbol)Utility.DeepCopy(m_label);
+                ((FontStyleEditor)uc).Item = m_editLabel;
             }
             else if (isW2dSymbol)
             {
-                uc = new PointFeatureStyleEditor(m_owner.Editor, m_owner.SelectedClass, m_owner.FeatureSourceId, m_w2dsymbol);
-                ((PointFeatureStyleEditor)uc).Item = m_point == null ? null : (IPointSymbolization2D)m_point.Clone(); //(IPointSymbolization2D)Utility.XmlDeepCopy(m_point);
+                m_origPoint = m_point;
+                m_editPoint = (m_point == null) ? null : (IPointSymbolization2D)m_point.Clone();
+
+                var pfse = new PointFeatureStyleEditor(m_owner.Editor, m_owner.SelectedClass, m_owner.FeatureSourceId, m_w2dsymbol, prev);
+                uc = pfse;
+                pfse.Item = m_editPoint;
+
+                Action editCommit = () =>
+                {
+                    //We need to update this boolean state
+                    var w2d = pfse.W2DSymbolPreviewImage;
+                    this.isPoint = (w2d == null);
+                    this.isW2dSymbol = (w2d != null);
+
+                    m_editPoint = pfse.Item;
+                    ((IPointRule)m_parent).PointSymbolization2D = m_editPoint;
+
+                    m_w2dsymbol = w2d;
+                };
+                pfse.SetEditCommit(editCommit);
+                commit = () =>
+                {
+                    //We need to update this boolean state
+                    var w2d = pfse.W2DSymbolPreviewImage;
+                    this.isPoint = (w2d == null);
+                    this.isW2dSymbol = (w2d != null);
+
+                    m_point = pfse.Item;
+                    ((IPointRule)m_parent).PointSymbolization2D = m_point;
+
+                    m_w2dsymbol = w2d;
+                };
+                rollback = () =>
+                {
+                    ((IPointRule)m_parent).PointSymbolization2D = m_origPoint;
+                };
             }
             else if (isPoint)
             {
-                uc = new PointFeatureStyleEditor(m_owner.Editor, m_owner.SelectedClass, m_owner.FeatureSourceId);
-                ((PointFeatureStyleEditor)uc).Item = m_point == null ? null : (IPointSymbolization2D)m_point.Clone(); //(IPointSymbolization2D)Utility.XmlDeepCopy(m_point);
+                m_origPoint = m_point;
+                m_editPoint = (m_point == null) ? null : (IPointSymbolization2D)m_point.Clone();
+
+                var pfse = new PointFeatureStyleEditor(m_owner.Editor, m_owner.SelectedClass, m_owner.FeatureSourceId, prev);
+                uc = pfse;
+                pfse.Item = m_editPoint;
+
+                Action editCommit = () =>
+                {
+                    //We need to update this boolean state
+                    var w2d = pfse.W2DSymbolPreviewImage;
+                    this.isPoint = (w2d == null);
+                    this.isW2dSymbol = (w2d != null);
+
+                    m_editPoint = pfse.Item;
+                    ((IPointRule)m_parent).PointSymbolization2D = m_editPoint;
+
+                    m_w2dsymbol = w2d;
+                };
+                pfse.SetEditCommit(editCommit);
+                commit = () =>
+                {
+                    //We need to update this boolean state
+                    var w2d = pfse.W2DSymbolPreviewImage;
+                    this.isPoint = (w2d == null);
+                    this.isW2dSymbol = (w2d != null);
+
+                    m_point = pfse.Item;
+                    ((IPointRule)m_parent).PointSymbolization2D = m_point;
+
+                    m_w2dsymbol = w2d;
+                };
+                rollback = () => 
+                {
+                    ((IPointRule)m_parent).PointSymbolization2D = m_origPoint;
+                };
             }
             else if (isLine)
             {
-                uc = new LineFeatureStyleEditor(m_owner.Editor, m_owner.SelectedClass, m_owner.FeatureSourceId, _factory);
-                ((LineFeatureStyleEditor)uc).Item = m_line == null ? null : LayerElementCloningUtil.CloneStrokes(m_line);//(IList<IStroke>)Utility.XmlDeepCopy(m_line);
+                m_origLine = m_line;
+                m_editLine = (m_line == null) ? new List<IStroke>() : LayerElementCloningUtil.CloneStrokes(m_line);
+
+                var lfse = new LineFeatureStyleEditor(m_owner.Editor, m_owner.SelectedClass, m_owner.FeatureSourceId, factory, prev);
+                uc = lfse;
+                lfse.Item = m_editLine;
+
+                Action editCommit = () => 
+                {
+                    m_editLine = lfse.Item;
+                    ((ILineRule)m_parent).SetStrokes(m_editLine);
+                };
+                lfse.SetEditCommit(editCommit);
+                commit = () =>
+                {
+                    m_line = lfse.Item;
+                    ((ILineRule)m_parent).SetStrokes(m_line);
+                };
+                rollback = () =>
+                {
+                    ((ILineRule)m_parent).SetStrokes(m_origLine);
+                };
             }
             else if (isArea)
             {
-                uc = new AreaFeatureStyleEditor(m_owner.Editor, m_owner.SelectedClass, m_owner.FeatureSourceId);
-                ((AreaFeatureStyleEditor)uc).Item = m_area == null ? null : (IAreaSymbolizationFill)m_area.Clone(); //(IAreaSymbolizationFill)Utility.XmlDeepCopy(m_area);
+                m_origArea = m_area;
+                m_editArea = (m_area == null) ? null : (IAreaSymbolizationFill)m_area.Clone();
+
+                var afse = new AreaFeatureStyleEditor(m_owner.Editor, m_owner.SelectedClass, m_owner.FeatureSourceId, prev);
+                uc = afse;
+                afse.Item = m_editArea;
+
+                Action editCommit = () =>
+                {
+                    m_editArea = afse.Item;
+                    ((IAreaRule)m_parent).AreaSymbolization2D = m_editArea;
+                };
+                commit = () =>
+                {
+                    m_area = afse.Item;
+                    ((IAreaRule)m_parent).AreaSymbolization2D = m_area;
+                };
+                rollback = () =>
+                {
+                    ((IAreaRule)m_parent).AreaSymbolization2D = m_origArea;
+                };
+                afse.SetEditCommit(editCommit);
             }
             else if (isComp)
             {
-                var diag = new SymbolInstancesDialog(m_owner.Editor, m_comp, m_owner.SelectedClass, m_owner.GetFdoProvider(), m_owner.FeatureSourceId);
+                var diag = new SymbolInstancesDialog(m_owner.Editor, m_comp, m_owner.SelectedClass, m_owner.GetFdoProvider(), m_owner.FeatureSourceId, prev);
                 diag.ShowDialog();
                 //HACK: Assume edits made
                 Owner.RaiseResourceChanged();
@@ -202,8 +342,14 @@
                 dlg.ItemPanel.Controls.Add(uc);
                 uc.Dock = DockStyle.Fill;
                 dlg.RefreshSize();
-                if (dlg.ShowDialog(this) == DialogResult.OK)
+                var res = dlg.ShowDialog(this);
+                if (res == DialogResult.OK)
                 {
+                    if (commit != null)
+                    {
+                        commit.Invoke();
+                    }
+
                     if (isLabel)
                     {
                         m_label = ((FontStyleEditor)uc).Item;
@@ -219,37 +365,28 @@
                     }
                     else if (isPoint || isW2dSymbol)
                     {
-                        //We need to update this boolean state
-                        var w2d = ((PointFeatureStyleEditor)uc).W2DSymbolPreviewImage;
-                        isPoint = (w2d == null);
-                        isW2dSymbol = (w2d != null);
-
-                        m_point = ((PointFeatureStyleEditor)uc).Item;
-                        ((IPointRule)m_parent).PointSymbolization2D = m_point;
-
-                        m_w2dsymbol = w2d;
-
                         if (ItemChanged != null)
                             ItemChanged(m_point, null);
                     }
                     else if (isLine)
                     {
-                        m_line = ((LineFeatureStyleEditor)uc).Item;
-                        ((ILineRule)m_parent).SetStrokes(m_line);
+                           
                         if (ItemChanged != null)
                             ItemChanged(m_line, null);
                     }
                     else if (isArea)
                     {
-                        m_area = ((AreaFeatureStyleEditor)uc).Item;
-                        ((IAreaRule)m_parent).AreaSymbolization2D = m_area;
                         if (ItemChanged != null)
                             ItemChanged(m_area, null);
                     }
-                    
+
                     this.Refresh();
-
                 }
+                else if (res == DialogResult.Cancel)
+                {
+                    if (rollback != null)
+                        rollback.Invoke();
+                }
             }
 
         }

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs	2012-09-03 13:38:24 UTC (rev 6977)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs	2012-09-03 16:35:12 UTC (rev 6978)
@@ -32,6 +32,7 @@
 using Maestro.Editors.LayerDefinition.Vector.Scales.SymbolInstanceEditors;
 using OSGeo.MapGuide.MaestroAPI.Schema;
 using OSGeo.MapGuide.ObjectModels;
+using OSGeo.MapGuide.MaestroAPI.Services;
 
 namespace Maestro.Editors.LayerDefinition.Vector.Scales
 {
@@ -44,7 +45,10 @@
         private string _provider;
         private string _featureSourceId;
 
-        public SymbolInstancesDialog(IEditorService edSvc, ICompositeSymbolization comp, ClassDefinition cls, string provider, string featureSourceId)
+        private IMappingService _mappingSvc;
+        private ILayerStylePreviewable _preview;
+
+        public SymbolInstancesDialog(IEditorService edSvc, ICompositeSymbolization comp, ClassDefinition cls, string provider, string featureSourceId, ILayerStylePreviewable prev)
         {
             InitializeComponent();
             _edSvc = edSvc;
@@ -54,10 +58,22 @@
             _provider = provider;
             _featureSourceId = featureSourceId;
 
+            _preview = prev;
+            var conn = edSvc.GetEditedResource().CurrentConnection;
+            if (Array.IndexOf(conn.Capabilities.SupportedServices, (int)ServiceType.Mapping) >= 0)
+            {
+                _mappingSvc = (IMappingService)conn.GetService((int)ServiceType.Mapping);
+            }
+
             foreach (var inst in _comp.SymbolInstance)
                 AddInstance(inst, false);
         }
 
+        public bool UseLayerIconPreview
+        {
+            get { return _mappingSvc != null && _preview != null; }
+        }
+
         private void btnClose_Click(object sender, EventArgs e)
         {
             this.Close();

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs	2012-09-03 13:38:24 UTC (rev 6977)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs	2012-09-03 16:35:12 UTC (rev 6978)
@@ -27,52 +27,57 @@
 using OSGeo.MapGuide.ObjectModels.FeatureSource;
 using OSGeo.MapGuide.ObjectModels;
 using OSGeo.MapGuide.MaestroAPI.Schema;
+using OSGeo.MapGuide.MaestroAPI.Services;
+using Maestro.Shared.UI;
 
 namespace Maestro.Editors.LayerDefinition.Vector.StyleEditors
 {
-	/// <summary>
-	/// Summary description for AreaFeatureStyleEditor.
-	/// </summary>
+    /// <summary>
+    /// Summary description for AreaFeatureStyleEditor.
+    /// </summary>
     [ToolboxItem(false)]
-	internal class AreaFeatureStyleEditor : System.Windows.Forms.UserControl
-	{
-		private System.Windows.Forms.ComboBox sizeContextCombo;
-		private System.Windows.Forms.Label label4;
-		private System.Windows.Forms.Label label3;
-		private System.Windows.Forms.GroupBox groupBox1;
+    internal class AreaFeatureStyleEditor : System.Windows.Forms.UserControl
+    {
+        private System.Windows.Forms.ComboBox sizeContextCombo;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.GroupBox groupBox1;
         private System.Windows.Forms.GroupBox groupBox2;
-		private System.Windows.Forms.GroupBox previewGroup;
-		private System.Windows.Forms.PictureBox previewPicture;
-		/// <summary>
-		/// Required designer variable.
-		/// </summary>
-		private System.ComponentModel.Container components = null;
-		private System.Data.DataSet ComboBoxDataSet;
-		private System.Data.DataTable SizeContextTable;
-		private System.Data.DataColumn dataColumn3;
-		private System.Data.DataColumn dataColumn4;
-		private System.Data.DataTable UnitsTable;
-		private System.Data.DataColumn dataColumn5;
-		private System.Data.DataColumn dataColumn6;
+        private System.Windows.Forms.GroupBox previewGroup;
+        private System.Windows.Forms.PictureBox previewPicture;
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.Container components = null;
+        private System.Data.DataSet ComboBoxDataSet;
+        private System.Data.DataTable SizeContextTable;
+        private System.Data.DataColumn dataColumn3;
+        private System.Data.DataColumn dataColumn4;
+        private System.Data.DataTable UnitsTable;
+        private System.Data.DataColumn dataColumn5;
+        private System.Data.DataColumn dataColumn6;
 
-		private IAreaSymbolizationFill m_item;
-		private FillStyleEditor fillStyleEditor;
-		private LineStyleEditor lineStyleEditor;
-		private System.Windows.Forms.ComboBox sizeUnitsCombo;
-		private bool m_inUpdate = false;
+        private IAreaSymbolizationFill m_item;
+        private FillStyleEditor fillStyleEditor;
+        private LineStyleEditor lineStyleEditor;
+        private System.Windows.Forms.ComboBox sizeUnitsCombo;
+        private bool m_inUpdate = false;
 
-		private IFill previousFill = null;
-		private IStroke previousStroke = null;
+        private IFill previousFill = null;
+        private IStroke previousStroke = null;
 
-		public event EventHandler Changed;
+        public event EventHandler Changed;
 
         private IEditorService m_editor;
         private ClassDefinition m_schema;
         private string m_featureSource;
         private string m_providername;
         private ILayerElementFactory _factory;
+        private IMappingService _mappingSvc;
+        private LinkLabel lnkRefresh;
+        private ILayerStylePreviewable _preview;
 
-        public AreaFeatureStyleEditor(IEditorService editor, ClassDefinition schema, string featureSource)
+        internal AreaFeatureStyleEditor(IEditorService editor, ClassDefinition schema, string featureSource, ILayerStylePreviewable prev)
             : this()
         {
             m_editor = editor;
@@ -83,8 +88,21 @@
 
             m_providername = fs.Provider;
             m_featureSource = featureSource;
+
+            _preview = prev;
+            var conn = editor.GetEditedResource().CurrentConnection;
+            if (Array.IndexOf(conn.Capabilities.SupportedServices, (int)ServiceType.Mapping) >= 0)
+            {
+                _mappingSvc = (IMappingService)conn.GetService((int)ServiceType.Mapping);
+            }
+            lnkRefresh.Visible = this.UseLayerIconPreview;
         }
 
+        public bool UseLayerIconPreview
+        {
+            get { return _mappingSvc != null && _preview != null; }
+        }
+
         private AreaFeatureStyleEditor()
         {
             //
@@ -106,230 +124,242 @@
             lineStyleEditor.fillCombo.SelectedIndexChanged += new EventHandler(fillCombo_Line_SelectedIndexChanged);
         }
 
-		/// <summary>
-		/// Clean up any resources being used.
-		/// </summary>
-		protected override void Dispose( bool disposing )
-		{
-			if( disposing )
-			{
-				if(components != null)
-				{
-					components.Dispose();
-				}
-			}
-			base.Dispose( disposing );
-		}
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        protected override void Dispose( bool disposing )
+        {
+            if( disposing )
+            {
+                if(components != null)
+                {
+                    components.Dispose();
+                }
+            }
+            base.Dispose( disposing );
+        }
 
-		#region Windows Form Designer generated code
-		/// <summary>
-		/// Required method for Designer support - do not modify
-		/// the contents of this method with the code editor.
-		/// </summary>
-		private void InitializeComponent()
-		{
-		    System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AreaFeatureStyleEditor));
-		    this.fillStyleEditor = new Maestro.Editors.LayerDefinition.Vector.StyleEditors.FillStyleEditor();
-		    this.lineStyleEditor = new Maestro.Editors.LayerDefinition.Vector.StyleEditors.LineStyleEditor();
-		    this.sizeUnitsCombo = new System.Windows.Forms.ComboBox();
-		    this.UnitsTable = new System.Data.DataTable();
-		    this.dataColumn5 = new System.Data.DataColumn();
-		    this.dataColumn6 = new System.Data.DataColumn();
-		    this.sizeContextCombo = new System.Windows.Forms.ComboBox();
-		    this.SizeContextTable = new System.Data.DataTable();
-		    this.dataColumn3 = new System.Data.DataColumn();
-		    this.dataColumn4 = new System.Data.DataColumn();
-		    this.label4 = new System.Windows.Forms.Label();
-		    this.label3 = new System.Windows.Forms.Label();
-		    this.groupBox1 = new System.Windows.Forms.GroupBox();
-		    this.groupBox2 = new System.Windows.Forms.GroupBox();
-		    this.previewGroup = new System.Windows.Forms.GroupBox();
-		    this.previewPicture = new System.Windows.Forms.PictureBox();
-		    this.ComboBoxDataSet = new System.Data.DataSet();
-		    ((System.ComponentModel.ISupportInitialize)(this.UnitsTable)).BeginInit();
-		    ((System.ComponentModel.ISupportInitialize)(this.SizeContextTable)).BeginInit();
-		    this.groupBox1.SuspendLayout();
-		    this.groupBox2.SuspendLayout();
-		    this.previewGroup.SuspendLayout();
-		    ((System.ComponentModel.ISupportInitialize)(this.previewPicture)).BeginInit();
-		    ((System.ComponentModel.ISupportInitialize)(this.ComboBoxDataSet)).BeginInit();
-		    this.SuspendLayout();
-		    // 
-		    // fillStyleEditor
-		    // 
-		    resources.ApplyResources(this.fillStyleEditor, "fillStyleEditor");
-		    this.fillStyleEditor.Name = "fillStyleEditor";
-		    this.fillStyleEditor.ForegroundRequiresExpression += new System.EventHandler(this.fillStyleEditor_ForegroundRequiresExpression);
-		    this.fillStyleEditor.BackgroundRequiresExpression += new System.EventHandler(this.fillStyleEditor_BackgroundRequiresExpression);
-		    // 
-		    // lineStyleEditor
-		    // 
-		    resources.ApplyResources(this.lineStyleEditor, "lineStyleEditor");
-		    this.lineStyleEditor.ColorExpression = "";
-		    this.lineStyleEditor.Name = "lineStyleEditor";
-		    this.lineStyleEditor.RequiresExpressionEditor += new System.EventHandler(this.LineStyleEditor_RequiresExpressionEditor);
-		    // 
-		    // sizeUnitsCombo
-		    // 
-		    resources.ApplyResources(this.sizeUnitsCombo, "sizeUnitsCombo");
-		    this.sizeUnitsCombo.DataSource = this.UnitsTable;
-		    this.sizeUnitsCombo.DisplayMember = "Display";
-		    this.sizeUnitsCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-		    this.sizeUnitsCombo.Name = "sizeUnitsCombo";
-		    this.sizeUnitsCombo.ValueMember = "Value";
-		    this.sizeUnitsCombo.SelectedIndexChanged += new System.EventHandler(this.sizeUnitsCombo_SelectedIndexChanged);
-		    // 
-		    // UnitsTable
-		    // 
-		    this.UnitsTable.Columns.AddRange(new System.Data.DataColumn[] {
-		    		    		    this.dataColumn5,
-		    		    		    this.dataColumn6});
-		    this.UnitsTable.TableName = "Units";
-		    // 
-		    // dataColumn5
-		    // 
-		    this.dataColumn5.Caption = "Display";
-		    this.dataColumn5.ColumnName = "Display";
-		    // 
-		    // dataColumn6
-		    // 
-		    this.dataColumn6.Caption = "Value";
-		    this.dataColumn6.ColumnName = "Value";
-		    // 
-		    // sizeContextCombo
-		    // 
-		    resources.ApplyResources(this.sizeContextCombo, "sizeContextCombo");
-		    this.sizeContextCombo.DataSource = this.SizeContextTable;
-		    this.sizeContextCombo.DisplayMember = "Display";
-		    this.sizeContextCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-		    this.sizeContextCombo.Name = "sizeContextCombo";
-		    this.sizeContextCombo.ValueMember = "Value";
-		    this.sizeContextCombo.SelectedIndexChanged += new System.EventHandler(this.sizeContextCombo_SelectedIndexChanged);
-		    // 
-		    // SizeContextTable
-		    // 
-		    this.SizeContextTable.Columns.AddRange(new System.Data.DataColumn[] {
-		    		    		    this.dataColumn3,
-		    		    		    this.dataColumn4});
-		    this.SizeContextTable.TableName = "SizeContext";
-		    // 
-		    // dataColumn3
-		    // 
-		    this.dataColumn3.Caption = "Display";
-		    this.dataColumn3.ColumnName = "Display";
-		    // 
-		    // dataColumn4
-		    // 
-		    this.dataColumn4.Caption = "Value";
-		    this.dataColumn4.ColumnName = "Value";
-		    // 
-		    // label4
-		    // 
-		    resources.ApplyResources(this.label4, "label4");
-		    this.label4.Name = "label4";
-		    // 
-		    // label3
-		    // 
-		    resources.ApplyResources(this.label3, "label3");
-		    this.label3.Name = "label3";
-		    // 
-		    // groupBox1
-		    // 
-		    resources.ApplyResources(this.groupBox1, "groupBox1");
-		    this.groupBox1.Controls.Add(this.sizeUnitsCombo);
-		    this.groupBox1.Controls.Add(this.sizeContextCombo);
-		    this.groupBox1.Controls.Add(this.label4);
-		    this.groupBox1.Controls.Add(this.label3);
-		    this.groupBox1.Controls.Add(this.lineStyleEditor);
-		    this.groupBox1.Name = "groupBox1";
-		    this.groupBox1.TabStop = false;
-		    // 
-		    // groupBox2
-		    // 
-		    resources.ApplyResources(this.groupBox2, "groupBox2");
-		    this.groupBox2.Controls.Add(this.fillStyleEditor);
-		    this.groupBox2.Name = "groupBox2";
-		    this.groupBox2.TabStop = false;
-		    // 
-		    // previewGroup
-		    // 
-		    resources.ApplyResources(this.previewGroup, "previewGroup");
-		    this.previewGroup.Controls.Add(this.previewPicture);
-		    this.previewGroup.Name = "previewGroup";
-		    this.previewGroup.TabStop = false;
-		    // 
-		    // previewPicture
-		    // 
-		    resources.ApplyResources(this.previewPicture, "previewPicture");
-		    this.previewPicture.BackColor = System.Drawing.Color.White;
-		    this.previewPicture.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-		    this.previewPicture.Name = "previewPicture";
-		    this.previewPicture.TabStop = false;
-		    this.previewPicture.Paint += new System.Windows.Forms.PaintEventHandler(this.previewPicture_Paint);
-		    // 
-		    // ComboBoxDataSet
-		    // 
-		    this.ComboBoxDataSet.DataSetName = "ComboBoxDataSet";
-		    this.ComboBoxDataSet.Locale = new System.Globalization.CultureInfo("da-DK");
-		    this.ComboBoxDataSet.Tables.AddRange(new System.Data.DataTable[] {
-		    		    		    this.SizeContextTable,
-		    		    		    this.UnitsTable});
-		    // 
-		    // AreaFeatureStyleEditor
-		    // 
-		    resources.ApplyResources(this, "$this");
-		    this.Controls.Add(this.previewGroup);
-		    this.Controls.Add(this.groupBox2);
-		    this.Controls.Add(this.groupBox1);
-		    this.Name = "AreaFeatureStyleEditor";
-		    this.Load += new System.EventHandler(this.AreaFeatureStyleEditor_Load);
-		    ((System.ComponentModel.ISupportInitialize)(this.UnitsTable)).EndInit();
-		    ((System.ComponentModel.ISupportInitialize)(this.SizeContextTable)).EndInit();
-		    this.groupBox1.ResumeLayout(false);
-		    this.groupBox2.ResumeLayout(false);
-		    this.previewGroup.ResumeLayout(false);
-		    ((System.ComponentModel.ISupportInitialize)(this.previewPicture)).EndInit();
-		    ((System.ComponentModel.ISupportInitialize)(this.ComboBoxDataSet)).EndInit();
-		    this.ResumeLayout(false);
-		}
-		#endregion
+        #region Windows Form Designer generated code
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AreaFeatureStyleEditor));
+            this.fillStyleEditor = new Maestro.Editors.LayerDefinition.Vector.StyleEditors.FillStyleEditor();
+            this.lineStyleEditor = new Maestro.Editors.LayerDefinition.Vector.StyleEditors.LineStyleEditor();
+            this.sizeUnitsCombo = new System.Windows.Forms.ComboBox();
+            this.UnitsTable = new System.Data.DataTable();
+            this.dataColumn5 = new System.Data.DataColumn();
+            this.dataColumn6 = new System.Data.DataColumn();
+            this.sizeContextCombo = new System.Windows.Forms.ComboBox();
+            this.SizeContextTable = new System.Data.DataTable();
+            this.dataColumn3 = new System.Data.DataColumn();
+            this.dataColumn4 = new System.Data.DataColumn();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.previewGroup = new System.Windows.Forms.GroupBox();
+            this.lnkRefresh = new System.Windows.Forms.LinkLabel();
+            this.previewPicture = new System.Windows.Forms.PictureBox();
+            this.ComboBoxDataSet = new System.Data.DataSet();
+            ((System.ComponentModel.ISupportInitialize)(this.UnitsTable)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.SizeContextTable)).BeginInit();
+            this.groupBox1.SuspendLayout();
+            this.groupBox2.SuspendLayout();
+            this.previewGroup.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.previewPicture)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.ComboBoxDataSet)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // fillStyleEditor
+            // 
+            resources.ApplyResources(this.fillStyleEditor, "fillStyleEditor");
+            this.fillStyleEditor.Name = "fillStyleEditor";
+            this.fillStyleEditor.ForegroundRequiresExpression += new System.EventHandler(this.fillStyleEditor_ForegroundRequiresExpression);
+            this.fillStyleEditor.BackgroundRequiresExpression += new System.EventHandler(this.fillStyleEditor_BackgroundRequiresExpression);
+            // 
+            // lineStyleEditor
+            // 
+            resources.ApplyResources(this.lineStyleEditor, "lineStyleEditor");
+            this.lineStyleEditor.ColorExpression = "";
+            this.lineStyleEditor.Name = "lineStyleEditor";
+            this.lineStyleEditor.RequiresExpressionEditor += new System.EventHandler(this.LineStyleEditor_RequiresExpressionEditor);
+            // 
+            // sizeUnitsCombo
+            // 
+            resources.ApplyResources(this.sizeUnitsCombo, "sizeUnitsCombo");
+            this.sizeUnitsCombo.DataSource = this.UnitsTable;
+            this.sizeUnitsCombo.DisplayMember = "Display";
+            this.sizeUnitsCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.sizeUnitsCombo.Name = "sizeUnitsCombo";
+            this.sizeUnitsCombo.ValueMember = "Value";
+            this.sizeUnitsCombo.SelectedIndexChanged += new System.EventHandler(this.sizeUnitsCombo_SelectedIndexChanged);
+            // 
+            // UnitsTable
+            // 
+            this.UnitsTable.Columns.AddRange(new System.Data.DataColumn[] {
+            this.dataColumn5,
+            this.dataColumn6});
+            this.UnitsTable.TableName = "Units";
+            // 
+            // dataColumn5
+            // 
+            this.dataColumn5.Caption = "Display";
+            this.dataColumn5.ColumnName = "Display";
+            // 
+            // dataColumn6
+            // 
+            this.dataColumn6.Caption = "Value";
+            this.dataColumn6.ColumnName = "Value";
+            // 
+            // sizeContextCombo
+            // 
+            resources.ApplyResources(this.sizeContextCombo, "sizeContextCombo");
+            this.sizeContextCombo.DataSource = this.SizeContextTable;
+            this.sizeContextCombo.DisplayMember = "Display";
+            this.sizeContextCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.sizeContextCombo.Name = "sizeContextCombo";
+            this.sizeContextCombo.ValueMember = "Value";
+            this.sizeContextCombo.SelectedIndexChanged += new System.EventHandler(this.sizeContextCombo_SelectedIndexChanged);
+            // 
+            // SizeContextTable
+            // 
+            this.SizeContextTable.Columns.AddRange(new System.Data.DataColumn[] {
+            this.dataColumn3,
+            this.dataColumn4});
+            this.SizeContextTable.TableName = "SizeContext";
+            // 
+            // dataColumn3
+            // 
+            this.dataColumn3.Caption = "Display";
+            this.dataColumn3.ColumnName = "Display";
+            // 
+            // dataColumn4
+            // 
+            this.dataColumn4.Caption = "Value";
+            this.dataColumn4.ColumnName = "Value";
+            // 
+            // label4
+            // 
+            resources.ApplyResources(this.label4, "label4");
+            this.label4.Name = "label4";
+            // 
+            // label3
+            // 
+            resources.ApplyResources(this.label3, "label3");
+            this.label3.Name = "label3";
+            // 
+            // groupBox1
+            // 
+            resources.ApplyResources(this.groupBox1, "groupBox1");
+            this.groupBox1.Controls.Add(this.sizeUnitsCombo);
+            this.groupBox1.Controls.Add(this.sizeContextCombo);
+            this.groupBox1.Controls.Add(this.label4);
+            this.groupBox1.Controls.Add(this.label3);
+            this.groupBox1.Controls.Add(this.lineStyleEditor);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.TabStop = false;
+            // 
+            // groupBox2
+            // 
+            resources.ApplyResources(this.groupBox2, "groupBox2");
+            this.groupBox2.Controls.Add(this.fillStyleEditor);
+            this.groupBox2.Name = "groupBox2";
+            this.groupBox2.TabStop = false;
+            // 
+            // previewGroup
+            // 
+            resources.ApplyResources(this.previewGroup, "previewGroup");
+            this.previewGroup.Controls.Add(this.lnkRefresh);
+            this.previewGroup.Controls.Add(this.previewPicture);
+            this.previewGroup.Name = "previewGroup";
+            this.previewGroup.TabStop = false;
+            // 
+            // lnkRefresh
+            // 
+            resources.ApplyResources(this.lnkRefresh, "lnkRefresh");
+            this.lnkRefresh.BackColor = System.Drawing.Color.Transparent;
+            this.lnkRefresh.Name = "lnkRefresh";
+            this.lnkRefresh.TabStop = true;
+            this.lnkRefresh.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkRefresh_LinkClicked);
+            // 
+            // previewPicture
+            // 
+            resources.ApplyResources(this.previewPicture, "previewPicture");
+            this.previewPicture.BackColor = System.Drawing.Color.White;
+            this.previewPicture.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.previewPicture.Name = "previewPicture";
+            this.previewPicture.TabStop = false;
+            this.previewPicture.Paint += new System.Windows.Forms.PaintEventHandler(this.previewPicture_Paint);
+            // 
+            // ComboBoxDataSet
+            // 
+            this.ComboBoxDataSet.DataSetName = "ComboBoxDataSet";
+            this.ComboBoxDataSet.Locale = new System.Globalization.CultureInfo("da-DK");
+            this.ComboBoxDataSet.Tables.AddRange(new System.Data.DataTable[] {
+            this.SizeContextTable,
+            this.UnitsTable});
+            // 
+            // AreaFeatureStyleEditor
+            // 
+            resources.ApplyResources(this, "$this");
+            this.Controls.Add(this.previewGroup);
+            this.Controls.Add(this.groupBox2);
+            this.Controls.Add(this.groupBox1);
+            this.Name = "AreaFeatureStyleEditor";
+            this.Load += new System.EventHandler(this.AreaFeatureStyleEditor_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.UnitsTable)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.SizeContextTable)).EndInit();
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox2.ResumeLayout(false);
+            this.previewGroup.ResumeLayout(false);
+            this.previewGroup.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.previewPicture)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.ComboBoxDataSet)).EndInit();
+            this.ResumeLayout(false);
 
-		private void AreaFeatureStyleEditor_Load(object sender, System.EventArgs e)
-		{
-			//UpdateDisplay();
-		}
+        }
+        #endregion
 
-		private void UpdateDisplay()
-		{
-			if (m_inUpdate)
-				return;
+        private void AreaFeatureStyleEditor_Load(object sender, System.EventArgs e)
+        {
+            //UpdateDisplay();
+        }
 
-			try
-			{
+        private void UpdateDisplay()
+        {
+            if (m_inUpdate)
+                return;
+
+            try
+            {
                 m_inUpdate = true;
                 
                 if (m_item == null)
-				{
-					fillStyleEditor.displayFill.Checked = false;
-					lineStyleEditor.displayLine.Checked = false;
-					return;
-				}
+                {
+                    fillStyleEditor.displayFill.Checked = false;
+                    lineStyleEditor.displayLine.Checked = false;
+                    return;
+                }
 
-				fillStyleEditor.displayFill.Checked = m_item.Fill != null;
-				if (m_item.Fill != null)
-				{
+                fillStyleEditor.displayFill.Checked = m_item.Fill != null;
+                if (m_item.Fill != null)
+                {
                     fillStyleEditor.foregroundColor.ColorExpression = m_item.Fill.ForegroundColor;
                     fillStyleEditor.backgroundColor.ColorExpression = m_item.Fill.BackgroundColor;
 
-					fillStyleEditor.fillCombo.SelectedValue = m_item.Fill.FillPattern;
-					if (fillStyleEditor.fillCombo.SelectedItem == null && fillStyleEditor.fillCombo.Items.Count > 0)
-						fillStyleEditor.fillCombo.SelectedIndex = fillStyleEditor.fillCombo.FindString(m_item.Fill.FillPattern);
-				}
-				
-				lineStyleEditor.displayLine.Checked = m_item.Stroke != null;
-				if (m_item.Stroke != null)
-				{
-					sizeUnitsCombo.SelectedValue = m_item.Stroke.Unit.ToString();
+                    fillStyleEditor.fillCombo.SelectedValue = m_item.Fill.FillPattern;
+                    if (fillStyleEditor.fillCombo.SelectedItem == null && fillStyleEditor.fillCombo.Items.Count > 0)
+                        fillStyleEditor.fillCombo.SelectedIndex = fillStyleEditor.fillCombo.FindString(m_item.Fill.FillPattern);
+                }
+                
+                lineStyleEditor.displayLine.Checked = m_item.Stroke != null;
+                if (m_item.Stroke != null)
+                {
+                    sizeUnitsCombo.SelectedValue = m_item.Stroke.Unit.ToString();
                     var s2 = m_item.Stroke as IStroke2;
                     if (s2 != null)
                     {
@@ -342,124 +372,146 @@
                     }
                     if (!string.IsNullOrEmpty(m_item.Stroke.Color))
                         lineStyleEditor.colorCombo.ColorExpression = m_item.Stroke.Color;
-					lineStyleEditor.fillCombo.SelectedIndex = lineStyleEditor.fillCombo.FindString(m_item.Stroke.LineStyle);
+                    lineStyleEditor.fillCombo.SelectedIndex = lineStyleEditor.fillCombo.FindString(m_item.Stroke.LineStyle);
                     lineStyleEditor.thicknessCombo.Text = m_item.Stroke.Thickness;
-				}
+                }
 
-				previewPicture.Refresh();
-			} 
-			finally
-			{
-				m_inUpdate = false;
-			}
-		}
+                previewPicture.Refresh();
+            } 
+            finally
+            {
+                m_inUpdate = false;
+            }
+        }
 
-		private void previewPicture_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
-		{
-			FeaturePreviewRender.RenderPreviewArea(e.Graphics, new Rectangle(1, 1, previewPicture.Width - 4, previewPicture.Height - 4), m_item);
-		}
+        private void UpdatePreviewImage()
+        {
+            using (new WaitCursor(this))
+            {
+                m_editor.SyncSessionCopy();
+                _previewImg = _mappingSvc.GetLegendImage(_preview.Scale, _preview.LayerDefinition, _preview.ThemeCategory, 3, previewPicture.Width, previewPicture.Height, _preview.ImageFormat);
+                previewPicture.Invalidate();
+            }
+        }
 
-		public IAreaSymbolizationFill Item 
-		{
-			get { return m_item; }
-			set
-			{
-				m_item = value;
-				UpdateDisplay();
-			}
-		}
+        private Image _previewImg = null;
 
-		private void fillCombo_SelectedIndexChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void previewPicture_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
+        {
+            if (UseLayerIconPreview)
+            {
+                if (_previewImg != null)
+                {
+                    e.Graphics.DrawImage(_previewImg, new Point(0, 0));
+                }
+            }
+            else
+            {
+                FeaturePreviewRender.RenderPreviewArea(e.Graphics, new Rectangle(1, 1, previewPicture.Width - 4, previewPicture.Height - 4), m_item);
+            }
+        }
 
-			m_item.Fill.FillPattern = fillStyleEditor.fillCombo.Text;
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+        public IAreaSymbolizationFill Item 
+        {
+            get { return m_item; }
+            set
+            {
+                m_item = value;
+                UpdateDisplay();
+            }
+        }
 
-		private void displayFill_CheckedChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void fillCombo_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
-			if (fillStyleEditor.displayFill.Checked)
-				m_item.Fill = previousFill == null ? _factory.CreateDefaultFill() : previousFill;
-			else
-			{
-				if (m_item.Fill != null)
-					previousFill = m_item.Fill;
-				m_item.Fill = null;
-			}
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            m_item.Fill.FillPattern = fillStyleEditor.fillCombo.Text;
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void foregroundColor_CurrentColorChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void displayFill_CheckedChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
+            if (fillStyleEditor.displayFill.Checked)
+                m_item.Fill = previousFill == null ? _factory.CreateDefaultFill() : previousFill;
+            else
+            {
+                if (m_item.Fill != null)
+                    previousFill = m_item.Fill;
+                m_item.Fill = null;
+            }
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
+
+        private void foregroundColor_CurrentColorChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
+
             m_item.Fill.ForegroundColor = fillStyleEditor.foregroundColor.ColorExpression;
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void backgroundColor_CurrentColorChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void backgroundColor_CurrentColorChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
             m_item.Fill.BackgroundColor = fillStyleEditor.backgroundColor.ColorExpression;
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void displayLine_CheckedChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void displayLine_CheckedChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
-			if (lineStyleEditor.displayLine.Checked)
+            if (lineStyleEditor.displayLine.Checked)
                 m_item.Stroke = previousStroke == null ? _factory.CreateDefaultStroke() : previousStroke;
-			else
-			{
-				if (m_item.Stroke != null)
-					previousStroke = m_item.Stroke;
-				m_item.Stroke = null;
-			}
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            else
+            {
+                if (m_item.Stroke != null)
+                    previousStroke = m_item.Stroke;
+                m_item.Stroke = null;
+            }
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void colorCombo_CurrentColorChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void colorCombo_CurrentColorChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
             m_item.Stroke.Color = lineStyleEditor.colorCombo.ColorExpression;
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void fillCombo_Line_SelectedIndexChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void fillCombo_Line_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
-			//TODO: Validate
-			m_item.Stroke.LineStyle = lineStyleEditor.fillCombo.Text;
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            //TODO: Validate
+            m_item.Stroke.LineStyle = lineStyleEditor.fillCombo.Text;
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
         private void thicknessCombo_TextChanged(object sender, EventArgs e)
         {
@@ -555,12 +607,34 @@
             if (expr != null)
                 fillStyleEditor.foregroundColor.ColorExpression = expr;
         }
-		
-		void LineStyleEditor_RequiresExpressionEditor(object sender, EventArgs e)
-		{
-		    string expr = m_editor.EditExpression(lineStyleEditor.colorCombo.ColorExpression, m_schema, m_providername, m_featureSource, true);
+        
+        void LineStyleEditor_RequiresExpressionEditor(object sender, EventArgs e)
+        {
+            string expr = m_editor.EditExpression(lineStyleEditor.colorCombo.ColorExpression, m_schema, m_providername, m_featureSource, true);
             if (expr != null)
                 lineStyleEditor.colorCombo.ColorExpression = expr;
-		}
+        }
+
+        private void lnkRefresh_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+        {
+            if (_editCommit != null)
+                _editCommit.Invoke();
+            UpdatePreviewImage();
+        }
+
+        protected override void OnLoad(EventArgs e)
+        {
+            base.OnLoad(e);
+            if (_editCommit != null)
+                _editCommit.Invoke();
+            UpdatePreviewImage();
+        }
+
+        private Action _editCommit;
+
+        internal void SetEditCommit(Action editCommit)
+        {
+            _editCommit = editCommit;
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.resx	2012-09-03 13:38:24 UTC (rev 6977)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.resx	2012-09-03 16:35:12 UTC (rev 6978)
@@ -321,6 +321,36 @@
   <data name="previewGroup.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Top, Left, Right</value>
   </data>
+  <data name="lnkRefresh.AutoSize" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
+  <data name="lnkRefresh.Location" type="System.Drawing.Point, System.Drawing">
+    <value>62, 0</value>
+  </data>
+  <data name="lnkRefresh.Size" type="System.Drawing.Size, System.Drawing">
+    <value>50, 13</value>
+  </data>
+  <data name="lnkRefresh.TabIndex" type="System.Int32, mscorlib">
+    <value>1</value>
+  </data>
+  <data name="lnkRefresh.Text" xml:space="preserve">
+    <value>(Refresh)</value>
+  </data>
+  <data name="lnkRefresh.Visible" type="System.Boolean, mscorlib">
+    <value>False</value>
+  </data>
+  <data name=">>lnkRefresh.Name" xml:space="preserve">
+    <value>lnkRefresh</value>
+  </data>
+  <data name=">>lnkRefresh.Type" xml:space="preserve">
+    <value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>lnkRefresh.Parent" xml:space="preserve">
+    <value>previewGroup</value>
+  </data>
+  <data name=">>lnkRefresh.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
   <data name="previewPicture.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Top, Left, Right</value>
   </data>
@@ -343,7 +373,7 @@
     <value>previewGroup</value>
   </data>
   <data name=">>previewPicture.ZOrder" xml:space="preserve">
-    <value>0</value>
+    <value>1</value>
   </data>
   <data name="previewGroup.Location" type="System.Drawing.Point, System.Drawing">
     <value>0, 392</value>

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.cs	2012-09-03 13:38:24 UTC (rev 6977)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.cs	2012-09-03 16:35:12 UTC (rev 6978)
@@ -29,58 +29,63 @@
 using Maestro.Editors.Common;
 using OSGeo.MapGuide.ObjectModels;
 using OSGeo.MapGuide.MaestroAPI.Schema;
+using OSGeo.MapGuide.MaestroAPI.Services;
+using Maestro.Shared.UI;
 
 namespace Maestro.Editors.LayerDefinition.Vector.StyleEditors
 {
-	/// <summary>
-	/// Summary description for LineFeatureStyleEditor.
-	/// </summary>
+    /// <summary>
+    /// Summary description for LineFeatureStyleEditor.
+    /// </summary>
     [ToolboxItem(false)]
-	internal class LineFeatureStyleEditor : System.Windows.Forms.UserControl
-	{
-		/// <summary>
-		/// Required designer variable.
-		/// </summary>
-		private System.ComponentModel.Container components = null;
-		private System.Windows.Forms.GroupBox CompositeGroup;
-		private System.Windows.Forms.Panel AdvancedPanel;
-		private System.Windows.Forms.Label label3;
-		private System.Windows.Forms.Label label2;
-		private System.Windows.Forms.PictureBox previewPicture;
-		private System.Windows.Forms.CheckBox applyLineStyle;
-		private System.Windows.Forms.CheckBox compositeLines;
-		private System.Windows.Forms.ListBox lineStyles;
-		private System.Windows.Forms.Panel propertyPanel;
-		private System.Windows.Forms.ComboBox sizeUnitsCombo;
-		private System.Windows.Forms.ComboBox sizeContextCombo;
-		private LineStyleEditor lineStyleEditor;
-		
-		private IList<IStroke> m_item = null;
-		private System.Windows.Forms.Panel compositePanel;
-		private System.Windows.Forms.GroupBox lineGroup;
-		private System.Windows.Forms.GroupBox sizeGroup;
-		private System.Windows.Forms.GroupBox previewGroup;
-		private System.Data.DataSet ComboBoxDataSet;
-		private System.Data.DataTable SizeContextTable;
-		private System.Data.DataColumn dataColumn3;
-		private System.Data.DataColumn dataColumn4;
-		private System.Data.DataTable UnitsTable;
-		private System.Data.DataColumn dataColumn5;
-		private System.Data.DataColumn dataColumn6;
-		private bool m_inUpdate = false;
+    internal class LineFeatureStyleEditor : System.Windows.Forms.UserControl
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.Container components = null;
+        private System.Windows.Forms.GroupBox CompositeGroup;
+        private System.Windows.Forms.Panel AdvancedPanel;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.PictureBox previewPicture;
+        private System.Windows.Forms.CheckBox applyLineStyle;
+        private System.Windows.Forms.CheckBox compositeLines;
+        private System.Windows.Forms.ListBox lineStyles;
+        private System.Windows.Forms.Panel propertyPanel;
+        private System.Windows.Forms.ComboBox sizeUnitsCombo;
+        private System.Windows.Forms.ComboBox sizeContextCombo;
+        private LineStyleEditor lineStyleEditor;
+        
+        private IList<IStroke> m_item = null;
+        private System.Windows.Forms.Panel compositePanel;
+        private System.Windows.Forms.GroupBox lineGroup;
+        private System.Windows.Forms.GroupBox sizeGroup;
+        private System.Windows.Forms.GroupBox previewGroup;
+        private System.Data.DataSet ComboBoxDataSet;
+        private System.Data.DataTable SizeContextTable;
+        private System.Data.DataColumn dataColumn3;
+        private System.Data.DataColumn dataColumn4;
+        private System.Data.DataTable UnitsTable;
+        private System.Data.DataColumn dataColumn5;
+        private System.Data.DataColumn dataColumn6;
+        private bool m_inUpdate = false;
         private ToolStrip toolStrip1;
         private ToolStripButton AddStyleButton;
         private ToolStripButton RemoveStyleButton;
 
-		public event EventHandler Changed;
+        public event EventHandler Changed;
 
         private IEditorService m_editor;
         private ClassDefinition m_schema;
         private string m_featureSource;
         private string m_providername;
         private ILayerElementFactory _factory;
+        private IMappingService _mappingSvc;
+        private LinkLabel lnkRefresh;
+        private ILayerStylePreviewable _preview;
 
-        public LineFeatureStyleEditor(IEditorService editor, ClassDefinition schema, string featureSource, ILayerElementFactory factory)
+        internal LineFeatureStyleEditor(IEditorService editor, ClassDefinition schema, string featureSource, ILayerElementFactory factory, ILayerStylePreviewable prev)
             : this()
         {
             m_editor = editor;
@@ -92,39 +97,52 @@
 
             m_providername = fs.Provider;
             m_featureSource = featureSource;
+
+            _preview = prev;
+            var conn = editor.GetEditedResource().CurrentConnection;
+            if (Array.IndexOf(conn.Capabilities.SupportedServices, (int)ServiceType.Mapping) >= 0)
+            {
+                _mappingSvc = (IMappingService)conn.GetService((int)ServiceType.Mapping);
+            }
+            lnkRefresh.Visible = this.UseLayerIconPreview;
         }
 
-		private LineFeatureStyleEditor()
-		{
-			//
-			// Required for Windows Form Designer support
-			//
-			InitializeComponent();
+        public bool UseLayerIconPreview
+        {
+            get { return _mappingSvc != null && _preview != null; }
+        }
+
+        private LineFeatureStyleEditor()
+        {
+            //
+            // Required for Windows Form Designer support
+            //
+            InitializeComponent();
             using (System.IO.StringReader sr = new System.IO.StringReader(Properties.Resources.GeometryStyleComboDataset))
                 ComboBoxDataSet.ReadXml(sr);
 
-			lineStyleEditor.displayLine.Visible = false;
+            lineStyleEditor.displayLine.Visible = false;
             lineStyleEditor.thicknessCombo.SelectedIndexChanged += new EventHandler(thicknessCombo_SelectedIndexChanged);
             lineStyleEditor.thicknessCombo.TextChanged += new EventHandler(thicknessCombo_TextChanged);
             lineStyleEditor.colorCombo.CurrentColorChanged += new EventHandler(colorCombo_CurrentValueChanged);
-			lineStyleEditor.fillCombo.SelectedIndexChanged += new EventHandler(fillCombo_SelectedIndexChanged);
-		}
+            lineStyleEditor.fillCombo.SelectedIndexChanged += new EventHandler(fillCombo_SelectedIndexChanged);
+        }
 
-		public void UpdateDisplay()
-		{
-			try
-			{
-				m_inUpdate = true;
-				applyLineStyle.Checked = (m_item != null && m_item.Count != 0);
+        public void UpdateDisplay()
+        {
+            try
+            {
+                m_inUpdate = true;
+                applyLineStyle.Checked = (m_item != null && m_item.Count != 0);
 
-				lineStyles.Items.Clear();
-				if (applyLineStyle.Checked)
+                lineStyles.Items.Clear();
+                if (applyLineStyle.Checked)
                     foreach (IStroke st in m_item)
-						lineStyles.Items.Add(st);
+                        lineStyles.Items.Add(st);
 
-				compositeLines.Checked = lineStyles.Items.Count > 1;
-				if (lineStyles.Items.Count > 0)
-					lineStyles.SelectedIndex = 0;
+                compositeLines.Checked = lineStyles.Items.Count > 1;
+                if (lineStyles.Items.Count > 0)
+                    lineStyles.SelectedIndex = 0;
 
                 if (!compositeLines.Checked)
                 {
@@ -138,33 +156,33 @@
                     }
                 }
 
-				UpdateDisplayForSelected();
+                UpdateDisplayForSelected();
 
-			}
-			finally
-			{
-				m_inUpdate = false;
-			}
+            }
+            finally
+            {
+                m_inUpdate = false;
+            }
 
-		}
+        }
 
-		private void UpdateDisplayForSelected()
-		{
-			bool prevUpdate = m_inUpdate;
-			try
-			{
-				m_inUpdate = true;
+        private void UpdateDisplayForSelected()
+        {
+            bool prevUpdate = m_inUpdate;
+            try
+            {
+                m_inUpdate = true;
                 IStroke st = this.CurrentStrokeType;
-				sizeGroup.Enabled = 
-				lineGroup.Enabled =
-				previewGroup.Enabled =
-					st != null;
+                sizeGroup.Enabled = 
+                lineGroup.Enabled =
+                previewGroup.Enabled =
+                    st != null;
 
                 RemoveStyleButton.Enabled = st != null && m_item.Count > 1;
 
-				if (st != null)
-				{
-				    sizeUnitsCombo.SelectedValue = st.Unit.ToString();
+                if (st != null)
+                {
+                    sizeUnitsCombo.SelectedValue = st.Unit.ToString();
                     
                     //sizeContextCombo.SelectedValue = st.SizeContext.ToString();
 
@@ -188,51 +206,51 @@
                         sizeContextCombo.SelectedValue = st2.SizeContext;
                     else
                         sizeContextCombo.Enabled = false;
-				}
-				previewPicture.Refresh();
-			} 
-			finally
-			{
-				m_inUpdate = prevUpdate;
-			}
+                }
+                previewPicture.Refresh();
+            } 
+            finally
+            {
+                m_inUpdate = prevUpdate;
+            }
 
-		}
+        }
 
         private IStroke CurrentStrokeType
-		{
-			get 
-			{
-				if (lineStyles.Items.Count == 0)
-					return null;
-				else if (lineStyles.Items.Count == 1 || lineStyles.SelectedIndex <= 0)
+        {
+            get 
+            {
+                if (lineStyles.Items.Count == 0)
+                    return null;
+                else if (lineStyles.Items.Count == 1 || lineStyles.SelectedIndex <= 0)
                     return (IStroke)lineStyles.Items[0];
-				else
+                else
                     return (IStroke)lineStyles.SelectedItem;
-			}
-		}
+            }
+        }
 
-		/// <summary>
-		/// Clean up any resources being used.
-		/// </summary>
-		protected override void Dispose( bool disposing )
-		{
-			if( disposing )
-			{
-				if(components != null)
-				{
-					components.Dispose();
-				}
-			}
-			base.Dispose( disposing );
-		}
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        protected override void Dispose( bool disposing )
+        {
+            if( disposing )
+            {
+                if(components != null)
+                {
+                    components.Dispose();
+                }
+            }
+            base.Dispose( disposing );
+        }
 
-		#region Windows Form Designer generated code
-		/// <summary>
-		/// Required method for Designer support - do not modify
-		/// the contents of this method with the code editor.
-		/// </summary>
-		private void InitializeComponent()
-		{
+        #region Windows Form Designer generated code
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LineFeatureStyleEditor));
             this.applyLineStyle = new System.Windows.Forms.CheckBox();
             this.compositeLines = new System.Windows.Forms.CheckBox();
@@ -258,6 +276,7 @@
             this.label3 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.previewGroup = new System.Windows.Forms.GroupBox();
+            this.lnkRefresh = new System.Windows.Forms.LinkLabel();
             this.previewPicture = new System.Windows.Forms.PictureBox();
             this.ComboBoxDataSet = new System.Data.DataSet();
             this.CompositeGroup.SuspendLayout();
@@ -440,11 +459,20 @@
             // 
             // previewGroup
             // 
+            this.previewGroup.Controls.Add(this.lnkRefresh);
             this.previewGroup.Controls.Add(this.previewPicture);
             resources.ApplyResources(this.previewGroup, "previewGroup");
             this.previewGroup.Name = "previewGroup";
             this.previewGroup.TabStop = false;
             // 
+            // lnkRefresh
+            // 
+            resources.ApplyResources(this.lnkRefresh, "lnkRefresh");
+            this.lnkRefresh.BackColor = System.Drawing.Color.Transparent;
+            this.lnkRefresh.Name = "lnkRefresh";
+            this.lnkRefresh.TabStop = true;
+            this.lnkRefresh.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkRefresh_LinkClicked);
+            // 
             // previewPicture
             // 
             resources.ApplyResources(this.previewPicture, "previewPicture");
@@ -483,23 +511,24 @@
             ((System.ComponentModel.ISupportInitialize)(this.UnitsTable)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.SizeContextTable)).EndInit();
             this.previewGroup.ResumeLayout(false);
+            this.previewGroup.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.previewPicture)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComboBoxDataSet)).EndInit();
             this.ResumeLayout(false);
 
-		}
-		#endregion
+        }
+        #endregion
 
 
-		private void lineStyles_SelectedIndexChanged(object sender, System.EventArgs e)
-		{
-			UpdateDisplayForSelected();
-		}
+        private void lineStyles_SelectedIndexChanged(object sender, System.EventArgs e)
+        {
+            UpdateDisplayForSelected();
+        }
 
-		private void sizeContextCombo_SelectedIndexChanged(object sender, System.EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void sizeContextCombo_SelectedIndexChanged(object sender, System.EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
             var st2 = this.CurrentStrokeType as IStroke2;
             if (st2 != null)
@@ -510,28 +539,28 @@
                 if (Changed != null)
                     Changed(this, new EventArgs());
             }
-		}
+        }
 
-		private void sizeUnitsCombo_SelectedIndexChanged(object sender, System.EventArgs e)
-		{
-			if (m_inUpdate || this.CurrentStrokeType == null)
-				return;
-			this.CurrentStrokeType.Unit = (LengthUnitType)Enum.Parse(typeof(LengthUnitType), (string)sizeUnitsCombo.SelectedValue);
-			previewPicture.Refresh();
-			lineStyles.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+        private void sizeUnitsCombo_SelectedIndexChanged(object sender, System.EventArgs e)
+        {
+            if (m_inUpdate || this.CurrentStrokeType == null)
+                return;
+            this.CurrentStrokeType.Unit = (LengthUnitType)Enum.Parse(typeof(LengthUnitType), (string)sizeUnitsCombo.SelectedValue);
+            previewPicture.Refresh();
+            lineStyles.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
         public IList<IStroke> Item
-		{
-			get { return m_item; }
-			set
-			{
-				m_item = value;
-				UpdateDisplay();
-			}
-		}
+        {
+            get { return m_item; }
+            set
+            {
+                m_item = value;
+                UpdateDisplay();
+            }
+        }
 
         private void thicknessCombo_TextChanged(object sender, EventArgs e)
         {
@@ -559,38 +588,38 @@
             BeginInvoke(new UpdateComboTextFromSelectChangedDelegate(UpdateComboTextFromSelectChanged), lineStyleEditor.thicknessCombo, current, expr != null);
         }
 
-		private void colorCombo_CurrentValueChanged(object sender, EventArgs e)
-		{
+        private void colorCombo_CurrentValueChanged(object sender, EventArgs e)
+        {
             if (m_inUpdate || this.CurrentStrokeType == null)
-				return;
+                return;
             this.CurrentStrokeType.Color = lineStyleEditor.colorCombo.ColorExpression;
-			previewPicture.Refresh();
-			lineStyles.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();
+            lineStyles.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void fillCombo_SelectedIndexChanged(object sender, EventArgs e)
-		{
+        private void fillCombo_SelectedIndexChanged(object sender, EventArgs e)
+        {
             if (m_inUpdate || this.CurrentStrokeType == null)
-				return;
+                return;
 
             if (lineStyleEditor.fillCombo.SelectedItem as ImageStylePicker.NamedImage != null)
                 this.CurrentStrokeType.LineStyle = (lineStyleEditor.fillCombo.SelectedItem as ImageStylePicker.NamedImage).Name;
-			previewPicture.Refresh();
-			lineStyles.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();
+            lineStyles.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void applyLineStyle_CheckedChanged(object sender, System.EventArgs e)
-		{
-			compositePanel.Enabled = 
-			compositeLines.Enabled = 
-			sizeGroup.Enabled = 
-			lineGroup.Enabled =
-			previewGroup.Enabled =
-				applyLineStyle.Checked;
+        private void applyLineStyle_CheckedChanged(object sender, System.EventArgs e)
+        {
+            compositePanel.Enabled = 
+            compositeLines.Enabled = 
+            sizeGroup.Enabled = 
+            lineGroup.Enabled =
+            previewGroup.Enabled =
+                applyLineStyle.Checked;
 
             if (!m_inUpdate)
             {
@@ -612,41 +641,63 @@
                     UpdateDisplay();
                 }
             }
-		}
+        }
 
-		private void compositeLines_CheckedChanged(object sender, System.EventArgs e)
-		{
-			if (compositePanel.Visible && !compositeLines.Checked)
-				this.AutoScrollMinSize = new Size(this.AutoScrollMinSize.Width, this.AutoScrollMinSize.Height - compositePanel.Height);
-			else if (!compositePanel.Visible && compositeLines.Checked)
+        private void compositeLines_CheckedChanged(object sender, System.EventArgs e)
+        {
+            if (compositePanel.Visible && !compositeLines.Checked)
+                this.AutoScrollMinSize = new Size(this.AutoScrollMinSize.Width, this.AutoScrollMinSize.Height - compositePanel.Height);
+            else if (!compositePanel.Visible && compositeLines.Checked)
                 this.AutoScrollMinSize = new Size(this.AutoScrollMinSize.Width, this.AutoScrollMinSize.Height + compositePanel.Height);
 
-			compositePanel.Visible = compositeLines.Checked;
+            compositePanel.Visible = compositeLines.Checked;
 
-			if (m_inUpdate)
-				return;
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            if (m_inUpdate)
+                return;
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void previewPicture_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
-		{
-			FeaturePreviewRender.RenderPreviewLine(e.Graphics, new Rectangle(1, 1, previewPicture.Width - 2, previewPicture.Height - 2), m_item);		
-		}
+        private void UpdatePreviewImage()
+        {
+            using (new WaitCursor(this))
+            {
+                m_editor.SyncSessionCopy();
+                _previewImg = _mappingSvc.GetLegendImage(_preview.Scale, _preview.LayerDefinition, _preview.ThemeCategory, 2, previewPicture.Width, previewPicture.Height, _preview.ImageFormat);
+                previewPicture.Invalidate();
+            }
+        }
 
-		private void lineStyles_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
-		{
-			e.DrawBackground();
+        private Image _previewImg = null;
+
+        private void previewPicture_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
+        {
+            if (UseLayerIconPreview)
+            {
+                if (_previewImg != null)
+                {
+                    e.Graphics.DrawImage(_previewImg, new Point(0, 0));
+                }
+            }
+            else
+            {
+                FeaturePreviewRender.RenderPreviewLine(e.Graphics, new Rectangle(1, 1, previewPicture.Width - 2, previewPicture.Height - 2), m_item);
+            }
+        }
+
+        private void lineStyles_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
+        {
+            e.DrawBackground();
             if ((e.State & DrawItemState.Focus) != 0)
                 e.DrawFocusRectangle();
             
             if (e.Index >= 0 && e.Index < lineStyles.Items.Count)
-			{
+            {
                 var col = new BindingList<IStroke>();
-				col.Add((IStroke) lineStyles.Items[e.Index]);
-				FeaturePreviewRender.RenderPreviewLine(e.Graphics, new Rectangle(e.Bounds.Left + 1, e.Bounds.Top + 1, e.Bounds.Width - 2, e.Bounds.Height - 2), col);		
-			}
-		}
+                col.Add((IStroke) lineStyles.Items[e.Index]);
+                FeaturePreviewRender.RenderPreviewLine(e.Graphics, new Rectangle(e.Bounds.Left + 1, e.Bounds.Top + 1, e.Bounds.Width - 2, e.Bounds.Height - 2), col);		
+            }
+        }
 
         private void RemoveStyleButton_Click(object sender, EventArgs e)
         {
@@ -704,5 +755,27 @@
             if (expr != null)
                 lineStyleEditor.ColorExpression = expr;
         }
+
+        private void lnkRefresh_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+        {
+            if (_editCommit != null)
+                _editCommit.Invoke();
+            UpdatePreviewImage();
+        }
+
+        private Action _editCommit;
+
+        internal void SetEditCommit(Action editCommit)
+        {
+            _editCommit = editCommit;
+        }
+
+        protected override void OnLoad(EventArgs e)
+        {
+            base.OnLoad(e);
+            if (_editCommit != null)
+                _editCommit.Invoke();
+            UpdatePreviewImage();
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.resx	2012-09-03 13:38:24 UTC (rev 6977)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.resx	2012-09-03 16:35:12 UTC (rev 6978)
@@ -112,23 +112,23 @@
     <value>2.0</value>
   </resheader>
   <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="applyLineStyle.FlatStyle" type="System.Windows.Forms.FlatStyle, System.Windows.Forms">
     <value>System</value>
   </data>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="applyLineStyle.Location" type="System.Drawing.Point, System.Drawing">
     <value>0, 0</value>
   </data>
   <data name="applyLineStyle.Size" type="System.Drawing.Size, System.Drawing">
     <value>176, 16</value>
   </data>
-  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="applyLineStyle.TabIndex" type="System.Int32, mscorlib">
     <value>0</value>
   </data>
@@ -139,7 +139,7 @@
     <value>applyLineStyle</value>
   </data>
   <data name=">>applyLineStyle.Type" xml:space="preserve">
-    <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>applyLineStyle.Parent" xml:space="preserve">
     <value>AdvancedPanel</value>
@@ -166,7 +166,7 @@
     <value>compositeLines</value>
   </data>
   <data name=">>compositeLines.Type" xml:space="preserve">
-    <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>compositeLines.Parent" xml:space="preserve">
     <value>AdvancedPanel</value>
@@ -174,7 +174,7 @@
   <data name=">>compositeLines.ZOrder" xml:space="preserve">
     <value>0</value>
   </data>
-  <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+  <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
   <data name="AddStyleButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@@ -235,7 +235,7 @@
     <value>toolStrip1</value>
   </data>
   <data name=">>toolStrip1.Type" xml:space="preserve">
-    <value>System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>toolStrip1.Parent" xml:space="preserve">
     <value>CompositeGroup</value>
@@ -259,7 +259,7 @@
     <value>lineStyles</value>
   </data>
   <data name=">>lineStyles.Type" xml:space="preserve">
-    <value>System.Windows.Forms.ListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>lineStyles.Parent" xml:space="preserve">
     <value>CompositeGroup</value>
@@ -286,7 +286,7 @@
     <value>CompositeGroup</value>
   </data>
   <data name=">>CompositeGroup.Type" xml:space="preserve">
-    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>CompositeGroup.Parent" xml:space="preserve">
     <value>compositePanel</value>
@@ -310,7 +310,7 @@
     <value>AdvancedPanel</value>
   </data>
   <data name=">>AdvancedPanel.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>AdvancedPanel.Parent" xml:space="preserve">
     <value>$this</value>
@@ -334,7 +334,7 @@
     <value>compositePanel</value>
   </data>
   <data name=">>compositePanel.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>compositePanel.Parent" xml:space="preserve">
     <value>$this</value>
@@ -342,59 +342,23 @@
   <data name=">>compositePanel.ZOrder" xml:space="preserve">
     <value>2</value>
   </data>
-  <data name=">>lineGroup.Name" xml:space="preserve">
-    <value>lineGroup</value>
+  <data name="lineStyleEditor.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
+    <value>Fill</value>
   </data>
-  <data name=">>lineGroup.Type" xml:space="preserve">
-    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  <data name="lineStyleEditor.Location" type="System.Drawing.Point, System.Drawing">
+    <value>3, 16</value>
   </data>
-  <data name=">>lineGroup.Parent" xml:space="preserve">
-    <value>propertyPanel</value>
+  <data name="lineStyleEditor.Size" type="System.Drawing.Size, System.Drawing">
+    <value>291, 133</value>
   </data>
-  <data name=">>lineGroup.ZOrder" xml:space="preserve">
+  <data name="lineStyleEditor.TabIndex" type="System.Int32, mscorlib">
     <value>0</value>
   </data>
-  <data name=">>sizeGroup.Name" xml:space="preserve">
-    <value>sizeGroup</value>
-  </data>
-  <data name=">>sizeGroup.Type" xml:space="preserve">
-    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>sizeGroup.Parent" xml:space="preserve">
-    <value>propertyPanel</value>
-  </data>
-  <data name=">>sizeGroup.ZOrder" xml:space="preserve">
-    <value>1</value>
-  </data>
-  <data name="propertyPanel.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
-    <value>Top</value>
-  </data>
-  <data name="propertyPanel.Location" type="System.Drawing.Point, System.Drawing">
-    <value>0, 208</value>
-  </data>
-  <data name="propertyPanel.Size" type="System.Drawing.Size, System.Drawing">
-    <value>297, 232</value>
-  </data>
-  <data name="propertyPanel.TabIndex" type="System.Int32, mscorlib">
-    <value>5</value>
-  </data>
-  <data name=">>propertyPanel.Name" xml:space="preserve">
-    <value>propertyPanel</value>
-  </data>
-  <data name=">>propertyPanel.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>propertyPanel.Parent" xml:space="preserve">
-    <value>$this</value>
-  </data>
-  <data name=">>propertyPanel.ZOrder" xml:space="preserve">
-    <value>1</value>
-  </data>
   <data name=">>lineStyleEditor.Name" xml:space="preserve">
     <value>lineStyleEditor</value>
   </data>
   <data name=">>lineStyleEditor.Type" xml:space="preserve">
-    <value>Maestro.Editors.LayerDefinition.Vector.StyleEditors.LineStyleEditor, Maestro.Editors, Version=4.0.0.6359, Culture=neutral, PublicKeyToken=f526c48929fda856</value>
+    <value>Maestro.Editors.LayerDefinition.Vector.StyleEditors.LineStyleEditor, Maestro.Editors, Version=5.0.0.6640, Culture=neutral, PublicKeyToken=f526c48929fda856</value>
   </data>
   <data name=">>lineStyleEditor.Parent" xml:space="preserve">
     <value>lineGroup</value>
@@ -421,7 +385,7 @@
     <value>lineGroup</value>
   </data>
   <data name=">>lineGroup.Type" xml:space="preserve">
-    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>lineGroup.Parent" xml:space="preserve">
     <value>propertyPanel</value>
@@ -429,35 +393,23 @@
   <data name=">>lineGroup.ZOrder" xml:space="preserve">
     <value>0</value>
   </data>
-  <data name="lineStyleEditor.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
-    <value>Fill</value>
+  <data name="sizeUnitsCombo.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Top, Left, Right</value>
   </data>
-  <data name="lineStyleEditor.Location" type="System.Drawing.Point, System.Drawing">
-    <value>3, 16</value>
+  <data name="sizeUnitsCombo.Location" type="System.Drawing.Point, System.Drawing">
+    <value>120, 44</value>
   </data>
-  <data name="lineStyleEditor.Size" type="System.Drawing.Size, System.Drawing">
-    <value>291, 133</value>
+  <data name="sizeUnitsCombo.Size" type="System.Drawing.Size, System.Drawing">
+    <value>169, 21</value>
   </data>
-  <data name="lineStyleEditor.TabIndex" type="System.Int32, mscorlib">
-    <value>0</value>
+  <data name="sizeUnitsCombo.TabIndex" type="System.Int32, mscorlib">
+    <value>11</value>
   </data>
-  <data name=">>lineStyleEditor.Name" xml:space="preserve">
-    <value>lineStyleEditor</value>
-  </data>
-  <data name=">>lineStyleEditor.Type" xml:space="preserve">
-    <value>Maestro.Editors.LayerDefinition.Vector.StyleEditors.LineStyleEditor, Maestro.Editors, Version=4.0.0.6359, Culture=neutral, PublicKeyToken=f526c48929fda856</value>
-  </data>
-  <data name=">>lineStyleEditor.Parent" xml:space="preserve">
-    <value>lineGroup</value>
-  </data>
-  <data name=">>lineStyleEditor.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
   <data name=">>sizeUnitsCombo.Name" xml:space="preserve">
     <value>sizeUnitsCombo</value>
   </data>
   <data name=">>sizeUnitsCombo.Type" xml:space="preserve">
-    <value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>sizeUnitsCombo.Parent" xml:space="preserve">
     <value>sizeGroup</value>
@@ -465,11 +417,23 @@
   <data name=">>sizeUnitsCombo.ZOrder" xml:space="preserve">
     <value>0</value>
   </data>
+  <data name="sizeContextCombo.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Top, Left, Right</value>
+  </data>
+  <data name="sizeContextCombo.Location" type="System.Drawing.Point, System.Drawing">
+    <value>120, 12</value>
+  </data>
+  <data name="sizeContextCombo.Size" type="System.Drawing.Size, System.Drawing">
+    <value>169, 21</value>
+  </data>
+  <data name="sizeContextCombo.TabIndex" type="System.Int32, mscorlib">
+    <value>10</value>
+  </data>
   <data name=">>sizeContextCombo.Name" xml:space="preserve">
     <value>sizeContextCombo</value>
   </data>
   <data name=">>sizeContextCombo.Type" xml:space="preserve">
-    <value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>sizeContextCombo.Parent" xml:space="preserve">
     <value>sizeGroup</value>
@@ -477,11 +441,26 @@
   <data name=">>sizeContextCombo.ZOrder" xml:space="preserve">
     <value>1</value>
   </data>
+  <data name="label3.AutoSize" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
+  <data name="label3.Location" type="System.Drawing.Point, System.Drawing">
+    <value>8, 52</value>
+  </data>
+  <data name="label3.Size" type="System.Drawing.Size, System.Drawing">
+    <value>52, 13</value>
+  </data>
+  <data name="label3.TabIndex" type="System.Int32, mscorlib">
+    <value>9</value>
+  </data>
+  <data name="label3.Text" xml:space="preserve">
+    <value>Size units</value>
+  </data>
   <data name=">>label3.Name" xml:space="preserve">
     <value>label3</value>
   </data>
   <data name=">>label3.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>label3.Parent" xml:space="preserve">
     <value>sizeGroup</value>
@@ -489,11 +468,26 @@
   <data name=">>label3.ZOrder" xml:space="preserve">
     <value>2</value>
   </data>
+  <data name="label2.AutoSize" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
+  <data name="label2.Location" type="System.Drawing.Point, System.Drawing">
+    <value>8, 20</value>
+  </data>
+  <data name="label2.Size" type="System.Drawing.Size, System.Drawing">
+    <value>65, 13</value>
+  </data>
+  <data name="label2.TabIndex" type="System.Int32, mscorlib">
+    <value>8</value>
+  </data>
+  <data name="label2.Text" xml:space="preserve">
+    <value>Size context</value>
+  </data>
   <data name=">>label2.Name" xml:space="preserve">
     <value>label2</value>
   </data>
   <data name=">>label2.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>label2.Parent" xml:space="preserve">
     <value>sizeGroup</value>
@@ -520,7 +514,7 @@
     <value>sizeGroup</value>
   </data>
   <data name=">>sizeGroup.Type" xml:space="preserve">
-    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>sizeGroup.Parent" xml:space="preserve">
     <value>propertyPanel</value>
@@ -528,119 +522,86 @@
   <data name=">>sizeGroup.ZOrder" xml:space="preserve">
     <value>1</value>
   </data>
-  <data name="sizeUnitsCombo.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
-    <value>Top, Left, Right</value>
+  <data name="propertyPanel.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
+    <value>Top</value>
   </data>
-  <data name="sizeUnitsCombo.Location" type="System.Drawing.Point, System.Drawing">
-    <value>120, 44</value>
+  <data name="propertyPanel.Location" type="System.Drawing.Point, System.Drawing">
+    <value>0, 208</value>
   </data>
-  <data name="sizeUnitsCombo.Size" type="System.Drawing.Size, System.Drawing">
-    <value>169, 21</value>
+  <data name="propertyPanel.Size" type="System.Drawing.Size, System.Drawing">
+    <value>297, 232</value>
   </data>
-  <data name="sizeUnitsCombo.TabIndex" type="System.Int32, mscorlib">
-    <value>11</value>
+  <data name="propertyPanel.TabIndex" type="System.Int32, mscorlib">
+    <value>5</value>
   </data>
-  <data name=">>sizeUnitsCombo.Name" xml:space="preserve">
-    <value>sizeUnitsCombo</value>
+  <data name=">>propertyPanel.Name" xml:space="preserve">
+    <value>propertyPanel</value>
   </data>
-  <data name=">>sizeUnitsCombo.Type" xml:space="preserve">
-    <value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  <data name=">>propertyPanel.Type" xml:space="preserve">
+    <value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
-  <data name=">>sizeUnitsCombo.Parent" xml:space="preserve">
-    <value>sizeGroup</value>
+  <data name=">>propertyPanel.Parent" xml:space="preserve">
+    <value>$this</value>
   </data>
-  <data name=">>sizeUnitsCombo.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
-  <data name="sizeContextCombo.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
-    <value>Top, Left, Right</value>
-  </data>
-  <data name="sizeContextCombo.Location" type="System.Drawing.Point, System.Drawing">
-    <value>120, 12</value>
-  </data>
-  <data name="sizeContextCombo.Size" type="System.Drawing.Size, System.Drawing">
-    <value>169, 21</value>
-  </data>
-  <data name="sizeContextCombo.TabIndex" type="System.Int32, mscorlib">
-    <value>10</value>
-  </data>
-  <data name=">>sizeContextCombo.Name" xml:space="preserve">
-    <value>sizeContextCombo</value>
-  </data>
-  <data name=">>sizeContextCombo.Type" xml:space="preserve">
-    <value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>sizeContextCombo.Parent" xml:space="preserve">
-    <value>sizeGroup</value>
-  </data>
-  <data name=">>sizeContextCombo.ZOrder" xml:space="preserve">
+  <data name=">>propertyPanel.ZOrder" xml:space="preserve">
     <value>1</value>
   </data>
-  <data name="label3.AutoSize" type="System.Boolean, mscorlib">
+  <data name="lnkRefresh.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
   </data>
-  <data name="label3.Location" type="System.Drawing.Point, System.Drawing">
-    <value>8, 52</value>
+  <data name="lnkRefresh.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
+    <value>NoControl</value>
   </data>
-  <data name="label3.Size" type="System.Drawing.Size, System.Drawing">
-    <value>52, 13</value>
+  <data name="lnkRefresh.Location" type="System.Drawing.Point, System.Drawing">
+    <value>54, 0</value>
   </data>
-  <data name="label3.TabIndex" type="System.Int32, mscorlib">
-    <value>9</value>
+  <data name="lnkRefresh.Size" type="System.Drawing.Size, System.Drawing">
+    <value>50, 13</value>
   </data>
-  <data name="label3.Text" xml:space="preserve">
-    <value>Size units</value>
-  </data>
-  <data name=">>label3.Name" xml:space="preserve">
-    <value>label3</value>
-  </data>
-  <data name=">>label3.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>label3.Parent" xml:space="preserve">
-    <value>sizeGroup</value>
-  </data>
-  <data name=">>label3.ZOrder" xml:space="preserve">
+  <data name="lnkRefresh.TabIndex" type="System.Int32, mscorlib">
     <value>2</value>
   </data>
-  <data name="label2.AutoSize" type="System.Boolean, mscorlib">
-    <value>True</value>
+  <data name="lnkRefresh.Text" xml:space="preserve">
+    <value>(Refresh)</value>
   </data>
-  <data name="label2.Location" type="System.Drawing.Point, System.Drawing">
-    <value>8, 20</value>
+  <data name="lnkRefresh.Visible" type="System.Boolean, mscorlib">
+    <value>False</value>
   </data>
-  <data name="label2.Size" type="System.Drawing.Size, System.Drawing">
-    <value>65, 13</value>
+  <data name=">>lnkRefresh.Name" xml:space="preserve">
+    <value>lnkRefresh</value>
   </data>
-  <data name="label2.TabIndex" type="System.Int32, mscorlib">
-    <value>8</value>
+  <data name=">>lnkRefresh.Type" xml:space="preserve">
+    <value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
-  <data name="label2.Text" xml:space="preserve">
-    <value>Size context</value>
+  <data name=">>lnkRefresh.Parent" xml:space="preserve">
+    <value>previewGroup</value>
   </data>
-  <data name=">>label2.Name" xml:space="preserve">
-    <value>label2</value>
+  <data name=">>lnkRefresh.ZOrder" xml:space="preserve">
+    <value>0</value>
   </data>
-  <data name=">>label2.Type" xml:space="preserve">
-    <value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  <data name="previewPicture.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Top, Left, Right</value>
   </data>
-  <data name=">>label2.Parent" xml:space="preserve">
-    <value>sizeGroup</value>
+  <data name="previewPicture.Location" type="System.Drawing.Point, System.Drawing">
+    <value>8, 16</value>
   </data>
-  <data name=">>label2.ZOrder" xml:space="preserve">
-    <value>3</value>
+  <data name="previewPicture.Size" type="System.Drawing.Size, System.Drawing">
+    <value>281, 24</value>
   </data>
+  <data name="previewPicture.TabIndex" type="System.Int32, mscorlib">
+    <value>0</value>
+  </data>
   <data name=">>previewPicture.Name" xml:space="preserve">
     <value>previewPicture</value>
   </data>
   <data name=">>previewPicture.Type" xml:space="preserve">
-    <value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>previewPicture.Parent" xml:space="preserve">
     <value>previewGroup</value>
   </data>
   <data name=">>previewPicture.ZOrder" xml:space="preserve">
-    <value>0</value>
+    <value>1</value>
   </data>
   <data name="previewGroup.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
     <value>Top</value>
@@ -664,7 +625,7 @@
     <value>previewGroup</value>
   </data>
   <data name=">>previewGroup.Type" xml:space="preserve">
-    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>previewGroup.Parent" xml:space="preserve">
     <value>$this</value>
@@ -672,34 +633,10 @@
   <data name=">>previewGroup.ZOrder" xml:space="preserve">
     <value>0</value>
   </data>
-  <data name="previewPicture.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
-    <value>Top, Left, Right</value>
-  </data>
-  <data name="previewPicture.Location" type="System.Drawing.Point, System.Drawing">
-    <value>8, 16</value>
-  </data>
-  <data name="previewPicture.Size" type="System.Drawing.Size, System.Drawing">
-    <value>281, 24</value>
-  </data>
-  <data name="previewPicture.TabIndex" type="System.Int32, mscorlib">
-    <value>0</value>
-  </data>
-  <data name=">>previewPicture.Name" xml:space="preserve">
-    <value>previewPicture</value>
-  </data>
-  <data name=">>previewPicture.Type" xml:space="preserve">
-    <value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>previewPicture.Parent" xml:space="preserve">
-    <value>previewGroup</value>
-  </data>
-  <data name=">>previewPicture.ZOrder" xml:space="preserve">
-    <value>0</value>
-  </data>
-  <metadata name="ComboBoxDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+  <metadata name="ComboBoxDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>122, 17</value>
   </metadata>
-  <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <data name="$this.AutoScroll" type="System.Boolean, mscorlib">
@@ -715,60 +652,60 @@
     <value>AddStyleButton</value>
   </data>
   <data name=">>AddStyleButton.Type" xml:space="preserve">
-    <value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>RemoveStyleButton.Name" xml:space="preserve">
     <value>RemoveStyleButton</value>
   </data>
   <data name=">>RemoveStyleButton.Type" xml:space="preserve">
-    <value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>UnitsTable.Name" xml:space="preserve">
     <value>UnitsTable</value>
   </data>
   <data name=">>UnitsTable.Type" xml:space="preserve">
-    <value>System.Data.DataTable, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Data.DataTable, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>dataColumn5.Name" xml:space="preserve">
     <value>dataColumn5</value>
   </data>
   <data name=">>dataColumn5.Type" xml:space="preserve">
-    <value>System.Data.DataColumn, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Data.DataColumn, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>dataColumn6.Name" xml:space="preserve">
     <value>dataColumn6</value>
   </data>
   <data name=">>dataColumn6.Type" xml:space="preserve">
-    <value>System.Data.DataColumn, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Data.DataColumn, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>SizeContextTable.Name" xml:space="preserve">
     <value>SizeContextTable</value>
   </data>
   <data name=">>SizeContextTable.Type" xml:space="preserve">
-    <value>System.Data.DataTable, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Data.DataTable, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>dataColumn3.Name" xml:space="preserve">
     <value>dataColumn3</value>
   </data>
   <data name=">>dataColumn3.Type" xml:space="preserve">
-    <value>System.Data.DataColumn, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Data.DataColumn, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>dataColumn4.Name" xml:space="preserve">
     <value>dataColumn4</value>
   </data>
   <data name=">>dataColumn4.Type" xml:space="preserve">
-    <value>System.Data.DataColumn, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Data.DataColumn, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>ComboBoxDataSet.Name" xml:space="preserve">
     <value>ComboBoxDataSet</value>
   </data>
   <data name=">>ComboBoxDataSet.Type" xml:space="preserve">
-    <value>System.Data.DataSet, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Data.DataSet, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>$this.Name" xml:space="preserve">
     <value>LineFeatureStyleEditor</value>
   </data>
   <data name=">>$this.Type" xml:space="preserve">
-    <value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs	2012-09-03 13:38:24 UTC (rev 6977)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs	2012-09-03 16:35:12 UTC (rev 6978)
@@ -31,74 +31,76 @@
 using OSGeo.MapGuide.ObjectModels;
 using OSGeo.MapGuide.ObjectModels.FeatureSource;
 using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+using OSGeo.MapGuide.MaestroAPI.Services;
+using Maestro.Shared.UI;
 
 namespace Maestro.Editors.LayerDefinition.Vector.StyleEditors
 {
-	/// <summary>
-	/// Summary description for PointFeatureStyleEditor.
-	/// </summary>
+    /// <summary>
+    /// Summary description for PointFeatureStyleEditor.
+    /// </summary>
     [ToolboxItem(false)]
-	internal class PointFeatureStyleEditor : System.Windows.Forms.UserControl
-	{
-		private System.Windows.Forms.GroupBox groupBox1;
-		private System.Windows.Forms.Label label1;
-		private System.Windows.Forms.Label label2;
-		private System.Windows.Forms.Label label3;
-		private System.Windows.Forms.Label label4;
-		private System.Windows.Forms.Label label5;
-		private System.Windows.Forms.GroupBox grpSymbolFill;
-		private System.Windows.Forms.GroupBox grpSymbolBorder;
-		private System.Windows.Forms.GroupBox groupBox4;
-		private System.Windows.Forms.PictureBox previewPicture;
-		private System.Data.DataSet ComboBoxDataSet;
-		private System.Data.DataTable SymbolMarkTable;
-		private System.Data.DataColumn dataColumn1;
-		private System.Data.DataColumn dataColumn2;
-		private System.Data.DataTable SizeContextTable;
-		private System.Data.DataColumn dataColumn3;
-		private System.Data.DataColumn dataColumn4;
-		private System.Data.DataTable UnitsTable;
-		private System.Data.DataColumn dataColumn5;
-		private System.Data.DataColumn dataColumn6;
-		private System.Data.DataTable RotationTable;
-		private System.Data.DataColumn dataColumn7;
-		private System.Data.DataColumn dataColumn8;
-		/// <summary>
-		/// Required designer variable.
-		/// </summary>
-		private System.ComponentModel.Container components = null;
-		private System.Windows.Forms.ComboBox HeightText;
-		private System.Windows.Forms.ComboBox WidthText;
-		private System.Windows.Forms.ComboBox SizeUnits;
-		private System.Windows.Forms.ComboBox SizeContext;
-		private System.Windows.Forms.ComboBox Symbol;
-		private LineStyleEditor lineStyleEditor;
+    internal class PointFeatureStyleEditor : System.Windows.Forms.UserControl
+    {
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.GroupBox grpSymbolFill;
+        private System.Windows.Forms.GroupBox grpSymbolBorder;
+        private System.Windows.Forms.GroupBox groupBox4;
+        private System.Windows.Forms.PictureBox previewPicture;
+        private System.Data.DataSet ComboBoxDataSet;
+        private System.Data.DataTable SymbolMarkTable;
+        private System.Data.DataColumn dataColumn1;
+        private System.Data.DataColumn dataColumn2;
+        private System.Data.DataTable SizeContextTable;
+        private System.Data.DataColumn dataColumn3;
+        private System.Data.DataColumn dataColumn4;
+        private System.Data.DataTable UnitsTable;
+        private System.Data.DataColumn dataColumn5;
+        private System.Data.DataColumn dataColumn6;
+        private System.Data.DataTable RotationTable;
+        private System.Data.DataColumn dataColumn7;
+        private System.Data.DataColumn dataColumn8;
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.Container components = null;
+        private System.Windows.Forms.ComboBox HeightText;
+        private System.Windows.Forms.ComboBox WidthText;
+        private System.Windows.Forms.ComboBox SizeUnits;
+        private System.Windows.Forms.ComboBox SizeContext;
+        private System.Windows.Forms.ComboBox Symbol;
+        private LineStyleEditor lineStyleEditor;
 
-		private IPointSymbolization2D m_item;
+        private IPointSymbolization2D m_item;
         private IMarkSymbol m_lastMark = null;
         private IFontSymbol m_lastFont = null;
 
-		private bool m_inUpdate = false;
+        private bool m_inUpdate = false;
 
-		private IFill previousFill = null;
+        private IFill previousFill = null;
         private CheckBox DisplayPoints;
-		private IStroke previousEdge = null;
-		private GroupBox groupBoxFont;
-		private ComboBox fontCombo;
-		private Label label10;
-		private ComboBox comboBoxCharacter;
-		private GroupBox groupBoxSymbolLocation;
-		private Button button1;
-		private TextBox ReferenceY;
-		private Label label8;
-		private TextBox ReferenceX;
-		private Label label7;
-		private Label label6;
-		private CheckBox MaintainAspectRatio;
-		private ComboBox RotationBox;
-		private Label label9;
+        private IStroke previousEdge = null;
+        private GroupBox groupBoxFont;
+        private ComboBox fontCombo;
+        private Label label10;
+        private ComboBox comboBoxCharacter;
+        private GroupBox groupBoxSymbolLocation;
+        private Button button1;
+        private TextBox ReferenceY;
+        private Label label8;
+        private TextBox ReferenceX;
+        private Label label7;
+        private Label label6;
+        private CheckBox MaintainAspectRatio;
+        private ComboBox RotationBox;
+        private Label label9;
         private FillStyleEditor fillStyleEditor;
-		private Label lblForeground;
+        private Label lblForeground;
         private Panel panel1;
         private ToolStrip toolStrip1;
         private ToolStripButton FontBoldButton;
@@ -124,8 +126,12 @@
         private TabPage TAB_STYLE;
         private TabPage TAB_FILL_BORDER;
         private ILayerElementFactory _factory;
+        private IMappingService _mappingSvc;
+        private LinkLabel lnkRefresh;
 
-        public PointFeatureStyleEditor(IEditorService editor, ClassDefinition schema, string featureSource)
+        private ILayerStylePreviewable _preview;
+
+        internal PointFeatureStyleEditor(IEditorService editor, ClassDefinition schema, string featureSource, ILayerStylePreviewable prev)
             : this()
         {
             m_editor = editor;
@@ -138,44 +144,60 @@
             m_featureSource = featureSource;
 
             m_item = _factory.CreateDefaultPointSymbolization2D();
+
+            _preview = prev;
+            var conn = editor.GetEditedResource().CurrentConnection;
+            if (Array.IndexOf(conn.Capabilities.SupportedServices, (int)ServiceType.Mapping) >= 0)
+            {
+                _mappingSvc = (IMappingService)conn.GetService((int)ServiceType.Mapping);
+            }
+            lnkRefresh.Visible = this.UseLayerIconPreview;
         }
 
-        public PointFeatureStyleEditor(IEditorService editor, ClassDefinition schema, string featureSource, Image currentW2D)
-            : this(editor, schema, featureSource)
+        public bool UseLayerIconPreview
         {
+            get
+            {
+                return _mappingSvc != null && _preview != null; 
+            }
+        }
+
+        internal PointFeatureStyleEditor(IEditorService editor, ClassDefinition schema, string featureSource, Image currentW2D, ILayerStylePreviewable prev)
+            : this(editor, schema, featureSource, prev)
+        {
             grpW2DStyle.Tag = currentW2D;
         }
 
-		private PointFeatureStyleEditor()
-		{
-			//
-			// Required for Windows Form Designer support
-			//
-			InitializeComponent();
+        private PointFeatureStyleEditor()
+        {
+            //
+            // Required for Windows Form Designer support
+            //
+            InitializeComponent();
             //this.AutoScroll = false;
             using(System.IO.StringReader sr = new System.IO.StringReader(Properties.Resources.GeometryStyleComboDataset))
-				ComboBoxDataSet.ReadXml(sr);
+                ComboBoxDataSet.ReadXml(sr);
 
-			fontCombo.Items.Clear();
+            fontCombo.Items.Clear();
             foreach (FontFamily f in new System.Drawing.Text.InstalledFontCollection().Families)
                 fontCombo.Items.Add(f.Name);
 
-			colorFontForeground.CurrentColorChanged += new EventHandler(colourFontForeground_CurrentColorChanged);
+            colorFontForeground.CurrentColorChanged += new EventHandler(colourFontForeground_CurrentColorChanged);
 
-			fillStyleEditor.displayFill.CheckedChanged += new EventHandler(displayFill_CheckedChanged);
-			fillStyleEditor.fillCombo.SelectedIndexChanged += new EventHandler(fillCombo_SelectedIndexChanged);
-			fillStyleEditor.foregroundColor.CurrentColorChanged += new EventHandler(foregroundColor_CurrentColorChanged);
-			fillStyleEditor.backgroundColor.CurrentColorChanged +=new EventHandler(backgroundColor_CurrentColorChanged);
+            fillStyleEditor.displayFill.CheckedChanged += new EventHandler(displayFill_CheckedChanged);
+            fillStyleEditor.fillCombo.SelectedIndexChanged += new EventHandler(fillCombo_SelectedIndexChanged);
+            fillStyleEditor.foregroundColor.CurrentColorChanged += new EventHandler(foregroundColor_CurrentColorChanged);
+            fillStyleEditor.backgroundColor.CurrentColorChanged +=new EventHandler(backgroundColor_CurrentColorChanged);
 
-			lineStyleEditor.displayLine.CheckedChanged +=new EventHandler(displayLine_CheckedChanged);
-			lineStyleEditor.thicknessCombo.SelectedIndexChanged += new EventHandler(thicknessCombo_SelectedIndexChanged);
+            lineStyleEditor.displayLine.CheckedChanged +=new EventHandler(displayLine_CheckedChanged);
+            lineStyleEditor.thicknessCombo.SelectedIndexChanged += new EventHandler(thicknessCombo_SelectedIndexChanged);
             lineStyleEditor.thicknessCombo.TextChanged += new EventHandler(thicknessCombo_TextChanged);
-			lineStyleEditor.colorCombo.CurrentColorChanged +=new EventHandler(colorCombo_CurrentColorChanged);
-			lineStyleEditor.fillCombo.SelectedIndexChanged +=new EventHandler(fillCombo_Line_SelectedIndexChanged);
-		}
+            lineStyleEditor.colorCombo.CurrentColorChanged +=new EventHandler(colorCombo_CurrentColorChanged);
+            lineStyleEditor.fillCombo.SelectedIndexChanged +=new EventHandler(fillCombo_Line_SelectedIndexChanged);
+        }
 
-		private void setUIForMarkSymbol(bool isMark)
-		{
+        private void setUIForMarkSymbol(bool isMark)
+        {
             groupBoxSymbolLocation.Enabled = isMark;
             grpSymbolFill.Enabled = isMark;
             grpSymbolBorder.Enabled = isMark;
@@ -189,16 +211,16 @@
                 groupBoxFont.Enabled = (m_item.Symbol.Type == PointSymbolType.Font);
                 grpW2DStyle.Enabled = (m_item.Symbol.Type == PointSymbolType.W2D);
             }
-		}
+        }
 
-		private void UpdateDisplay()
-		{
-			if (m_inUpdate)
-				return;
+        private void UpdateDisplay()
+        {
+            if (m_inUpdate)
+                return;
 
-			try
-			{
-				m_inUpdate = true;
+            try
+            {
+                m_inUpdate = true;
 
                 if (m_item == null)
                 {
@@ -211,7 +233,7 @@
                 if (m_item.Symbol == null)
                     m_item.Symbol = _factory.CreateDefaultMarkSymbol();
 
-				// shared values
+                // shared values
                 WidthText.Text = m_item.Symbol.SizeX;
                 HeightText.Text = m_item.Symbol.SizeY;
                 RotationBox.SelectedIndex = -1;
@@ -220,11 +242,11 @@
                 SizeUnits.SelectedValue = m_item.Symbol.Unit;
                 SizeContext.SelectedValue = m_item.Symbol.SizeContext.ToString();
 
-				// specifics
-				if (m_item.Symbol.Type == PointSymbolType.Mark)
-				{
+                // specifics
+                if (m_item.Symbol.Type == PointSymbolType.Mark)
+                {
                     MaintainAspectRatio.Checked = m_item.Symbol.MaintainAspect;
-					double d;
+                    double d;
                     if (double.TryParse(m_item.Symbol.InsertionPointX, NumberStyles.Float, CultureInfo.InvariantCulture, out d))
                         ReferenceX.Text = d.ToString(System.Threading.Thread.CurrentThread.CurrentUICulture);
                     else
@@ -236,37 +258,37 @@
                         ReferenceY.Text = m_item.Symbol.InsertionPointY;
 
                     IMarkSymbol t = (IMarkSymbol)m_item.Symbol;
-					Symbol.SelectedValue = t.Shape.ToString();
+                    Symbol.SelectedValue = t.Shape.ToString();
 
-					fillStyleEditor.displayFill.Checked = t.Fill != null;
-					if (t.Fill != null)
-					{
+                    fillStyleEditor.displayFill.Checked = t.Fill != null;
+                    if (t.Fill != null)
+                    {
                         fillStyleEditor.foregroundColor.ColorExpression = t.Fill.ForegroundColor;
                         fillStyleEditor.backgroundColor.ColorExpression = t.Fill.BackgroundColor;
-						fillStyleEditor.fillCombo.SelectedValue = t.Fill.FillPattern;
-						if (fillStyleEditor.fillCombo.SelectedItem == null && fillStyleEditor.fillCombo.Items.Count > 0)
-							fillStyleEditor.fillCombo.SelectedIndex = fillStyleEditor.fillCombo.FindString(t.Fill.FillPattern);
-					}
+                        fillStyleEditor.fillCombo.SelectedValue = t.Fill.FillPattern;
+                        if (fillStyleEditor.fillCombo.SelectedItem == null && fillStyleEditor.fillCombo.Items.Count > 0)
+                            fillStyleEditor.fillCombo.SelectedIndex = fillStyleEditor.fillCombo.FindString(t.Fill.FillPattern);
+                    }
 
-					lineStyleEditor.displayLine.Checked = t.Edge != null;
-					if (t.Edge != null)
-					{
-						lineStyleEditor.fillCombo.SelectedValue = t.Edge.LineStyle;
-						if (lineStyleEditor.fillCombo.SelectedItem == null && lineStyleEditor.fillCombo.Items.Count > 0)
-							lineStyleEditor.fillCombo.SelectedIndex = lineStyleEditor.fillCombo.FindString(t.Edge.LineStyle);
+                    lineStyleEditor.displayLine.Checked = t.Edge != null;
+                    if (t.Edge != null)
+                    {
+                        lineStyleEditor.fillCombo.SelectedValue = t.Edge.LineStyle;
+                        if (lineStyleEditor.fillCombo.SelectedItem == null && lineStyleEditor.fillCombo.Items.Count > 0)
+                            lineStyleEditor.fillCombo.SelectedIndex = lineStyleEditor.fillCombo.FindString(t.Edge.LineStyle);
 
                         lineStyleEditor.colorCombo.ColorExpression = t.Edge.Color;
-						lineStyleEditor.thicknessCombo.Text = t.Edge.Thickness;
-					}
+                        lineStyleEditor.thicknessCombo.Text = t.Edge.Thickness;
+                    }
 
-					setUIForMarkSymbol(true);
-				}
-				else if (m_item.Symbol.Type == PointSymbolType.Font)
-				{
-					IFontSymbol f = (IFontSymbol)m_item.Symbol;
+                    setUIForMarkSymbol(true);
+                }
+                else if (m_item.Symbol.Type == PointSymbolType.Font)
+                {
+                    IFontSymbol f = (IFontSymbol)m_item.Symbol;
 
-					// TODO: Dislike this hard coding, but with association from 'Shape' the 'Font...' string cannot be found or set from the Symbol combobox
-					Symbol.SelectedIndex = 6; //Font
+                    // TODO: Dislike this hard coding, but with association from 'Shape' the 'Font...' string cannot be found or set from the Symbol combobox
+                    Symbol.SelectedIndex = 6; //Font
 
                     fontCombo.SelectedIndex = fontCombo.FindString(f.FontName);
                     if (string.Compare(fontCombo.Text, f.FontName, true) == 0)
@@ -285,8 +307,8 @@
                     else
                         colorFontForeground.CurrentColor = Utility.ParseHTMLColor(f.ForegroundColor);
 
-					setUIForMarkSymbol(false);
-				}
+                    setUIForMarkSymbol(false);
+                }
                 else if (m_item.Symbol.Type == PointSymbolType.W2D)
                 {
                     // TODO: Dislike this hard coding, but with association from 'Shape' the 'Font...' string cannot be found or set from the Symbol combobox
@@ -312,37 +334,37 @@
                     //TODO: Fix this
                     MessageBox.Show(this, Properties.Resources.SymbolTypeNotSupported, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
 
-				previewPicture.Refresh();
-			} 
-			finally
-			{
-				m_inUpdate = false;
-			}
-		}
+                previewPicture.Refresh();
+            } 
+            finally
+            {
+                m_inUpdate = false;
+            }
+        }
 
-		/// <summary>
-		/// Clean up any resources being used.
-		/// </summary>
-		protected override void Dispose( bool disposing )
-		{
-			if( disposing )
-			{
-				if(components != null)
-				{
-					components.Dispose();
-				}
-			}
-			base.Dispose( disposing );
-		}
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        protected override void Dispose( bool disposing )
+        {
+            if( disposing )
+            {
+                if(components != null)
+                {
+                    components.Dispose();
+                }
+            }
+            base.Dispose( disposing );
+        }
 
 
-		#region Windows Form Designer generated code
-		/// <summary>
-		/// Required method for Designer support - do not modify
-		/// the contents of this method with the code editor.
-		/// </summary>
-		private void InitializeComponent()
-		{
+        #region Windows Form Designer generated code
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PointFeatureStyleEditor));
             this.groupBox1 = new System.Windows.Forms.GroupBox();
             this.RotationBox = new System.Windows.Forms.ComboBox();
@@ -374,6 +396,7 @@
             this.grpSymbolBorder = new System.Windows.Forms.GroupBox();
             this.lineStyleEditor = new Maestro.Editors.LayerDefinition.Vector.StyleEditors.LineStyleEditor();
             this.groupBox4 = new System.Windows.Forms.GroupBox();
+            this.lnkRefresh = new System.Windows.Forms.LinkLabel();
             this.previewPicture = new System.Windows.Forms.PictureBox();
             this.ComboBoxDataSet = new System.Data.DataSet();
             this.DisplayPoints = new System.Windows.Forms.CheckBox();
@@ -632,10 +655,19 @@
             // groupBox4
             // 
             resources.ApplyResources(this.groupBox4, "groupBox4");
+            this.groupBox4.Controls.Add(this.lnkRefresh);
             this.groupBox4.Controls.Add(this.previewPicture);
             this.groupBox4.Name = "groupBox4";
             this.groupBox4.TabStop = false;
             // 
+            // lnkRefresh
+            // 
+            resources.ApplyResources(this.lnkRefresh, "lnkRefresh");
+            this.lnkRefresh.BackColor = System.Drawing.Color.Transparent;
+            this.lnkRefresh.Name = "lnkRefresh";
+            this.lnkRefresh.TabStop = true;
+            this.lnkRefresh.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkRefresh_LinkClicked);
+            // 
             // previewPicture
             // 
             resources.ApplyResources(this.previewPicture, "previewPicture");
@@ -901,6 +933,7 @@
             this.grpSymbolFill.ResumeLayout(false);
             this.grpSymbolBorder.ResumeLayout(false);
             this.groupBox4.ResumeLayout(false);
+            this.groupBox4.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.previewPicture)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComboBoxDataSet)).EndInit();
             this.groupBoxFont.ResumeLayout(false);
@@ -919,40 +952,63 @@
             this.ResumeLayout(false);
             this.PerformLayout();
 
-		}
-		#endregion
+        }
+        #endregion
 
-		private void PointFeatureStyleEditor_Load(object sender, System.EventArgs e)
-		{
-			UpdateDisplay();
-		}
+        private void PointFeatureStyleEditor_Load(object sender, System.EventArgs e)
+        {
+            UpdateDisplay();
+        }
 
-		private void previewPicture_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
-		{
-            e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
-            if (m_item != null && m_item.Symbol.Type == PointSymbolType.Mark)
-                FeaturePreviewRender.RenderPreviewPoint(e.Graphics, new Rectangle(1, 1, previewPicture.Width - 2, previewPicture.Height - 2), (IMarkSymbol)m_item.Symbol);
-            else if (m_item != null && m_item.Symbol.Type == PointSymbolType.Font)
-                FeaturePreviewRender.RenderPreviewFontSymbol(e.Graphics, new Rectangle(1, 1, previewPicture.Width - 2, previewPicture.Height - 2), (IFontSymbol)m_item.Symbol);
-            else if (m_item != null && m_item.Symbol.Type == PointSymbolType.W2D)
-                FeaturePreviewRender.RenderW2DImage(e.Graphics, new Rectangle(1, 1, previewPicture.Width - 2, previewPicture.Height - 2), (IW2DSymbol)m_item.Symbol, grpW2DStyle.Tag as Image);
+        private void UpdatePreviewImage()
+        {
+            using (new WaitCursor(this))
+            {
+                UpdateDisplay();
+                m_editor.SyncSessionCopy();
+                _previewImg = _mappingSvc.GetLegendImage(_preview.Scale, _preview.LayerDefinition, _preview.ThemeCategory, 1, previewPicture.Width, previewPicture.Height, _preview.ImageFormat);
+                previewPicture.Invalidate();
+            }
+        }
+
+        private Image _previewImg = null;
+
+        private void previewPicture_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
+        {
+            if (UseLayerIconPreview && !(m_item != null && m_item.Symbol.Type == PointSymbolType.Font))
+            {
+                if (_previewImg != null)
+                {
+                    e.Graphics.DrawImage(_previewImg, new Point(0, 0));
+                }
+            }
             else
-                FeaturePreviewRender.RenderPreviewPoint(e.Graphics, new Rectangle(1, 1, previewPicture.Width - 2, previewPicture.Height - 2), null);
-		}
+            {
+                e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
+                if (m_item != null && m_item.Symbol.Type == PointSymbolType.Mark)
+                    FeaturePreviewRender.RenderPreviewPoint(e.Graphics, new Rectangle(1, 1, previewPicture.Width - 2, previewPicture.Height - 2), (IMarkSymbol)m_item.Symbol);
+                else if (m_item != null && m_item.Symbol.Type == PointSymbolType.Font)
+                    FeaturePreviewRender.RenderPreviewFontSymbol(e.Graphics, new Rectangle(1, 1, previewPicture.Width - 2, previewPicture.Height - 2), (IFontSymbol)m_item.Symbol);
+                else if (m_item != null && m_item.Symbol.Type == PointSymbolType.W2D)
+                    FeaturePreviewRender.RenderW2DImage(e.Graphics, new Rectangle(1, 1, previewPicture.Width - 2, previewPicture.Height - 2), (IW2DSymbol)m_item.Symbol, grpW2DStyle.Tag as Image);
+                else
+                    FeaturePreviewRender.RenderPreviewPoint(e.Graphics, new Rectangle(1, 1, previewPicture.Width - 2, previewPicture.Height - 2), null);
+            }
+        }
 
         private IW2DSymbol m_lastSymbol;
 
         internal Image W2DSymbolPreviewImage { get { return grpW2DStyle.Tag as Image; } }
 
-		private void Symbol_SelectedIndexChanged(object sender, System.EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void Symbol_SelectedIndexChanged(object sender, System.EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
             bool isSymbol = false;
             ShapeType selectedShape = ShapeType.Circle;
 
-			// see if need to change symbol type
+            // see if need to change symbol type
             foreach (string s in Enum.GetNames(typeof(ShapeType)))
                 if (string.Compare(s, (string)Symbol.SelectedValue, true) == 0)
                 {
@@ -983,13 +1039,13 @@
                 if (update)
                     UpdateDisplay();
             }
-			else if (Symbol.SelectedIndex == 6) //Font
-			{
+            else if (Symbol.SelectedIndex == 6) //Font
+            {
                 //W2D symbol is not selected, so invalidate
                 grpW2DStyle.Tag = null;
 
-			    // user wants to change away FROM a valid 'Mark' symbol type
-			    // if ("Font..." == Symbol.SelectedText)
+                // user wants to change away FROM a valid 'Mark' symbol type
+                // if ("Font..." == Symbol.SelectedText)
 
                 bool update = m_item.Symbol != m_lastFont;
 
@@ -1043,15 +1099,15 @@
                 return;
             }
 
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void SizeContext_SelectedIndexChanged(object sender, System.EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void SizeContext_SelectedIndexChanged(object sender, System.EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
             if (m_item.Symbol.Type == PointSymbolType.Mark)
                 ((IMarkSymbol)m_item.Symbol).SizeContext = (SizeContextType)Enum.Parse((typeof(SizeContextType)), (string)SizeContext.SelectedValue);
@@ -1059,22 +1115,22 @@
                 ((IFontSymbol)m_item.Symbol).SizeContext = (SizeContextType)Enum.Parse((typeof(SizeContextType)), (string)SizeContext.SelectedValue);
             else if (m_item.Symbol.Type == PointSymbolType.W2D)
                 ((IW2DSymbol)m_item.Symbol).SizeContext = (SizeContextType)Enum.Parse((typeof(SizeContextType)), (string)SizeContext.SelectedValue);
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void SizeUnits_SelectedIndexChanged(object sender, System.EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void SizeUnits_SelectedIndexChanged(object sender, System.EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
-			if (m_item.Symbol.Type == PointSymbolType.Mark || m_item.Symbol.Type == PointSymbolType.Font || m_item.Symbol.Type == PointSymbolType.W2D)
+            if (m_item.Symbol.Type == PointSymbolType.Mark || m_item.Symbol.Type == PointSymbolType.Font || m_item.Symbol.Type == PointSymbolType.W2D)
                 m_item.Symbol.Unit = (LengthUnitType)Enum.Parse(typeof(LengthUnitType), (string)SizeUnits.SelectedValue);
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
         public delegate void UpdateComboTextFromSelectChangedDelegate(ComboBox owner, string text, bool userChange);
 
@@ -1099,10 +1155,10 @@
             }
         }
 
-		private void WidthText_SelectedIndexChanged(object sender, System.EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void WidthText_SelectedIndexChanged(object sender, System.EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
             if (WidthText.SelectedIndex == WidthText.Items.Count - 1)
             {
@@ -1121,12 +1177,12 @@
                 //This is required as we cannot update the text from within the SelectedIndexChanged event :(
                 BeginInvoke(new UpdateComboTextFromSelectChangedDelegate(UpdateComboTextFromSelectChanged), WidthText, current, expr != null);
             }
-		}
+        }
 
-		private void HeigthText_SelectedIndexChanged(object sender, System.EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void HeigthText_SelectedIndexChanged(object sender, System.EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
             if (HeightText.SelectedIndex == HeightText.Items.Count - 1)
             {
@@ -1145,12 +1201,12 @@
                 //This is required as we cannot update the text from within the SelectedIndexChanged event :(
                 BeginInvoke(new UpdateComboTextFromSelectChangedDelegate(UpdateComboTextFromSelectChanged), HeightText, current, expr != null);
             }
-		}
+        }
 
-		private void ReferenceX_TextChanged(object sender, System.EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void ReferenceX_TextChanged(object sender, System.EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
             if (m_item.Symbol.Type == PointSymbolType.Mark)
             {
@@ -1162,15 +1218,15 @@
                 else
                     m_item.Symbol.InsertionPointX = ReferenceX.Text;
             }
-			previewPicture.Refresh();		
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();		
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void ReferenceY_TextChanged(object sender, System.EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void ReferenceY_TextChanged(object sender, System.EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
             if (m_item.Symbol.Type == PointSymbolType.Mark)
             {
@@ -1180,15 +1236,15 @@
                 else
                     m_item.Symbol.InsertionPointY = "0.5";
             }
-			previewPicture.Refresh();		
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();		
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void RotationBox_SelectedIndexChanged(object sender, System.EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void RotationBox_SelectedIndexChanged(object sender, System.EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
             if (RotationBox.SelectedIndex == RotationBox.Items.Count - 1)
             {
@@ -1215,81 +1271,81 @@
                 //RotationBox.SelectedIndex = -1;
             }
 
-		}
+        }
 
-		private void displayFill_CheckedChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void displayFill_CheckedChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
-			if (m_item.Symbol.Type == PointSymbolType.Mark)
-				if (fillStyleEditor.displayFill.Checked)
-					((IMarkSymbol) m_item.Symbol).Fill = previousFill == null ? _factory.CreateDefaultFill() : previousFill;
-				else
-				{
+            if (m_item.Symbol.Type == PointSymbolType.Mark)
+                if (fillStyleEditor.displayFill.Checked)
+                    ((IMarkSymbol) m_item.Symbol).Fill = previousFill == null ? _factory.CreateDefaultFill() : previousFill;
+                else
+                {
                     if (((IMarkSymbol)m_item.Symbol).Fill != null)
                         previousFill = ((IMarkSymbol)m_item.Symbol).Fill;
                     ((IMarkSymbol)m_item.Symbol).Fill = null;
-				}
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+                }
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void displayLine_CheckedChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void displayLine_CheckedChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
-			if (m_item.Symbol.Type == PointSymbolType.Mark)
-				if (lineStyleEditor.displayLine.Checked)
-					((IMarkSymbol) m_item.Symbol).Edge = previousEdge == null ? _factory.CreateDefaultStroke() : previousEdge;
-				else
-				{
+            if (m_item.Symbol.Type == PointSymbolType.Mark)
+                if (lineStyleEditor.displayLine.Checked)
+                    ((IMarkSymbol) m_item.Symbol).Edge = previousEdge == null ? _factory.CreateDefaultStroke() : previousEdge;
+                else
+                {
                     if (((IMarkSymbol)m_item.Symbol).Edge != null)
                         previousEdge = ((IMarkSymbol)m_item.Symbol).Edge;
                     ((IMarkSymbol)m_item.Symbol).Edge = null;
-				}
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+                }
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void fillCombo_SelectedIndexChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void fillCombo_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
-			if (m_item.Symbol.Type == PointSymbolType.Mark)
-				((IMarkSymbol) m_item.Symbol).Fill.FillPattern = fillStyleEditor.fillCombo.Text;
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            if (m_item.Symbol.Type == PointSymbolType.Mark)
+                ((IMarkSymbol) m_item.Symbol).Fill.FillPattern = fillStyleEditor.fillCombo.Text;
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void foregroundColor_CurrentColorChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void foregroundColor_CurrentColorChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
             if (m_item.Symbol.Type == PointSymbolType.Mark)
                 ((IMarkSymbol)m_item.Symbol).Fill.ForegroundColor = fillStyleEditor.foregroundColor.ColorExpression;
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void backgroundColor_CurrentColorChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void backgroundColor_CurrentColorChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
             if (m_item.Symbol.Type == PointSymbolType.Mark)
                 ((IMarkSymbol)m_item.Symbol).Fill.BackgroundColor = fillStyleEditor.backgroundColor.ColorExpression;
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
 
         private void thicknessCombo_TextChanged(object sender, EventArgs e)
@@ -1306,9 +1362,9 @@
         }
 
         private void thicknessCombo_SelectedIndexChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate || lineStyleEditor.thicknessCombo.SelectedIndex != lineStyleEditor.thicknessCombo.Items.Count - 1)
-				return;
+        {
+            if (m_inUpdate || lineStyleEditor.thicknessCombo.SelectedIndex != lineStyleEditor.thicknessCombo.Items.Count - 1)
+                return;
 
                 string current = null;
                 if (m_item.Symbol.Type == PointSymbolType.Mark)
@@ -1326,104 +1382,104 @@
                 BeginInvoke(new UpdateComboTextFromSelectChangedDelegate(UpdateComboTextFromSelectChanged), lineStyleEditor.thicknessCombo, current, expr != null);
         }
 
-		private void colorCombo_CurrentColorChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void colorCombo_CurrentColorChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
             if (m_item.Symbol.Type == PointSymbolType.Mark)
                 ((IMarkSymbol)m_item.Symbol).Edge.Color = lineStyleEditor.colorCombo.ColorExpression;
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void fillCombo_Line_SelectedIndexChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void fillCombo_Line_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
-			if (m_item.Symbol.Type == PointSymbolType.Mark)
+            if (m_item.Symbol.Type == PointSymbolType.Mark)
                 ((IMarkSymbol)m_item.Symbol).Edge.LineStyle = lineStyleEditor.fillCombo.Text;
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void colourFontForeground_CurrentColorChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void colourFontForeground_CurrentColorChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
             if (m_item.Symbol.Type == PointSymbolType.Font)
                 ((IFontSymbol)m_item.Symbol).ForegroundColor = Utility.SerializeHTMLColor(colorFontForeground.CurrentColor, true);
 
             previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void fontCombo_SelectedIndexChanged(object sender, EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void fontCombo_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
-			//TODO: Validate
+            //TODO: Validate
             if (!(m_item.Symbol is IFontSymbol))
-				return;
+                return;
             ((IFontSymbol)m_item.Symbol).FontName = fontCombo.Text;
 
-			comboBoxCharacter.Items.Clear();
-			try
-			{
-				comboBoxCharacter.Font = new Font(fontCombo.SelectedText, (float)8.25);
-			}
-			catch
-			{
-				MessageBox.Show(this, string.Format(Properties.Resources.SymbolTypeNotSupported, fontCombo.SelectedText), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
-				return;
-			}
+            comboBoxCharacter.Items.Clear();
+            try
+            {
+                comboBoxCharacter.Font = new Font(fontCombo.SelectedText, (float)8.25);
+            }
+            catch
+            {
+                MessageBox.Show(this, string.Format(Properties.Resources.SymbolTypeNotSupported, fontCombo.SelectedText), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
+                return;
+            }
 
-			// populate with a basic A-Z
-			for (char c = 'A'; c < 'Z'; c++)
-				comboBoxCharacter.Items.Add(c);
+            // populate with a basic A-Z
+            for (char c = 'A'; c < 'Z'; c++)
+                comboBoxCharacter.Items.Add(c);
 
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void comboBoxCharacter_SelectedIndexChanged(object sender, System.EventArgs e)
-		{
-			if (m_inUpdate)
-				return;
+        private void comboBoxCharacter_SelectedIndexChanged(object sender, System.EventArgs e)
+        {
+            if (m_inUpdate)
+                return;
 
-			//TODO: Validate
-			if (m_item.Symbol.Type != PointSymbolType.Font)
-				return;
+            //TODO: Validate
+            if (m_item.Symbol.Type != PointSymbolType.Font)
+                return;
 
-			((IFontSymbol)m_item.Symbol).Character = comboBoxCharacter.Text;
+            ((IFontSymbol)m_item.Symbol).Character = comboBoxCharacter.Text;
 
-			previewPicture.Refresh();
-			if (Changed != null)
-				Changed(this, new EventArgs());
-		}
+            previewPicture.Refresh();
+            if (Changed != null)
+                Changed(this, new EventArgs());
+        }
 
-		private void comboBoxCharacter_TextChanged(object sender, System.EventArgs e)
-		{
-			comboBoxCharacter_SelectedIndexChanged(sender, e);
-		}
+        private void comboBoxCharacter_TextChanged(object sender, System.EventArgs e)
+        {
+            comboBoxCharacter_SelectedIndexChanged(sender, e);
+        }
 
 
-		public IPointSymbolization2D Item
-		{
-			get { return m_item; }
-			set 
-			{
-				m_item = value;
-				UpdateDisplay();
-			}
-		}
+        public IPointSymbolization2D Item
+        {
+            get { return m_item; }
+            set 
+            {
+                m_item = value;
+                UpdateDisplay();
+            }
+        }
 
         private void DisplayPoints_CheckedChanged(object sender, EventArgs e)
         {
@@ -1491,8 +1547,8 @@
                 Changed(this, new EventArgs());
         }
 
-		private void RotationBox_TextChanged(object sender, EventArgs e)
-		{
+        private void RotationBox_TextChanged(object sender, EventArgs e)
+        {
             if (m_inUpdate || RotationBox.SelectedIndex != -1)
                 return;
 
@@ -1506,9 +1562,9 @@
             previewPicture.Refresh();
             if (Changed != null)
                 Changed(this, new EventArgs());
-		}
-		
-		private void ReferenceY_Leave(object sender, EventArgs e)
+        }
+        
+        private void ReferenceY_Leave(object sender, EventArgs e)
         {
             double d;
             if (m_item.Symbol is IMarkSymbol)
@@ -1695,26 +1751,48 @@
             if (Changed != null)
                 Changed(this, new EventArgs());
         }
-		
-		void FillStyleEditor_BackgroundRequiresExpression(object sender, EventArgs e)
-		{
+        
+        void FillStyleEditor_BackgroundRequiresExpression(object sender, EventArgs e)
+        {
             string expr = m_editor.EditExpression(fillStyleEditor.backgroundColor.ColorExpression, m_schema, m_providername, m_featureSource, true);
             if (expr != null)
                 fillStyleEditor.backgroundColor.ColorExpression = expr;
-		}
-		
-		void FillStyleEditor_ForegroundRequiresExpression(object sender, EventArgs e)
-		{
+        }
+        
+        void FillStyleEditor_ForegroundRequiresExpression(object sender, EventArgs e)
+        {
             string expr = m_editor.EditExpression(fillStyleEditor.foregroundColor.ColorExpression, m_schema, m_providername, m_featureSource, true);
             if (expr != null)
                 fillStyleEditor.foregroundColor.ColorExpression = expr;
-		}
-		
-		void LineStyleEditor_RequiresExpressionEditor(object sender, EventArgs e)
-		{
+        }
+        
+        void LineStyleEditor_RequiresExpressionEditor(object sender, EventArgs e)
+        {
             string expr = m_editor.EditExpression(lineStyleEditor.colorCombo.ColorExpression, m_schema, m_providername, m_featureSource, true);
             if (expr != null)
                 lineStyleEditor.colorCombo.ColorExpression = expr;
-		}
+        }
+
+        private void lnkRefresh_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+        {
+            if (_editCommit != null)
+                _editCommit.Invoke();
+            UpdatePreviewImage();
+        }
+
+        private Action _editCommit;
+
+        internal void SetEditCommit(Action editCommit)
+        {
+            _editCommit = editCommit;
+        }
+
+        protected override void OnLoad(EventArgs e)
+        {
+            base.OnLoad(e);
+            if (_editCommit != null)
+                _editCommit.Invoke();
+            UpdatePreviewImage();
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.resx	2012-09-03 13:38:24 UTC (rev 6977)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.resx	2012-09-03 16:35:12 UTC (rev 6978)
@@ -564,6 +564,39 @@
   <data name="groupBox4.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Top, Left, Right</value>
   </data>
+  <data name="lnkRefresh.AutoSize" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
+  <data name="lnkRefresh.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
+    <value>NoControl</value>
+  </data>
+  <data name="lnkRefresh.Location" type="System.Drawing.Point, System.Drawing">
+    <value>294, 0</value>
+  </data>
+  <data name="lnkRefresh.Size" type="System.Drawing.Size, System.Drawing">
+    <value>50, 13</value>
+  </data>
+  <data name="lnkRefresh.TabIndex" type="System.Int32, mscorlib">
+    <value>2</value>
+  </data>
+  <data name="lnkRefresh.Text" xml:space="preserve">
+    <value>(Refresh)</value>
+  </data>
+  <data name="lnkRefresh.Visible" type="System.Boolean, mscorlib">
+    <value>False</value>
+  </data>
+  <data name=">>lnkRefresh.Name" xml:space="preserve">
+    <value>lnkRefresh</value>
+  </data>
+  <data name=">>lnkRefresh.Type" xml:space="preserve">
+    <value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>lnkRefresh.Parent" xml:space="preserve">
+    <value>groupBox4</value>
+  </data>
+  <data name=">>lnkRefresh.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
   <data name="previewPicture.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Top, Bottom, Left, Right</value>
   </data>
@@ -586,7 +619,7 @@
     <value>groupBox4</value>
   </data>
   <data name=">>previewPicture.ZOrder" xml:space="preserve">
-    <value>0</value>
+    <value>1</value>
   </data>
   <data name="groupBox4.Location" type="System.Drawing.Point, System.Drawing">
     <value>0, 585</value>
@@ -1446,6 +1479,9 @@
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>46</value>
   </metadata>
+  <data name="$this.AutoScroll" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
   <data name="$this.AutoScrollMinSize" type="System.Drawing.Size, System.Drawing">
     <value>344, 640</value>
   </data>

Modified: trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj	2012-09-03 13:38:24 UTC (rev 6977)
+++ trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj	2012-09-03 16:35:12 UTC (rev 6978)
@@ -731,6 +731,7 @@
       <DependentUpon>VectorLayerEditorCtrl.cs</DependentUpon>
     </Compile>
     <Compile Include="LayerDefinition\Vector\FeaturePreviewRender.cs" />
+    <Compile Include="LayerDefinition\Vector\ILayerStylePreviewable.cs" />
     <Compile Include="LayerDefinition\Vector\Scales\CompositeStyleListCtrl.cs">
       <SubType>UserControl</SubType>
     </Compile>

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerFactory.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerFactory.cs	2012-09-03 13:38:24 UTC (rev 6977)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerFactory.cs	2012-09-03 16:35:12 UTC (rev 6978)
@@ -328,11 +328,11 @@
             {
                 LegendLabel = ""
             };
-            ar.AreaSymbolization2D = CreateDefaultAreaSymbolization2D();
+            ar.AreaSymbolization2D = CreateDefaultAreaSymbolizationFill();
             return ar;
         }
 
-        private IAreaSymbolizationFill CreateDefaultAreaSymbolization2D()
+        public IAreaSymbolizationFill CreateDefaultAreaSymbolizationFill()
         {
             IAreaSymbolizationFill fill = new AreaSymbolizationFillType();
             fill.Fill = CreateDefaultFill();

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs	2012-09-03 13:38:24 UTC (rev 6977)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs	2012-09-03 16:35:12 UTC (rev 6978)
@@ -356,6 +356,12 @@
         /// </summary>
         /// <returns></returns>
         IUrlData CreateUrlData();
+
+        /// <summary>
+        /// Creates a default AreaSymbolizationFill element
+        /// </summary>
+        /// <returns></returns>
+        IAreaSymbolizationFill CreateDefaultAreaSymbolizationFill();
     }
 
     /// <summary>



More information about the mapguide-commits mailing list