[mapguide-commits] r6027 - in trunk/Tools/Maestro: Generated Maestro.Base/Editor Maestro.Editors/LayerDefinition/Vector/Scales OSGeo.MapGuide.MaestroAPI/ObjectModels

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Aug 3 11:56:46 EDT 2011


Author: jng
Date: 2011-08-03 08:56:46 -0700 (Wed, 03 Aug 2011)
New Revision: 6027

Modified:
   trunk/Tools/Maestro/Generated/SymbolDefinition-1.0.0.designer.cs
   trunk/Tools/Maestro/Generated/SymbolDefinition-1.1.0.designer.cs
   trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceSettingsCtrl.Designer.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceSettingsCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceSettingsCtrl.resx
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs
   trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.resx
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerFactory.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs
Log:
#1746: Enable support for inline symbol definitions for composite symbolization. Also use ResourceTypeRegistry.Serialize() when serializing to XML as it allows us to implement pre-serialization hooks like purging version attributes from inline symbol definition elements.


Modified: trunk/Tools/Maestro/Generated/SymbolDefinition-1.0.0.designer.cs
===================================================================
--- trunk/Tools/Maestro/Generated/SymbolDefinition-1.0.0.designer.cs	2011-08-03 14:26:11 UTC (rev 6026)
+++ trunk/Tools/Maestro/Generated/SymbolDefinition-1.0.0.designer.cs	2011-08-03 15:56:46 UTC (rev 6027)
@@ -428,9 +428,9 @@
         private static System.Xml.Serialization.XmlSerializer serializer;
         
         public Image() {
-            /*
             this.sizeXField = "1.0";
             this.sizeYField = "1.0";
+            /*
             this.sizeScalableField = "true";
             this.angleField = "0.0";
             this.positionXField = "0.0";

Modified: trunk/Tools/Maestro/Generated/SymbolDefinition-1.1.0.designer.cs
===================================================================
--- trunk/Tools/Maestro/Generated/SymbolDefinition-1.1.0.designer.cs	2011-08-03 14:26:11 UTC (rev 6026)
+++ trunk/Tools/Maestro/Generated/SymbolDefinition-1.1.0.designer.cs	2011-08-03 15:56:46 UTC (rev 6027)
@@ -428,9 +428,9 @@
         private static System.Xml.Serialization.XmlSerializer serializer;
         
         public Image() {
-            /*
             this.sizeXField = "1.0";
             this.sizeYField = "1.0";
+            /*
             this.sizeScalableField = "true";
             this.angleField = "0.0";
             this.positionXField = "0.0";

Modified: trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs	2011-08-03 14:26:11 UTC (rev 6026)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/EditorContentBase.cs	2011-08-03 15:56:46 UTC (rev 6027)
@@ -92,7 +92,10 @@
         /// <returns></returns>
         public virtual string GetXmlContent()
         {
-            return this.Resource.Serialize();
+            using (var sr = new System.IO.StreamReader(ResourceTypeRegistry.Serialize(this.Resource)))
+            {
+                return sr.ReadToEnd();
+            }
         }
 
         /// <summary>
@@ -257,7 +260,7 @@
         {
             //Save the current resource to another session copy
             string resId = "Session:" + this.EditorService.SessionID + "//" + Guid.NewGuid() + "." + this.Resource.ResourceType.ToString();
-            this.EditorService.ResourceService.SetResourceXmlData(resId, this.Resource.SerializeToStream());
+            this.EditorService.ResourceService.SetResourceXmlData(resId, ResourceTypeRegistry.Serialize(this.Resource));
 
             //Copy any resource data
             var previewCopy = this.EditorService.ResourceService.GetResource(resId);

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceSettingsCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceSettingsCtrl.Designer.cs	2011-08-03 14:26:11 UTC (rev 6026)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceSettingsCtrl.Designer.cs	2011-08-03 15:56:46 UTC (rev 6027)
@@ -43,9 +43,9 @@
             // 
             // groupBox1
             // 
+            resources.ApplyResources(this.groupBox1, "groupBox1");
             this.groupBox1.Controls.Add(this.grdOverrides);
             this.groupBox1.Controls.Add(this.toolStrip1);
-            resources.ApplyResources(this.groupBox1, "groupBox1");
             this.groupBox1.Name = "groupBox1";
             this.groupBox1.TabStop = false;
             // 

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceSettingsCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceSettingsCtrl.cs	2011-08-03 14:26:11 UTC (rev 6026)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceSettingsCtrl.cs	2011-08-03 15:56:46 UTC (rev 6027)
@@ -33,6 +33,7 @@
 using OSGeo.MapGuide.MaestroAPI.Services;
 using OSGeo.MapGuide.ObjectModels.LayerDefinition;
 using OSGeo.MapGuide.MaestroAPI.Schema;
+    using Maestro.Editors.SymbolDefinition;
 
     internal partial class SymbolInstanceSettingsCtrl : UserControl
     {
@@ -88,9 +89,21 @@
                     });
                 }
             }
+            else if (_symRef.Reference.Type == SymbolInstanceType.Inline)
+            {
+                var inline = (ISymbolInstanceReferenceInline)_symRef.Reference;
+                foreach (var p in inline.SymbolDefinition.GetParameters())
+                {
+                    var param = p;
+                    var btn = btnAdd.DropDown.Items.Add(p.Name, null, (s, e) =>
+                    {
+                        AddParameterOverride(inline.SymbolDefinition, param);
+                    });
+                }
+            }
             else
             {
-                throw new NotImplementedException();
+                throw new Exception();
             }
         }
 
@@ -125,26 +138,27 @@
         private Control CreateEditor(ISymbolInstance symRef, IResourceService resSvc)
         {
             Check.NotNull(symRef, "symRef");
-            var ed = new SymbolInstanceSettingsCtrl();
             if (symRef.Reference.Type == SymbolInstanceType.Reference)
             {
                 return new ReferenceCtrl((ISymbolInstanceReferenceLibrary)symRef.Reference, resSvc);
             }
             else
             {
-                throw new NotImplementedException();
-
                 var inline = (ISymbolInstanceReferenceInline)symRef.Reference;
+                var symEditor = new SymbolEditorService(_edSvc, inline.SymbolDefinition);
                 if (inline.SymbolDefinition.Type == SymbolDefinitionType.Simple)
                 {
-
+                    var sed = new SimpleSymbolDefinitionEditorCtrl();
+                    sed.Bind(symEditor);
+                    return sed;
                 }
                 else
                 {
-
+                    var sed = new CompoundSymbolDefinitionEditorCtrl();
+                    sed.Bind(symEditor);
+                    return sed;
                 }
             }
-            return ed;
         }
 
         private void btnEdit_Click(object sender, EventArgs e)

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceSettingsCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceSettingsCtrl.resx	2011-08-03 14:26:11 UTC (rev 6026)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceSettingsCtrl.resx	2011-08-03 15:56:46 UTC (rev 6027)
@@ -118,6 +118,9 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.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" />
+  <data name="groupBox1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Top, Left, Right</value>
+  </data>
   <data name="grdOverrides.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
     <value>Fill</value>
   </data>
@@ -222,6 +225,9 @@
   <data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
     <value>1</value>
   </data>
+  <data name="grpSettings.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Top, Bottom, Left, Right</value>
+  </data>
   <data name="grpSettings.Location" type="System.Drawing.Point, System.Drawing">
     <value>4, 167</value>
   </data>

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs	2011-08-03 14:26:11 UTC (rev 6026)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs	2011-08-03 15:56:46 UTC (rev 6027)
@@ -31,6 +31,7 @@
 using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
 using Maestro.Editors.LayerDefinition.Vector.Scales.SymbolInstanceEditors;
 using OSGeo.MapGuide.MaestroAPI.Schema;
+using OSGeo.MapGuide.ObjectModels;
 
 namespace Maestro.Editors.LayerDefinition.Vector.Scales
 {
@@ -62,6 +63,22 @@
             this.Close();
         }
 
+        private void AddInstance(ISymbolInstance symRef, bool add)
+        {
+            var li = new ListViewItem();
+            li.ImageIndex = (symRef.Reference.Type == SymbolInstanceType.Reference) ? 0 : 1;
+            li.Tag = symRef;
+            if (li.ImageIndex == 0)
+                li.Text = ((ISymbolInstanceReferenceLibrary)symRef.Reference).ResourceId;
+            else
+                li.Text = Properties.Resources.InlineSymbolDefinition;
+
+            lstInstances.Items.Add(li);
+            if (add)
+                _comp.AddSymbolInstance(symRef);
+            li.Selected = (lstInstances.Items.Count == 1);
+        }
+
         private void referenceToolStripMenuItem_Click(object sender, EventArgs e)
         {
             splitContainer1.Panel2.Controls.Clear();
@@ -79,30 +96,34 @@
             }
         }
 
-        private void AddInstance(ISymbolInstance symRef, bool add)
+        private void inlineSimpleSymbolToolStripMenuItem_Click(object sender, EventArgs e)
         {
-            var li = new ListViewItem();
-            li.ImageIndex = (symRef.Reference.Type == SymbolInstanceType.Reference) ? 0 : 1;
-            li.Tag = symRef;
-            if (li.ImageIndex == 0)
-                li.Text = ((ISymbolInstanceReferenceLibrary)symRef.Reference).ResourceId;
-            else
-                li.Text = Properties.Resources.InlineSymbolDefinition;
+            var res = (ILayerDefinition)_edSvc.GetEditedResource();
+            var vl = (IVectorLayerDefinition)res.SubLayer;
+            if (vl.SymbolDefinitionVersion == null)
+                throw new InvalidOperationException("This Layer Definition version does not support composite symbolization");
+            var ssym = ObjectFactory.CreateSimpleSymbol(_edSvc.GetEditedResource().CurrentConnection, 
+                                                        vl.SymbolDefinitionVersion, 
+                                                        "InlineSimpleSymbol", 
+                                                        "Inline Simple Symbol");
 
-            lstInstances.Items.Add(li);
-            if (add)
-                _comp.AddSymbolInstance(symRef);
-            li.Selected = (lstInstances.Items.Count == 1);
+            var instance = _comp.CreateInlineSimpleSymbol(ssym);
+            AddInstance(instance, true);
         }
 
-        private void inlineSimpleSymbolToolStripMenuItem_Click(object sender, EventArgs e)
+        private void inlineCompoundSymbolToolStripMenuItem_Click(object sender, EventArgs e)
         {
-            throw new NotImplementedException();
-        }
+            var res = (ILayerDefinition)_edSvc.GetEditedResource();
+            var vl = (IVectorLayerDefinition)res.SubLayer;
+            if (vl.SymbolDefinitionVersion == null)
+                throw new InvalidOperationException("This Layer Definition version does not support composite symbolization");
+            var csym = ObjectFactory.CreateCompoundSymbol(_edSvc.GetEditedResource().CurrentConnection,
+                                                          vl.SymbolDefinitionVersion,
+                                                          "InlineCompoundSymbol",
+                                                          "Inline Compound Symbol");
 
-        private void inlineCompoundSymbolToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            throw new NotImplementedException();
+            var instance = _comp.CreateInlineCompoundSymbol(csym);
+            AddInstance(instance, true);
         }
 
         private void btnDelete_Click(object sender, EventArgs e)

Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.resx	2011-08-03 14:26:11 UTC (rev 6026)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.resx	2011-08-03 15:56:46 UTC (rev 6027)
@@ -123,7 +123,7 @@
   </data>
   <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
-    <value>658, 430</value>
+    <value>697, 527</value>
   </data>
   <data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
     <value>75, 23</value>
@@ -164,7 +164,7 @@
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
         ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD2
-        CAAAAk1TRnQBSQFMAgEBAgEAARgBAAEYAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
+        CAAAAk1TRnQBSQFMAgEBAgEAASABAAEgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
         AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
         AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
         AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@@ -209,7 +209,7 @@
     <value>3, 41</value>
   </data>
   <data name="lstInstances.Size" type="System.Drawing.Size, System.Drawing">
-    <value>212, 354</value>
+    <value>155, 451</value>
   </data>
   <data name="lstInstances.TabIndex" type="System.Int32, mscorlib">
     <value>1</value>
@@ -229,24 +229,6 @@
   <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>3, 16</value>
   </metadata>
-  <data name="referenceToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
-    <value>210, 22</value>
-  </data>
-  <data name="referenceToolStripMenuItem.Text" xml:space="preserve">
-    <value>Reference</value>
-  </data>
-  <data name="inlineSimpleSymbolToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
-    <value>210, 22</value>
-  </data>
-  <data name="inlineSimpleSymbolToolStripMenuItem.Text" xml:space="preserve">
-    <value>Inline Simple Symbol</value>
-  </data>
-  <data name="inlineCompoundSymbolToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
-    <value>210, 22</value>
-  </data>
-  <data name="inlineCompoundSymbolToolStripMenuItem.Text" xml:space="preserve">
-    <value>Inline Compound Symbol</value>
-  </data>
   <data name="btnAdd.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
     <value>Magenta</value>
   </data>
@@ -269,7 +251,7 @@
     <value>3, 16</value>
   </data>
   <data name="toolStrip1.Size" type="System.Drawing.Size, System.Drawing">
-    <value>212, 25</value>
+    <value>155, 25</value>
   </data>
   <data name="toolStrip1.TabIndex" type="System.Int32, mscorlib">
     <value>0</value>
@@ -296,7 +278,7 @@
     <value>0, 0</value>
   </data>
   <data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
-    <value>218, 398</value>
+    <value>161, 495</value>
   </data>
   <data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
     <value>0</value>
@@ -341,10 +323,10 @@
     <value>1</value>
   </data>
   <data name="splitContainer1.Size" type="System.Drawing.Size, System.Drawing">
-    <value>721, 398</value>
+    <value>760, 495</value>
   </data>
   <data name="splitContainer1.SplitterDistance" type="System.Int32, mscorlib">
-    <value>218</value>
+    <value>161</value>
   </data>
   <data name="splitContainer1.TabIndex" type="System.Int32, mscorlib">
     <value>1</value>
@@ -361,15 +343,30 @@
   <data name="&gt;&gt;splitContainer1.ZOrder" xml:space="preserve">
     <value>0</value>
   </data>
+  <data name="referenceToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+    <value>210, 22</value>
+  </data>
+  <data name="referenceToolStripMenuItem.Text" xml:space="preserve">
+    <value>Reference</value>
+  </data>
+  <data name="inlineSimpleSymbolToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+    <value>210, 22</value>
+  </data>
+  <data name="inlineSimpleSymbolToolStripMenuItem.Text" xml:space="preserve">
+    <value>Inline Simple Symbol</value>
+  </data>
+  <data name="inlineCompoundSymbolToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
+    <value>210, 22</value>
+  </data>
+  <data name="inlineCompoundSymbolToolStripMenuItem.Text" xml:space="preserve">
+    <value>Inline Compound Symbol</value>
+  </data>
   <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
-    <value>745, 465</value>
+    <value>784, 562</value>
   </data>
-  <data name="$this.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
-    <value>NoControl</value>
-  </data>
   <data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
     <value>CenterParent</value>
   </data>

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerFactory.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerFactory.cs	2011-08-03 14:26:11 UTC (rev 6026)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerFactory.cs	2011-08-03 15:56:46 UTC (rev 6027)
@@ -25,6 +25,7 @@
 using System.Drawing;
 using OSGeo.MapGuide.MaestroAPI.Resource;
 using System.IO;
+using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
 
 #pragma warning disable 1591, 0114, 0108
 
@@ -58,6 +59,38 @@
 
         public static Stream Serialize(IResource res)
         {
+            var ldf = (ILayerDefinition)res;
+            var vl = ldf.SubLayer as IVectorLayerDefinition;
+            if (vl != null)
+            {
+                foreach (var vsr in vl.VectorScaleRange)
+                {
+                    var vsr2 = vsr as IVectorScaleRange2;
+                    if (vsr2 != null)
+                    {
+                        var cts = vsr2.CompositeStyle;
+                        if (cts != null)
+                        {
+                            foreach (var crs in cts.CompositeRule)
+                            {
+                                var csym = crs.CompositeSymbolization;
+                                if (csym != null)
+                                {
+                                    foreach (var si in csym.SymbolInstance)
+                                    {
+                                        if (si.Reference.Type == OSGeo.MapGuide.ObjectModels.SymbolDefinition.SymbolInstanceType.Inline)
+                                        {
+                                            var symBase = ((ISymbolInstanceReferenceInline)si.Reference).SymbolDefinition;
+                                            symBase.RemoveSchemaAttributes();
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
             return res.SerializeToStream();
         }
     }

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs	2011-08-03 14:26:11 UTC (rev 6026)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LayerInterfaces.cs	2011-08-03 15:56:46 UTC (rev 6027)
@@ -479,6 +479,12 @@
         /// <param name="pair"></param>
         /// <returns></returns>
         int MoveDown(INameStringPair pair);
+
+        /// <summary>
+        /// Gets the supported symbol definition version to use for composite symbolization.
+        /// If the Layer Definition does not support composite symbolization, null is returned
+        /// </summary>
+        Version SymbolDefinitionVersion { get; }
     }
 
     /// <summary>
@@ -1674,6 +1680,20 @@
         /// <param name="resourceId"></param>
         /// <returns></returns>
         ISymbolInstance CreateSymbolReference(string resourceId);
+
+        /// <summary>
+        /// Creates an inline simple symbol instance
+        /// </summary>
+        /// <param name="symDef"></param>
+        /// <returns></returns>
+        ISymbolInstance CreateInlineSimpleSymbol(ISimpleSymbolDefinition symDef);
+
+        /// <summary>
+        /// Creates an inline compound symbol instance
+        /// </summary>
+        /// <param name="compDef"></param>
+        /// <returns></returns>
+        ISymbolInstance CreateInlineCompoundSymbol(ICompoundSymbolDefinition compDef);
     }
 
     /// <summary>

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs	2011-08-03 14:26:11 UTC (rev 6026)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs	2011-08-03 15:56:46 UTC (rev 6027)
@@ -1661,6 +1661,21 @@
 
             return this.VectorScaleRange[index];
         }
+
+        [XmlIgnore]
+        Version IVectorLayerDefinition.SymbolDefinitionVersion
+        {
+            get
+            {
+#if LDF_110
+                return new Version(1, 0, 0);
+#elif LDF_120 || LDF_230
+                return new Version(1, 1, 0);
+#else
+                return null;
+#endif          
+            }
+        }
     }
     #region Composite Symbolization
 #if !LDF_100
@@ -1720,6 +1735,39 @@
                 },
             };
         }
+
+
+        public ISymbolInstance CreateInlineSimpleSymbol(ISimpleSymbolDefinition symDef)
+        {
+            return new SymbolInstance()
+            {
+#if LDF_110
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition_1_0_0.SimpleSymbolDefinition)symDef,
+#else
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition_1_1_0.SimpleSymbolDefinition)symDef,
+#endif
+                ParameterOverrides = new ParameterOverrides()
+                {
+                    Override = new BindingList<Override>()
+                }
+            };
+        }
+
+        public ISymbolInstance CreateInlineCompoundSymbol(ICompoundSymbolDefinition compDef)
+        {
+            return new SymbolInstance()
+            {
+#if LDF_110
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition_1_0_0.CompoundSymbolDefinition)compDef,
+#else
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition_1_1_0.CompoundSymbolDefinition)compDef,
+#endif
+                ParameterOverrides = new ParameterOverrides()
+                {
+                    Override = new BindingList<Override>()
+                }
+            };
+        }
     }
 
     partial class SymbolInstance : ISymbolInstance



More information about the mapguide-commits mailing list