[mapguide-commits] r8463 - in trunk/Tools/Maestro: Generated OSGeo.MapGuide.ObjectModels OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_0_0 OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_1_0 OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_2_0 OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_3_0 OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_3_0 OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_4_0 OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_0_0 OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_1_0 OSGeo.MapGuide.ObjectModels/LoadProcedure/v2_4_0 OSGeo.MapGuide.ObjectModels/MapDefinition OSGeo.MapGuide.ObjectModels/MapDefinition/v1_0_0 OSGeo.MapGuide.ObjectModels/MapDefinition/v2_3_0 OSGeo.MapGuide.ObjectModels/MapDefinition/v2_4_0 OSGeo.MapGuide.ObjectModels/SymbolDefinition/v1_0_0 OSGeo.MapGuide.ObjectModels/SymbolDefinition/v1_1_0 OSGeo.MapGuide.ObjectModels/SymbolDefinition/v2_4_0 OSGeo.MapGuide.ObjectModels/WatermarkDefinition OSGeo.MapGuide.ObjectModels/WatermarkDefinition/v2_3_0 OSGeo.MapG uide.ObjectModels/WatermarkDefinition/v2_4_0 OSGeo.MapGuide.ObjectModels/WebLayout OSGeo.MapGuide.ObjectModels/WebLayout/v1_0_0 OSGeo.MapGuide.ObjectModels/WebLayout/v1_1_0 OSGeo.MapGuide.ObjectModels/WebLayout/v2_4_0 OSGeo.MapGuide.ObjectModels/WebLayout/v2_6_0

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Dec 25 06:53:58 PST 2014


Author: jng
Date: 2014-12-25 06:53:57 -0800 (Thu, 25 Dec 2014)
New Revision: 8463

Added:
   trunk/Tools/Maestro/Generated/WebLayout-2.4.0.designer.cs
   trunk/Tools/Maestro/Generated/WebLayout-2.6.0.designer.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_1_0/GridLayerDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_1_0/LayerElementFactoryImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_1_0/VectorLayerDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_2_0/GridLayerDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_2_0/LayerElementFactoryImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_2_0/VectorLayerDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_3_0/GridLayerDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_3_0/LayerElementFactoryImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_3_0/VectorLayerDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_3_0/GridLayerDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_3_0/LayerElementFactoryImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_3_0/VectorLayerDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_4_0/GridLayerDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_4_0/LayerElementFactoryImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_4_0/VectorLayerDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_1_0/LoadProcedureFactoryImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_1_0/LoadProcedureImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v2_4_0/LoadProcedureFactoryImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v2_4_0/LoadProcedureImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/v2_3_0/
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/v2_3_0/MapDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/v2_4_0/
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/v2_4_0/MapDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/SymbolDefinition/v1_1_0/SymbolDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/SymbolDefinition/v2_4_0/SymbolDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WatermarkDefinition/WatermarkCollectionUtil.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WatermarkDefinition/v2_3_0/WatermarkDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WatermarkDefinition/v2_4_0/WatermarkDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v1_1_0/
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v1_1_0/WebLayoutImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v2_4_0/
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v2_4_0/WebLayoutImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v2_6_0/
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v2_6_0/WebLayoutImpl.cs
Modified:
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_0_0/GridLayerDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_0_0/LayerElementFactoryImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_0_0/VectorLayerDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_0_0/LoadProcedureFactoryImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_0_0/LoadProcedureImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/MapDefinitionInterfaces.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/v1_0_0/MapDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/OSGeo.MapGuide.ObjectModels.csproj
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/ObjectFactory.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/Strings.Designer.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/Strings.resx
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/SymbolDefinition/v1_0_0/SymbolDefinitionImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v1_0_0/WebLayoutImpl.cs
Log:
#2513: Bring across the resource class augmentations and ObjectFactory methods

Added: trunk/Tools/Maestro/Generated/WebLayout-2.4.0.designer.cs
===================================================================
--- trunk/Tools/Maestro/Generated/WebLayout-2.4.0.designer.cs	                        (rev 0)
+++ trunk/Tools/Maestro/Generated/WebLayout-2.4.0.designer.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,8186 @@
+#pragma warning disable 1591, 0114, 0108
+// ------------------------------------------------------------------------------
+//  <auto-generated>
+//    Generated by Xsd2Code. Version 3.3.0.33001
+//    <NameSpace>OSGeo.MapGuide.ObjectModels.WebLayout</NameSpace><Collection>BindingList</Collection><codeType>CSharp</codeType><EnableDataBinding>True</EnableDataBinding><EnableLasyLoading>False</EnableLasyLoading><HidePrivateFieldInIDE>True</HidePrivateFieldInIDE><EnableSummaryComment>True</EnableSummaryComment><IncludeSerializeMethod>True</IncludeSerializeMethod><UseBaseClass>False</UseBaseClass><GenerateCloneMethod>True</GenerateCloneMethod><GenerateDataContracts>False</GenerateDataContracts><CodeBaseTag>Net20</CodeBaseTag><SerializeMethodName>Serialize</SerializeMethodName><DeserializeMethodName>Deserialize</DeserializeMethodName><SaveToFileMethodName>SaveToFile</SaveToFileMethodName><LoadFromFileMethodName>LoadFromFile</LoadFromFileMethodName><GenerateXMLAttributes>True</GenerateXMLAttributes><AutomaticProperties>False</AutomaticProperties><DisableDebug>False</DisableDebug><CustomUsings></CustomUsings><ExcludeIncludedTypes>False</ExcludeIncludedTypes><EnableInitialize
 Fields>False</EnableInitializeFields>
+//  </auto-generated>
+// ------------------------------------------------------------------------------
+namespace OSGeo.MapGuide.ObjectModels.WebLayout.v2_4_0 {
+    using System;
+    using System.Diagnostics;
+    using System.Xml.Serialization;
+    using System.Collections;
+    using System.Xml.Schema;
+    using System.ComponentModel;
+    using System.IO;
+    using OSGeo.MapGuide.ObjectModels.WebLayout;
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute("WebLayout", Namespace="", IsNullable=false)]
+    public partial class WebLayoutType : BaseSerializable, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string titleField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private MapType mapField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private bool enablePingServerField;
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private ToolBarType toolBarField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private InformationPaneType informationPaneField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private ContextMenuType contextMenuField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TaskPaneType taskPaneField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private StatusBarType statusBarField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private ZoomControlType zoomControlField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<CommandType> commandSetField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Title {
+            get {
+                return this.titleField;
+            }
+            set {
+                if ((this.titleField != null)) {
+                    if ((titleField.Equals(value) != true)) {
+                        this.titleField = value;
+                        this.OnPropertyChanged("Title");
+                    }
+                }
+                else {
+                    this.titleField = value;
+                    this.OnPropertyChanged("Title");
+                }
+            }
+        }
+        
+        public MapType Map {
+            get {
+                return this.mapField;
+            }
+            set {
+                if ((this.mapField != null)) {
+                    if ((mapField.Equals(value) != true)) {
+                        this.mapField = value;
+                        this.OnPropertyChanged("Map");
+                    }
+                }
+                else {
+                    this.mapField = value;
+                    this.OnPropertyChanged("Map");
+                }
+            }
+        }
+        
+        public bool EnablePingServer {
+            get {
+                return this.enablePingServerField;
+            }
+            set {
+                if ((enablePingServerField.Equals(value) != true)) {
+                    this.enablePingServerField = value;
+                    this.OnPropertyChanged("EnablePingServer");
+                }
+            }
+        }
+
+        public ToolBarType ToolBar {
+            get {
+                return this.toolBarField;
+            }
+            set {
+                if ((this.toolBarField != null)) {
+                    if ((toolBarField.Equals(value) != true)) {
+                        this.toolBarField = value;
+                        this.OnPropertyChanged("ToolBar");
+                    }
+                }
+                else {
+                    this.toolBarField = value;
+                    this.OnPropertyChanged("ToolBar");
+                }
+            }
+        }
+        
+        public InformationPaneType InformationPane {
+            get {
+                return this.informationPaneField;
+            }
+            set {
+                if ((this.informationPaneField != null)) {
+                    if ((informationPaneField.Equals(value) != true)) {
+                        this.informationPaneField = value;
+                        this.OnPropertyChanged("InformationPane");
+                    }
+                }
+                else {
+                    this.informationPaneField = value;
+                    this.OnPropertyChanged("InformationPane");
+                }
+            }
+        }
+        
+        public ContextMenuType ContextMenu {
+            get {
+                return this.contextMenuField;
+            }
+            set {
+                if ((this.contextMenuField != null)) {
+                    if ((contextMenuField.Equals(value) != true)) {
+                        this.contextMenuField = value;
+                        this.OnPropertyChanged("ContextMenu");
+                    }
+                }
+                else {
+                    this.contextMenuField = value;
+                    this.OnPropertyChanged("ContextMenu");
+                }
+            }
+        }
+        
+        public TaskPaneType TaskPane {
+            get {
+                return this.taskPaneField;
+            }
+            set {
+                if ((this.taskPaneField != null)) {
+                    if ((taskPaneField.Equals(value) != true)) {
+                        this.taskPaneField = value;
+                        this.OnPropertyChanged("TaskPane");
+                    }
+                }
+                else {
+                    this.taskPaneField = value;
+                    this.OnPropertyChanged("TaskPane");
+                }
+            }
+        }
+        
+        public StatusBarType StatusBar {
+            get {
+                return this.statusBarField;
+            }
+            set {
+                if ((this.statusBarField != null)) {
+                    if ((statusBarField.Equals(value) != true)) {
+                        this.statusBarField = value;
+                        this.OnPropertyChanged("StatusBar");
+                    }
+                }
+                else {
+                    this.statusBarField = value;
+                    this.OnPropertyChanged("StatusBar");
+                }
+            }
+        }
+        
+        public ZoomControlType ZoomControl {
+            get {
+                return this.zoomControlField;
+            }
+            set {
+                if ((this.zoomControlField != null)) {
+                    if ((zoomControlField.Equals(value) != true)) {
+                        this.zoomControlField = value;
+                        this.OnPropertyChanged("ZoomControl");
+                    }
+                }
+                else {
+                    this.zoomControlField = value;
+                    this.OnPropertyChanged("ZoomControl");
+                }
+            }
+        }
+        
+        [System.Xml.Serialization.XmlArrayItemAttribute("Command", IsNullable=false)]
+        public BindingList<CommandType> CommandSet {
+            get {
+                return this.commandSetField;
+            }
+            set {
+                if ((this.commandSetField != null)) {
+                    if ((commandSetField.Equals(value) != true)) {
+                        this.commandSetField = value;
+                        this.OnPropertyChanged("CommandSet");
+                    }
+                }
+                else {
+                    this.commandSetField = value;
+                    this.OnPropertyChanged("CommandSet");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(WebLayoutType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current WebLayoutType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            return base.NormalizedSerialize(Serializer, this);
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an WebLayoutType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output WebLayoutType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out WebLayoutType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(WebLayoutType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out WebLayoutType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static WebLayoutType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((WebLayoutType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current WebLayoutType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an WebLayoutType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output WebLayoutType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out WebLayoutType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(WebLayoutType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out WebLayoutType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static WebLayoutType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this WebLayoutType object
+        /// </summary>
+        public virtual WebLayoutType Clone() {
+            return ((WebLayoutType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class MapType : ResourceReferenceType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private MapViewType initialViewField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TargetType hyperlinkTargetField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string hyperlinkTargetFrameField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public MapViewType InitialView {
+            get {
+                return this.initialViewField;
+            }
+            set {
+                if ((this.initialViewField != null)) {
+                    if ((initialViewField.Equals(value) != true)) {
+                        this.initialViewField = value;
+                        this.OnPropertyChanged("InitialView");
+                    }
+                }
+                else {
+                    this.initialViewField = value;
+                    this.OnPropertyChanged("InitialView");
+                }
+            }
+        }
+        
+        public TargetType HyperlinkTarget {
+            get {
+                return this.hyperlinkTargetField;
+            }
+            set {
+                if ((hyperlinkTargetField.Equals(value) != true)) {
+                    this.hyperlinkTargetField = value;
+                    this.OnPropertyChanged("HyperlinkTarget");
+                }
+            }
+        }
+        
+        public string HyperlinkTargetFrame {
+            get {
+                return this.hyperlinkTargetFrameField;
+            }
+            set {
+                if ((this.hyperlinkTargetFrameField != null)) {
+                    if ((hyperlinkTargetFrameField.Equals(value) != true)) {
+                        this.hyperlinkTargetFrameField = value;
+                        this.OnPropertyChanged("HyperlinkTargetFrame");
+                    }
+                }
+                else {
+                    this.hyperlinkTargetFrameField = value;
+                    this.OnPropertyChanged("HyperlinkTargetFrame");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapType));
+                }
+                return serializer;
+            }
+        }
+        
+        /*
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }*/
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current MapType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an MapType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output MapType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out MapType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(MapType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out MapType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static MapType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((MapType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current MapType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an MapType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output MapType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out MapType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(MapType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out MapType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static MapType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this MapType object
+        /// </summary>
+        public virtual MapType Clone() {
+            return ((MapType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class MapViewType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private double centerXField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private double centerYField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private double scaleField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public double CenterX {
+            get {
+                return this.centerXField;
+            }
+            set {
+                if ((centerXField.Equals(value) != true)) {
+                    this.centerXField = value;
+                    this.OnPropertyChanged("CenterX");
+                }
+            }
+        }
+        
+        public double CenterY {
+            get {
+                return this.centerYField;
+            }
+            set {
+                if ((centerYField.Equals(value) != true)) {
+                    this.centerYField = value;
+                    this.OnPropertyChanged("CenterY");
+                }
+            }
+        }
+        
+        public double Scale {
+            get {
+                return this.scaleField;
+            }
+            set {
+                if ((scaleField.Equals(value) != true)) {
+                    this.scaleField = value;
+                    this.OnPropertyChanged("Scale");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapViewType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current MapViewType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an MapViewType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output MapViewType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out MapViewType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(MapViewType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out MapViewType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static MapViewType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((MapViewType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current MapViewType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an MapViewType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output MapViewType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out MapViewType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(MapViewType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out MapViewType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static MapViewType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this MapViewType object
+        /// </summary>
+        public virtual MapViewType Clone() {
+            return ((MapViewType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ParameterPairType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string keyField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string valueField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Key {
+            get {
+                return this.keyField;
+            }
+            set {
+                if ((this.keyField != null)) {
+                    if ((keyField.Equals(value) != true)) {
+                        this.keyField = value;
+                        this.OnPropertyChanged("Key");
+                    }
+                }
+                else {
+                    this.keyField = value;
+                    this.OnPropertyChanged("Key");
+                }
+            }
+        }
+        
+        public string Value {
+            get {
+                return this.valueField;
+            }
+            set {
+                if ((this.valueField != null)) {
+                    if ((valueField.Equals(value) != true)) {
+                        this.valueField = value;
+                        this.OnPropertyChanged("Value");
+                    }
+                }
+                else {
+                    this.valueField = value;
+                    this.OnPropertyChanged("Value");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ParameterPairType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ParameterPairType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ParameterPairType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ParameterPairType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ParameterPairType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ParameterPairType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ParameterPairType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ParameterPairType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ParameterPairType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ParameterPairType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ParameterPairType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ParameterPairType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ParameterPairType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ParameterPairType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ParameterPairType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ParameterPairType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ParameterPairType object
+        /// </summary>
+        public virtual ParameterPairType Clone() {
+            return ((ParameterPairType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ResultColumnType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string nameField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string propertyField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Name {
+            get {
+                return this.nameField;
+            }
+            set {
+                if ((this.nameField != null)) {
+                    if ((nameField.Equals(value) != true)) {
+                        this.nameField = value;
+                        this.OnPropertyChanged("Name");
+                    }
+                }
+                else {
+                    this.nameField = value;
+                    this.OnPropertyChanged("Name");
+                }
+            }
+        }
+        
+        public string Property {
+            get {
+                return this.propertyField;
+            }
+            set {
+                if ((this.propertyField != null)) {
+                    if ((propertyField.Equals(value) != true)) {
+                        this.propertyField = value;
+                        this.OnPropertyChanged("Property");
+                    }
+                }
+                else {
+                    this.propertyField = value;
+                    this.OnPropertyChanged("Property");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ResultColumnType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ResultColumnType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ResultColumnType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ResultColumnType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ResultColumnType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ResultColumnType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ResultColumnType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ResultColumnType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ResultColumnType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ResultColumnType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ResultColumnType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ResultColumnType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ResultColumnType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ResultColumnType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ResultColumnType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ResultColumnType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ResultColumnType object
+        /// </summary>
+        public virtual ResultColumnType Clone() {
+            return ((ResultColumnType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvokeScriptCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(PrintCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetedCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(HelpCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ViewOptionsCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeasureCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetPrintablePageCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SelectWithinCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(BufferCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvokeURLCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(BasicCommandType))]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public abstract partial class CommandType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string nameField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string labelField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string tooltipField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string descriptionField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string imageURLField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string disabledImageURLField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TargetViewerType targetViewerField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Name {
+            get {
+                return this.nameField;
+            }
+            set {
+                if ((this.nameField != null)) {
+                    if ((nameField.Equals(value) != true)) {
+                        this.nameField = value;
+                        this.OnPropertyChanged("Name");
+                    }
+                }
+                else {
+                    this.nameField = value;
+                    this.OnPropertyChanged("Name");
+                }
+            }
+        }
+        
+        public string Label {
+            get {
+                return this.labelField;
+            }
+            set {
+                if ((this.labelField != null)) {
+                    if ((labelField.Equals(value) != true)) {
+                        this.labelField = value;
+                        this.OnPropertyChanged("Label");
+                    }
+                }
+                else {
+                    this.labelField = value;
+                    this.OnPropertyChanged("Label");
+                }
+            }
+        }
+        
+        public string Tooltip {
+            get {
+                return this.tooltipField;
+            }
+            set {
+                if ((this.tooltipField != null)) {
+                    if ((tooltipField.Equals(value) != true)) {
+                        this.tooltipField = value;
+                        this.OnPropertyChanged("Tooltip");
+                    }
+                }
+                else {
+                    this.tooltipField = value;
+                    this.OnPropertyChanged("Tooltip");
+                }
+            }
+        }
+        
+        public string Description {
+            get {
+                return this.descriptionField;
+            }
+            set {
+                if ((this.descriptionField != null)) {
+                    if ((descriptionField.Equals(value) != true)) {
+                        this.descriptionField = value;
+                        this.OnPropertyChanged("Description");
+                    }
+                }
+                else {
+                    this.descriptionField = value;
+                    this.OnPropertyChanged("Description");
+                }
+            }
+        }
+        
+        public string ImageURL {
+            get {
+                return this.imageURLField;
+            }
+            set {
+                if ((this.imageURLField != null)) {
+                    if ((imageURLField.Equals(value) != true)) {
+                        this.imageURLField = value;
+                        this.OnPropertyChanged("ImageURL");
+                    }
+                }
+                else {
+                    this.imageURLField = value;
+                    this.OnPropertyChanged("ImageURL");
+                }
+            }
+        }
+        
+        public string DisabledImageURL {
+            get {
+                return this.disabledImageURLField;
+            }
+            set {
+                if ((this.disabledImageURLField != null)) {
+                    if ((disabledImageURLField.Equals(value) != true)) {
+                        this.disabledImageURLField = value;
+                        this.OnPropertyChanged("DisabledImageURL");
+                    }
+                }
+                else {
+                    this.disabledImageURLField = value;
+                    this.OnPropertyChanged("DisabledImageURL");
+                }
+            }
+        }
+        
+        public TargetViewerType TargetViewer {
+            get {
+                return this.targetViewerField;
+            }
+            set {
+                if ((targetViewerField.Equals(value) != true)) {
+                    this.targetViewerField = value;
+                    this.OnPropertyChanged("TargetViewer");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(CommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current CommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an CommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output CommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out CommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out CommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static CommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((CommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current CommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an CommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output CommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out CommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out CommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static CommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this CommandType object
+        /// </summary>
+        public virtual CommandType Clone() {
+            return ((CommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvokeScriptCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(PrintCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetedCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(HelpCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ViewOptionsCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeasureCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetPrintablePageCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SelectWithinCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(BufferCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvokeURLCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchCommandType))]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public abstract partial class CustomCommandType : CommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(CustomCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current CustomCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an CustomCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output CustomCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out CustomCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CustomCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out CustomCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static CustomCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((CustomCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current CustomCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an CustomCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output CustomCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out CustomCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CustomCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out CustomCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static CustomCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this CustomCommandType object
+        /// </summary>
+        public virtual CustomCommandType Clone() {
+            return ((CustomCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class InvokeScriptCommandType : CustomCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string scriptField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Script {
+            get {
+                return this.scriptField;
+            }
+            set {
+                if ((this.scriptField != null)) {
+                    if ((scriptField.Equals(value) != true)) {
+                        this.scriptField = value;
+                        this.OnPropertyChanged("Script");
+                    }
+                }
+                else {
+                    this.scriptField = value;
+                    this.OnPropertyChanged("Script");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(InvokeScriptCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current InvokeScriptCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an InvokeScriptCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output InvokeScriptCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out InvokeScriptCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(InvokeScriptCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out InvokeScriptCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static InvokeScriptCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((InvokeScriptCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current InvokeScriptCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an InvokeScriptCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output InvokeScriptCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out InvokeScriptCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(InvokeScriptCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out InvokeScriptCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static InvokeScriptCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this InvokeScriptCommandType object
+        /// </summary>
+        public virtual InvokeScriptCommandType Clone() {
+            return ((InvokeScriptCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class PrintCommandType : CustomCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<ResourceReferenceType> printLayoutField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        [System.Xml.Serialization.XmlElementAttribute("PrintLayout")]
+        public BindingList<ResourceReferenceType> PrintLayout {
+            get {
+                return this.printLayoutField;
+            }
+            set {
+                if ((this.printLayoutField != null)) {
+                    if ((printLayoutField.Equals(value) != true)) {
+                        this.printLayoutField = value;
+                        this.OnPropertyChanged("PrintLayout");
+                    }
+                }
+                else {
+                    this.printLayoutField = value;
+                    this.OnPropertyChanged("PrintLayout");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(PrintCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current PrintCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an PrintCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output PrintCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out PrintCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(PrintCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out PrintCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static PrintCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((PrintCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current PrintCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an PrintCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output PrintCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out PrintCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(PrintCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out PrintCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static PrintCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this PrintCommandType object
+        /// </summary>
+        public virtual PrintCommandType Clone() {
+            return ((PrintCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(MapType))]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ResourceReferenceType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string resourceIdField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string ResourceId {
+            get {
+                return this.resourceIdField;
+            }
+            set {
+                if ((this.resourceIdField != null)) {
+                    if ((resourceIdField.Equals(value) != true)) {
+                        this.resourceIdField = value;
+                        this.OnPropertyChanged("ResourceId");
+                    }
+                }
+                else {
+                    this.resourceIdField = value;
+                    this.OnPropertyChanged("ResourceId");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ResourceReferenceType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ResourceReferenceType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ResourceReferenceType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ResourceReferenceType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ResourceReferenceType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ResourceReferenceType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ResourceReferenceType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ResourceReferenceType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ResourceReferenceType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ResourceReferenceType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ResourceReferenceType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ResourceReferenceType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ResourceReferenceType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ResourceReferenceType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ResourceReferenceType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ResourceReferenceType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ResourceReferenceType object
+        /// </summary>
+        public virtual ResourceReferenceType Clone() {
+            return ((ResourceReferenceType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(HelpCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ViewOptionsCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeasureCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetPrintablePageCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SelectWithinCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(BufferCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvokeURLCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchCommandType))]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public abstract partial class TargetedCommandType : CustomCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TargetType targetField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string targetFrameField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public TargetType Target {
+            get {
+                return this.targetField;
+            }
+            set {
+                if ((targetField.Equals(value) != true)) {
+                    this.targetField = value;
+                    this.OnPropertyChanged("Target");
+                }
+            }
+        }
+        
+        public string TargetFrame {
+            get {
+                return this.targetFrameField;
+            }
+            set {
+                if ((this.targetFrameField != null)) {
+                    if ((targetFrameField.Equals(value) != true)) {
+                        this.targetFrameField = value;
+                        this.OnPropertyChanged("TargetFrame");
+                    }
+                }
+                else {
+                    this.targetFrameField = value;
+                    this.OnPropertyChanged("TargetFrame");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(TargetedCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current TargetedCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an TargetedCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output TargetedCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out TargetedCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TargetedCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out TargetedCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static TargetedCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((TargetedCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current TargetedCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an TargetedCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output TargetedCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out TargetedCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TargetedCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out TargetedCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static TargetedCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this TargetedCommandType object
+        /// </summary>
+        public virtual TargetedCommandType Clone() {
+            return ((TargetedCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class HelpCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string uRLField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string URL {
+            get {
+                return this.uRLField;
+            }
+            set {
+                if ((this.uRLField != null)) {
+                    if ((uRLField.Equals(value) != true)) {
+                        this.uRLField = value;
+                        this.OnPropertyChanged("URL");
+                    }
+                }
+                else {
+                    this.uRLField = value;
+                    this.OnPropertyChanged("URL");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(HelpCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current HelpCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an HelpCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output HelpCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out HelpCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(HelpCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out HelpCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static HelpCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((HelpCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current HelpCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an HelpCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output HelpCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out HelpCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(HelpCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out HelpCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static HelpCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this HelpCommandType object
+        /// </summary>
+        public virtual HelpCommandType Clone() {
+            return ((HelpCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ViewOptionsCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ViewOptionsCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ViewOptionsCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ViewOptionsCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ViewOptionsCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ViewOptionsCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ViewOptionsCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ViewOptionsCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ViewOptionsCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ViewOptionsCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ViewOptionsCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ViewOptionsCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ViewOptionsCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ViewOptionsCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ViewOptionsCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ViewOptionsCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ViewOptionsCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ViewOptionsCommandType object
+        /// </summary>
+        public virtual ViewOptionsCommandType Clone() {
+            return ((ViewOptionsCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class MeasureCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(MeasureCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current MeasureCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an MeasureCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output MeasureCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out MeasureCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(MeasureCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out MeasureCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static MeasureCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((MeasureCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current MeasureCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an MeasureCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output MeasureCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out MeasureCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(MeasureCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out MeasureCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static MeasureCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this MeasureCommandType object
+        /// </summary>
+        public virtual MeasureCommandType Clone() {
+            return ((MeasureCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class GetPrintablePageCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(GetPrintablePageCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current GetPrintablePageCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an GetPrintablePageCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output GetPrintablePageCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out GetPrintablePageCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(GetPrintablePageCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out GetPrintablePageCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static GetPrintablePageCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((GetPrintablePageCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current GetPrintablePageCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an GetPrintablePageCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output GetPrintablePageCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out GetPrintablePageCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(GetPrintablePageCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out GetPrintablePageCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static GetPrintablePageCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this GetPrintablePageCommandType object
+        /// </summary>
+        public virtual GetPrintablePageCommandType Clone() {
+            return ((GetPrintablePageCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class SelectWithinCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(SelectWithinCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current SelectWithinCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an SelectWithinCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output SelectWithinCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out SelectWithinCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(SelectWithinCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out SelectWithinCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static SelectWithinCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((SelectWithinCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current SelectWithinCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an SelectWithinCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output SelectWithinCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out SelectWithinCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(SelectWithinCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out SelectWithinCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static SelectWithinCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this SelectWithinCommandType object
+        /// </summary>
+        public virtual SelectWithinCommandType Clone() {
+            return ((SelectWithinCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class BufferCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(BufferCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current BufferCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an BufferCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output BufferCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out BufferCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(BufferCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out BufferCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static BufferCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((BufferCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current BufferCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an BufferCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output BufferCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out BufferCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(BufferCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out BufferCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static BufferCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this BufferCommandType object
+        /// </summary>
+        public virtual BufferCommandType Clone() {
+            return ((BufferCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class InvokeURLCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string uRLField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<string> layerSetField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<ParameterPairType> additionalParameterField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private bool disableIfSelectionEmptyField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string URL {
+            get {
+                return this.uRLField;
+            }
+            set {
+                if ((this.uRLField != null)) {
+                    if ((uRLField.Equals(value) != true)) {
+                        this.uRLField = value;
+                        this.OnPropertyChanged("URL");
+                    }
+                }
+                else {
+                    this.uRLField = value;
+                    this.OnPropertyChanged("URL");
+                }
+            }
+        }
+        
+        [System.Xml.Serialization.XmlArrayItemAttribute("Layer", IsNullable=false)]
+        public BindingList<string> LayerSet {
+            get {
+                return this.layerSetField;
+            }
+            set {
+                if ((this.layerSetField != null)) {
+                    if ((layerSetField.Equals(value) != true)) {
+                        this.layerSetField = value;
+                        this.OnPropertyChanged("LayerSet");
+                    }
+                }
+                else {
+                    this.layerSetField = value;
+                    this.OnPropertyChanged("LayerSet");
+                }
+            }
+        }
+        
+        [System.Xml.Serialization.XmlElementAttribute("AdditionalParameter")]
+        public BindingList<ParameterPairType> AdditionalParameter {
+            get {
+                return this.additionalParameterField;
+            }
+            set {
+                if ((this.additionalParameterField != null)) {
+                    if ((additionalParameterField.Equals(value) != true)) {
+                        this.additionalParameterField = value;
+                        this.OnPropertyChanged("AdditionalParameter");
+                    }
+                }
+                else {
+                    this.additionalParameterField = value;
+                    this.OnPropertyChanged("AdditionalParameter");
+                }
+            }
+        }
+        
+        public bool DisableIfSelectionEmpty {
+            get {
+                return this.disableIfSelectionEmptyField;
+            }
+            set {
+                if ((disableIfSelectionEmptyField.Equals(value) != true)) {
+                    this.disableIfSelectionEmptyField = value;
+                    this.OnPropertyChanged("DisableIfSelectionEmpty");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(InvokeURLCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current InvokeURLCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an InvokeURLCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output InvokeURLCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out InvokeURLCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(InvokeURLCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out InvokeURLCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static InvokeURLCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((InvokeURLCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current InvokeURLCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an InvokeURLCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output InvokeURLCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out InvokeURLCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(InvokeURLCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out InvokeURLCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static InvokeURLCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this InvokeURLCommandType object
+        /// </summary>
+        public virtual InvokeURLCommandType Clone() {
+            return ((InvokeURLCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class SearchCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string layerField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string promptField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<ResultColumnType> resultColumnsField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string filterField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string matchLimitField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Layer {
+            get {
+                return this.layerField;
+            }
+            set {
+                if ((this.layerField != null)) {
+                    if ((layerField.Equals(value) != true)) {
+                        this.layerField = value;
+                        this.OnPropertyChanged("Layer");
+                    }
+                }
+                else {
+                    this.layerField = value;
+                    this.OnPropertyChanged("Layer");
+                }
+            }
+        }
+        
+        public string Prompt {
+            get {
+                return this.promptField;
+            }
+            set {
+                if ((this.promptField != null)) {
+                    if ((promptField.Equals(value) != true)) {
+                        this.promptField = value;
+                        this.OnPropertyChanged("Prompt");
+                    }
+                }
+                else {
+                    this.promptField = value;
+                    this.OnPropertyChanged("Prompt");
+                }
+            }
+        }
+        
+        [System.Xml.Serialization.XmlArrayItemAttribute("Column", IsNullable=false)]
+        public BindingList<ResultColumnType> ResultColumns {
+            get {
+                return this.resultColumnsField;
+            }
+            set {
+                if ((this.resultColumnsField != null)) {
+                    if ((resultColumnsField.Equals(value) != true)) {
+                        this.resultColumnsField = value;
+                        this.OnPropertyChanged("ResultColumns");
+                    }
+                }
+                else {
+                    this.resultColumnsField = value;
+                    this.OnPropertyChanged("ResultColumns");
+                }
+            }
+        }
+        
+        public string Filter {
+            get {
+                return this.filterField;
+            }
+            set {
+                if ((this.filterField != null)) {
+                    if ((filterField.Equals(value) != true)) {
+                        this.filterField = value;
+                        this.OnPropertyChanged("Filter");
+                    }
+                }
+                else {
+                    this.filterField = value;
+                    this.OnPropertyChanged("Filter");
+                }
+            }
+        }
+        
+        [System.Xml.Serialization.XmlElementAttribute(DataType="integer")]
+        public string MatchLimit {
+            get {
+                return this.matchLimitField;
+            }
+            set {
+                if ((this.matchLimitField != null)) {
+                    if ((matchLimitField.Equals(value) != true)) {
+                        this.matchLimitField = value;
+                        this.OnPropertyChanged("MatchLimit");
+                    }
+                }
+                else {
+                    this.matchLimitField = value;
+                    this.OnPropertyChanged("MatchLimit");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(SearchCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current SearchCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an SearchCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output SearchCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out SearchCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(SearchCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out SearchCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static SearchCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((SearchCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current SearchCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an SearchCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output SearchCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out SearchCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(SearchCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out SearchCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static SearchCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this SearchCommandType object
+        /// </summary>
+        public virtual SearchCommandType Clone() {
+            return ((SearchCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class BasicCommandType : CommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BasicCommandActionType actionField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public BasicCommandActionType Action {
+            get {
+                return this.actionField;
+            }
+            set {
+                if ((actionField.Equals(value) != true)) {
+                    this.actionField = value;
+                    this.OnPropertyChanged("Action");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(BasicCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current BasicCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an BasicCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output BasicCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out BasicCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(BasicCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out BasicCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static BasicCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((BasicCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current BasicCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an BasicCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output BasicCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out BasicCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(BasicCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out BasicCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static BasicCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this BasicCommandType object
+        /// </summary>
+        public virtual BasicCommandType Clone() {
+            return ((BasicCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(CommandItemType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SeparatorItemType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlyoutItemType))]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class UIItemType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private UIItemFunctionType functionField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public UIItemFunctionType Function {
+            get {
+                return this.functionField;
+            }
+            set {
+                if ((functionField.Equals(value) != true)) {
+                    this.functionField = value;
+                    this.OnPropertyChanged("Function");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(UIItemType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current UIItemType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an UIItemType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output UIItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out UIItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(UIItemType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out UIItemType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static UIItemType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((UIItemType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current UIItemType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an UIItemType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output UIItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out UIItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(UIItemType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out UIItemType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static UIItemType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this UIItemType object
+        /// </summary>
+        public virtual UIItemType Clone() {
+            return ((UIItemType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class CommandItemType : UIItemType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string commandField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Command {
+            get {
+                return this.commandField;
+            }
+            set {
+                if ((this.commandField != null)) {
+                    if ((commandField.Equals(value) != true)) {
+                        this.commandField = value;
+                        this.OnPropertyChanged("Command");
+                    }
+                }
+                else {
+                    this.commandField = value;
+                    this.OnPropertyChanged("Command");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(CommandItemType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current CommandItemType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an CommandItemType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output CommandItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out CommandItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CommandItemType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out CommandItemType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static CommandItemType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((CommandItemType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current CommandItemType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an CommandItemType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output CommandItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out CommandItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CommandItemType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out CommandItemType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static CommandItemType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this CommandItemType object
+        /// </summary>
+        public virtual CommandItemType Clone() {
+            return ((CommandItemType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class SeparatorItemType : UIItemType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(SeparatorItemType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current SeparatorItemType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an SeparatorItemType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output SeparatorItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out SeparatorItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(SeparatorItemType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out SeparatorItemType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static SeparatorItemType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((SeparatorItemType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current SeparatorItemType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an SeparatorItemType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output SeparatorItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out SeparatorItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(SeparatorItemType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out SeparatorItemType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static SeparatorItemType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this SeparatorItemType object
+        /// </summary>
+        public virtual SeparatorItemType Clone() {
+            return ((SeparatorItemType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class FlyoutItemType : UIItemType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string labelField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string tooltipField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string descriptionField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string imageURLField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string disabledImageURLField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<UIItemType> subItemField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Label {
+            get {
+                return this.labelField;
+            }
+            set {
+                if ((this.labelField != null)) {
+                    if ((labelField.Equals(value) != true)) {
+                        this.labelField = value;
+                        this.OnPropertyChanged("Label");
+                    }
+                }
+                else {
+                    this.labelField = value;
+                    this.OnPropertyChanged("Label");
+                }
+            }
+        }
+        
+        public string Tooltip {
+            get {
+                return this.tooltipField;
+            }
+            set {
+                if ((this.tooltipField != null)) {
+                    if ((tooltipField.Equals(value) != true)) {
+                        this.tooltipField = value;
+                        this.OnPropertyChanged("Tooltip");
+                    }
+                }
+                else {
+                    this.tooltipField = value;
+                    this.OnPropertyChanged("Tooltip");
+                }
+            }
+        }
+        
+        public string Description {
+            get {
+                return this.descriptionField;
+            }
+            set {
+                if ((this.descriptionField != null)) {
+                    if ((descriptionField.Equals(value) != true)) {
+                        this.descriptionField = value;
+                        this.OnPropertyChanged("Description");
+                    }
+                }
+                else {
+                    this.descriptionField = value;
+                    this.OnPropertyChanged("Description");
+                }
+            }
+        }
+        
+        public string ImageURL {
+            get {
+                return this.imageURLField;
+            }
+            set {
+                if ((this.imageURLField != null)) {
+                    if ((imageURLField.Equals(value) != true)) {
+                        this.imageURLField = value;
+                        this.OnPropertyChanged("ImageURL");
+                    }
+                }
+                else {
+                    this.imageURLField = value;
+                    this.OnPropertyChanged("ImageURL");
+                }
+            }
+        }
+        
+        public string DisabledImageURL {
+            get {
+                return this.disabledImageURLField;
+            }
+            set {
+                if ((this.disabledImageURLField != null)) {
+                    if ((disabledImageURLField.Equals(value) != true)) {
+                        this.disabledImageURLField = value;
+                        this.OnPropertyChanged("DisabledImageURL");
+                    }
+                }
+                else {
+                    this.disabledImageURLField = value;
+                    this.OnPropertyChanged("DisabledImageURL");
+                }
+            }
+        }
+        
+        [System.Xml.Serialization.XmlElementAttribute("SubItem")]
+        public BindingList<UIItemType> SubItem {
+            get {
+                return this.subItemField;
+            }
+            set {
+                if ((this.subItemField != null)) {
+                    if ((subItemField.Equals(value) != true)) {
+                        this.subItemField = value;
+                        this.OnPropertyChanged("SubItem");
+                    }
+                }
+                else {
+                    this.subItemField = value;
+                    this.OnPropertyChanged("SubItem");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(FlyoutItemType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current FlyoutItemType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an FlyoutItemType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output FlyoutItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out FlyoutItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(FlyoutItemType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out FlyoutItemType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static FlyoutItemType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((FlyoutItemType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current FlyoutItemType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an FlyoutItemType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output FlyoutItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out FlyoutItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(FlyoutItemType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out FlyoutItemType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static FlyoutItemType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this FlyoutItemType object
+        /// </summary>
+        public virtual FlyoutItemType Clone() {
+            return ((FlyoutItemType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class TaskButtonType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string nameField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string tooltipField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string descriptionField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string imageURLField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string disabledImageURLField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Name {
+            get {
+                return this.nameField;
+            }
+            set {
+                if ((this.nameField != null)) {
+                    if ((nameField.Equals(value) != true)) {
+                        this.nameField = value;
+                        this.OnPropertyChanged("Name");
+                    }
+                }
+                else {
+                    this.nameField = value;
+                    this.OnPropertyChanged("Name");
+                }
+            }
+        }
+        
+        public string Tooltip {
+            get {
+                return this.tooltipField;
+            }
+            set {
+                if ((this.tooltipField != null)) {
+                    if ((tooltipField.Equals(value) != true)) {
+                        this.tooltipField = value;
+                        this.OnPropertyChanged("Tooltip");
+                    }
+                }
+                else {
+                    this.tooltipField = value;
+                    this.OnPropertyChanged("Tooltip");
+                }
+            }
+        }
+        
+        public string Description {
+            get {
+                return this.descriptionField;
+            }
+            set {
+                if ((this.descriptionField != null)) {
+                    if ((descriptionField.Equals(value) != true)) {
+                        this.descriptionField = value;
+                        this.OnPropertyChanged("Description");
+                    }
+                }
+                else {
+                    this.descriptionField = value;
+                    this.OnPropertyChanged("Description");
+                }
+            }
+        }
+        
+        public string ImageURL {
+            get {
+                return this.imageURLField;
+            }
+            set {
+                if ((this.imageURLField != null)) {
+                    if ((imageURLField.Equals(value) != true)) {
+                        this.imageURLField = value;
+                        this.OnPropertyChanged("ImageURL");
+                    }
+                }
+                else {
+                    this.imageURLField = value;
+                    this.OnPropertyChanged("ImageURL");
+                }
+            }
+        }
+        
+        public string DisabledImageURL {
+            get {
+                return this.disabledImageURLField;
+            }
+            set {
+                if ((this.disabledImageURLField != null)) {
+                    if ((disabledImageURLField.Equals(value) != true)) {
+                        this.disabledImageURLField = value;
+                        this.OnPropertyChanged("DisabledImageURL");
+                    }
+                }
+                else {
+                    this.disabledImageURLField = value;
+                    this.OnPropertyChanged("DisabledImageURL");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(TaskButtonType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current TaskButtonType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an TaskButtonType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output TaskButtonType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out TaskButtonType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TaskButtonType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out TaskButtonType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static TaskButtonType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((TaskButtonType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current TaskButtonType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an TaskButtonType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output TaskButtonType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out TaskButtonType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TaskButtonType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out TaskButtonType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static TaskButtonType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this TaskButtonType object
+        /// </summary>
+        public virtual TaskButtonType Clone() {
+            return ((TaskButtonType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ZoomControlType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(StatusBarType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContextMenuType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ToolBarType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(TaskBarType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(WebLayoutResizableControlType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(TaskPaneType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(InformationPaneType))]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class WebLayoutControlType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private bool visibleField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public bool Visible {
+            get {
+                return this.visibleField;
+            }
+            set {
+                if ((visibleField.Equals(value) != true)) {
+                    this.visibleField = value;
+                    this.OnPropertyChanged("Visible");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(WebLayoutControlType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current WebLayoutControlType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an WebLayoutControlType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output WebLayoutControlType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out WebLayoutControlType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(WebLayoutControlType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out WebLayoutControlType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static WebLayoutControlType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((WebLayoutControlType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current WebLayoutControlType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an WebLayoutControlType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output WebLayoutControlType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out WebLayoutControlType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(WebLayoutControlType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out WebLayoutControlType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static WebLayoutControlType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this WebLayoutControlType object
+        /// </summary>
+        public virtual WebLayoutControlType Clone() {
+            return ((WebLayoutControlType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ZoomControlType : WebLayoutControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ZoomControlType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ZoomControlType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ZoomControlType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ZoomControlType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ZoomControlType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ZoomControlType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ZoomControlType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ZoomControlType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ZoomControlType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ZoomControlType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ZoomControlType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ZoomControlType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ZoomControlType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ZoomControlType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ZoomControlType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ZoomControlType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ZoomControlType object
+        /// </summary>
+        public virtual ZoomControlType Clone() {
+            return ((ZoomControlType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class StatusBarType : WebLayoutControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(StatusBarType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current StatusBarType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an StatusBarType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output StatusBarType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out StatusBarType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(StatusBarType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out StatusBarType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static StatusBarType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((StatusBarType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current StatusBarType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an StatusBarType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output StatusBarType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out StatusBarType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(StatusBarType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out StatusBarType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static StatusBarType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this StatusBarType object
+        /// </summary>
+        public virtual StatusBarType Clone() {
+            return ((StatusBarType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ContextMenuType : WebLayoutControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<UIItemType> menuItemField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        [System.Xml.Serialization.XmlElementAttribute("MenuItem")]
+        public BindingList<UIItemType> MenuItem {
+            get {
+                return this.menuItemField;
+            }
+            set {
+                if ((this.menuItemField != null)) {
+                    if ((menuItemField.Equals(value) != true)) {
+                        this.menuItemField = value;
+                        this.OnPropertyChanged("MenuItem");
+                    }
+                }
+                else {
+                    this.menuItemField = value;
+                    this.OnPropertyChanged("MenuItem");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ContextMenuType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ContextMenuType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ContextMenuType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ContextMenuType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ContextMenuType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ContextMenuType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ContextMenuType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ContextMenuType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ContextMenuType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ContextMenuType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ContextMenuType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ContextMenuType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ContextMenuType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ContextMenuType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ContextMenuType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ContextMenuType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ContextMenuType object
+        /// </summary>
+        public virtual ContextMenuType Clone() {
+            return ((ContextMenuType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ToolBarType : WebLayoutControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<UIItemType> buttonField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        [System.Xml.Serialization.XmlElementAttribute("Button")]
+        public BindingList<UIItemType> Button {
+            get {
+                return this.buttonField;
+            }
+            set {
+                if ((this.buttonField != null)) {
+                    if ((buttonField.Equals(value) != true)) {
+                        this.buttonField = value;
+                        this.OnPropertyChanged("Button");
+                    }
+                }
+                else {
+                    this.buttonField = value;
+                    this.OnPropertyChanged("Button");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ToolBarType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ToolBarType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ToolBarType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ToolBarType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ToolBarType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ToolBarType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ToolBarType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ToolBarType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ToolBarType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ToolBarType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ToolBarType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ToolBarType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ToolBarType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ToolBarType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ToolBarType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ToolBarType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ToolBarType object
+        /// </summary>
+        public virtual ToolBarType Clone() {
+            return ((ToolBarType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class TaskBarType : WebLayoutControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TaskButtonType homeField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TaskButtonType forwardField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TaskButtonType backField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TaskButtonType tasksField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<UIItemType> menuButtonField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public TaskButtonType Home {
+            get {
+                return this.homeField;
+            }
+            set {
+                if ((this.homeField != null)) {
+                    if ((homeField.Equals(value) != true)) {
+                        this.homeField = value;
+                        this.OnPropertyChanged("Home");
+                    }
+                }
+                else {
+                    this.homeField = value;
+                    this.OnPropertyChanged("Home");
+                }
+            }
+        }
+        
+        public TaskButtonType Forward {
+            get {
+                return this.forwardField;
+            }
+            set {
+                if ((this.forwardField != null)) {
+                    if ((forwardField.Equals(value) != true)) {
+                        this.forwardField = value;
+                        this.OnPropertyChanged("Forward");
+                    }
+                }
+                else {
+                    this.forwardField = value;
+                    this.OnPropertyChanged("Forward");
+                }
+            }
+        }
+        
+        public TaskButtonType Back {
+            get {
+                return this.backField;
+            }
+            set {
+                if ((this.backField != null)) {
+                    if ((backField.Equals(value) != true)) {
+                        this.backField = value;
+                        this.OnPropertyChanged("Back");
+                    }
+                }
+                else {
+                    this.backField = value;
+                    this.OnPropertyChanged("Back");
+                }
+            }
+        }
+        
+        public TaskButtonType Tasks {
+            get {
+                return this.tasksField;
+            }
+            set {
+                if ((this.tasksField != null)) {
+                    if ((tasksField.Equals(value) != true)) {
+                        this.tasksField = value;
+                        this.OnPropertyChanged("Tasks");
+                    }
+                }
+                else {
+                    this.tasksField = value;
+                    this.OnPropertyChanged("Tasks");
+                }
+            }
+        }
+        
+        [System.Xml.Serialization.XmlElementAttribute("MenuButton")]
+        public BindingList<UIItemType> MenuButton {
+            get {
+                return this.menuButtonField;
+            }
+            set {
+                if ((this.menuButtonField != null)) {
+                    if ((menuButtonField.Equals(value) != true)) {
+                        this.menuButtonField = value;
+                        this.OnPropertyChanged("MenuButton");
+                    }
+                }
+                else {
+                    this.menuButtonField = value;
+                    this.OnPropertyChanged("MenuButton");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(TaskBarType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current TaskBarType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an TaskBarType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output TaskBarType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out TaskBarType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TaskBarType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out TaskBarType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static TaskBarType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((TaskBarType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current TaskBarType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an TaskBarType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output TaskBarType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out TaskBarType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TaskBarType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out TaskBarType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static TaskBarType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this TaskBarType object
+        /// </summary>
+        public virtual TaskBarType Clone() {
+            return ((TaskBarType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(TaskPaneType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(InformationPaneType))]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class WebLayoutResizableControlType : WebLayoutControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private int widthField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public int Width {
+            get {
+                return this.widthField;
+            }
+            set {
+                if ((widthField.Equals(value) != true)) {
+                    this.widthField = value;
+                    this.OnPropertyChanged("Width");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(WebLayoutResizableControlType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current WebLayoutResizableControlType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an WebLayoutResizableControlType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output WebLayoutResizableControlType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out WebLayoutResizableControlType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(WebLayoutResizableControlType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out WebLayoutResizableControlType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static WebLayoutResizableControlType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((WebLayoutResizableControlType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current WebLayoutResizableControlType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an WebLayoutResizableControlType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output WebLayoutResizableControlType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out WebLayoutResizableControlType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(WebLayoutResizableControlType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out WebLayoutResizableControlType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static WebLayoutResizableControlType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this WebLayoutResizableControlType object
+        /// </summary>
+        public virtual WebLayoutResizableControlType Clone() {
+            return ((WebLayoutResizableControlType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class TaskPaneType : WebLayoutResizableControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TaskBarType taskBarField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string initialTaskField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public TaskBarType TaskBar {
+            get {
+                return this.taskBarField;
+            }
+            set {
+                if ((this.taskBarField != null)) {
+                    if ((taskBarField.Equals(value) != true)) {
+                        this.taskBarField = value;
+                        this.OnPropertyChanged("TaskBar");
+                    }
+                }
+                else {
+                    this.taskBarField = value;
+                    this.OnPropertyChanged("TaskBar");
+                }
+            }
+        }
+        
+        public string InitialTask {
+            get {
+                return this.initialTaskField;
+            }
+            set {
+                if ((this.initialTaskField != null)) {
+                    if ((initialTaskField.Equals(value) != true)) {
+                        this.initialTaskField = value;
+                        this.OnPropertyChanged("InitialTask");
+                    }
+                }
+                else {
+                    this.initialTaskField = value;
+                    this.OnPropertyChanged("InitialTask");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(TaskPaneType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current TaskPaneType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an TaskPaneType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output TaskPaneType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out TaskPaneType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TaskPaneType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out TaskPaneType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static TaskPaneType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((TaskPaneType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current TaskPaneType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an TaskPaneType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output TaskPaneType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out TaskPaneType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TaskPaneType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out TaskPaneType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static TaskPaneType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this TaskPaneType object
+        /// </summary>
+        public virtual TaskPaneType Clone() {
+            return ((TaskPaneType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class InformationPaneType : WebLayoutResizableControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private bool legendVisibleField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private bool propertiesVisibleField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public bool LegendVisible {
+            get {
+                return this.legendVisibleField;
+            }
+            set {
+                if ((legendVisibleField.Equals(value) != true)) {
+                    this.legendVisibleField = value;
+                    this.OnPropertyChanged("LegendVisible");
+                }
+            }
+        }
+        
+        public bool PropertiesVisible {
+            get {
+                return this.propertiesVisibleField;
+            }
+            set {
+                if ((propertiesVisibleField.Equals(value) != true)) {
+                    this.propertiesVisibleField = value;
+                    this.OnPropertyChanged("PropertiesVisible");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(InformationPaneType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current InformationPaneType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an InformationPaneType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output InformationPaneType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out InformationPaneType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(InformationPaneType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out InformationPaneType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static InformationPaneType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((InformationPaneType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current InformationPaneType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an InformationPaneType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output InformationPaneType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out InformationPaneType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(InformationPaneType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out InformationPaneType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static InformationPaneType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this InformationPaneType object
+        /// </summary>
+        public virtual InformationPaneType Clone() {
+            return ((InformationPaneType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class CommandSetType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<CommandType> commandField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        [System.Xml.Serialization.XmlElementAttribute("Command")]
+        public BindingList<CommandType> Command {
+            get {
+                return this.commandField;
+            }
+            set {
+                if ((this.commandField != null)) {
+                    if ((commandField.Equals(value) != true)) {
+                        this.commandField = value;
+                        this.OnPropertyChanged("Command");
+                    }
+                }
+                else {
+                    this.commandField = value;
+                    this.OnPropertyChanged("Command");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(CommandSetType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current CommandSetType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an CommandSetType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output CommandSetType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out CommandSetType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CommandSetType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out CommandSetType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static CommandSetType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((CommandSetType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current CommandSetType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an CommandSetType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output CommandSetType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out CommandSetType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CommandSetType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out CommandSetType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static CommandSetType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this CommandSetType object
+        /// </summary>
+        public virtual CommandSetType Clone() {
+            return ((CommandSetType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class LayerSetType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<string> layerField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        [System.Xml.Serialization.XmlElementAttribute("Layer")]
+        public BindingList<string> Layer {
+            get {
+                return this.layerField;
+            }
+            set {
+                if ((this.layerField != null)) {
+                    if ((layerField.Equals(value) != true)) {
+                        this.layerField = value;
+                        this.OnPropertyChanged("Layer");
+                    }
+                }
+                else {
+                    this.layerField = value;
+                    this.OnPropertyChanged("Layer");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(LayerSetType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current LayerSetType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an LayerSetType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output LayerSetType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out LayerSetType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(LayerSetType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out LayerSetType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static LayerSetType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((LayerSetType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current LayerSetType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an LayerSetType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output LayerSetType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out LayerSetType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(LayerSetType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out LayerSetType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static LayerSetType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this LayerSetType object
+        /// </summary>
+        public virtual LayerSetType Clone() {
+            return ((LayerSetType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ResultColumnSetType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<ResultColumnType> columnField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        [System.Xml.Serialization.XmlElementAttribute("Column")]
+        public BindingList<ResultColumnType> Column {
+            get {
+                return this.columnField;
+            }
+            set {
+                if ((this.columnField != null)) {
+                    if ((columnField.Equals(value) != true)) {
+                        this.columnField = value;
+                        this.OnPropertyChanged("Column");
+                    }
+                }
+                else {
+                    this.columnField = value;
+                    this.OnPropertyChanged("Column");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ResultColumnSetType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ResultColumnSetType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ResultColumnSetType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ResultColumnSetType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ResultColumnSetType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ResultColumnSetType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ResultColumnSetType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ResultColumnSetType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ResultColumnSetType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ResultColumnSetType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ResultColumnSetType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ResultColumnSetType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ResultColumnSetType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ResultColumnSetType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ResultColumnSetType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ResultColumnSetType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ResultColumnSetType object
+        /// </summary>
+        public virtual ResultColumnSetType Clone() {
+            return ((ResultColumnSetType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+}

Added: trunk/Tools/Maestro/Generated/WebLayout-2.6.0.designer.cs
===================================================================
--- trunk/Tools/Maestro/Generated/WebLayout-2.6.0.designer.cs	                        (rev 0)
+++ trunk/Tools/Maestro/Generated/WebLayout-2.6.0.designer.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,8313 @@
+#pragma warning disable 1591, 0114, 0108
+// ------------------------------------------------------------------------------
+//  <auto-generated>
+//    Generated by Xsd2Code. Version 3.3.0.33001
+//    <NameSpace>OSGeo.MapGuide.ObjectModels.WebLayout</NameSpace><Collection>BindingList</Collection><codeType>CSharp</codeType><EnableDataBinding>True</EnableDataBinding><EnableLasyLoading>False</EnableLasyLoading><HidePrivateFieldInIDE>True</HidePrivateFieldInIDE><EnableSummaryComment>True</EnableSummaryComment><IncludeSerializeMethod>True</IncludeSerializeMethod><UseBaseClass>False</UseBaseClass><GenerateCloneMethod>True</GenerateCloneMethod><GenerateDataContracts>False</GenerateDataContracts><CodeBaseTag>Net20</CodeBaseTag><SerializeMethodName>Serialize</SerializeMethodName><DeserializeMethodName>Deserialize</DeserializeMethodName><SaveToFileMethodName>SaveToFile</SaveToFileMethodName><LoadFromFileMethodName>LoadFromFile</LoadFromFileMethodName><GenerateXMLAttributes>True</GenerateXMLAttributes><AutomaticProperties>False</AutomaticProperties><DisableDebug>False</DisableDebug><CustomUsings></CustomUsings><ExcludeIncludedTypes>False</ExcludeIncludedTypes><EnableInitialize
 Fields>False</EnableInitializeFields>
+//  </auto-generated>
+// ------------------------------------------------------------------------------
+namespace OSGeo.MapGuide.ObjectModels.WebLayout.v2_6_0 {
+    using System;
+    using System.Diagnostics;
+    using System.Xml.Serialization;
+    using System.Collections;
+    using System.Xml.Schema;
+    using System.ComponentModel;
+    using System.IO;
+    using OSGeo.MapGuide.ObjectModels.WebLayout;
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute("WebLayout", Namespace="", IsNullable=false)]
+    public partial class WebLayoutType : BaseSerializable, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string titleField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private MapType mapField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private bool enablePingServerField;
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string selectionColorField;
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private int pointSelectionBufferField;
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string mapImageFormatField;
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string selectionImageFormatField;
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string startupScriptField;
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private ToolBarType toolBarField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private InformationPaneType informationPaneField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private ContextMenuType contextMenuField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TaskPaneType taskPaneField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private StatusBarType statusBarField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private ZoomControlType zoomControlField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<CommandType> commandSetField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Title {
+            get {
+                return this.titleField;
+            }
+            set {
+                if ((this.titleField != null)) {
+                    if ((titleField.Equals(value) != true)) {
+                        this.titleField = value;
+                        this.OnPropertyChanged("Title");
+                    }
+                }
+                else {
+                    this.titleField = value;
+                    this.OnPropertyChanged("Title");
+                }
+            }
+        }
+        
+        public MapType Map {
+            get {
+                return this.mapField;
+            }
+            set {
+                if ((this.mapField != null)) {
+                    if ((mapField.Equals(value) != true)) {
+                        this.mapField = value;
+                        this.OnPropertyChanged("Map");
+                    }
+                }
+                else {
+                    this.mapField = value;
+                    this.OnPropertyChanged("Map");
+                }
+            }
+        }
+        
+        public bool EnablePingServer {
+            get {
+                return this.enablePingServerField;
+            }
+            set {
+                if ((enablePingServerField.Equals(value) != true)) {
+                    this.enablePingServerField = value;
+                    this.OnPropertyChanged("EnablePingServer");
+                }
+            }
+        }
+
+        public string SelectionColor
+        {
+            get
+            {
+                return this.selectionColorField;
+            }
+            set
+            {
+                if (this.selectionColorField != null)
+                {
+                    if ((selectionColorField.Equals(value) != true))
+                    {
+                        this.selectionColorField = value;
+                        this.OnPropertyChanged("SelectionColor");
+                    }
+                }
+                else
+                {
+                    this.selectionColorField = value;
+                    this.OnPropertyChanged("SelectionColor");
+                }
+            }
+        }
+
+        public int PointSelectionBuffer
+        {
+            get
+            {
+                return this.pointSelectionBufferField;
+            }
+            set
+            {
+                if ((pointSelectionBufferField.Equals(value) != true))
+                {
+                    this.pointSelectionBufferField = value;
+                    this.OnPropertyChanged("PointSelectionBuffer");
+                }
+            }
+        }
+
+        public string MapImageFormat
+        {
+            get
+            {
+                return this.mapImageFormatField;
+            }
+            set
+            {
+                if (this.mapImageFormatField != null)
+                {
+                    if ((mapImageFormatField.Equals(value) != true))
+                    {
+                        this.mapImageFormatField = value;
+                        this.OnPropertyChanged("MapImageFormat");
+                    }
+                }
+                else
+                {
+                    this.mapImageFormatField = value;
+                    this.OnPropertyChanged("MapImageFormat");
+                }
+            }
+        }
+
+        public string SelectionImageFormat
+        {
+            get
+            {
+                return this.selectionImageFormatField;
+            }
+            set
+            {
+                if (this.selectionImageFormatField != null)
+                {
+                    if ((selectionImageFormatField.Equals(value) != true))
+                    {
+                        this.selectionImageFormatField = value;
+                        this.OnPropertyChanged("SelectionImageFormat");
+                    }
+                }
+                else
+                {
+                    this.selectionImageFormatField = value;
+                    this.OnPropertyChanged("SelectionImageFormat");
+                }
+            }
+        }
+
+        public string StartupScript
+        {
+            get
+            {
+                return this.startupScriptField;
+            }
+            set
+            {
+                if (this.startupScriptField != null)
+                {
+                    if ((startupScriptField.Equals(value) != true))
+                    {
+                        this.startupScriptField = value;
+                        this.OnPropertyChanged("StartupScript");
+                    }
+                }
+                else
+                {
+                    this.startupScriptField = value;
+                    this.OnPropertyChanged("StartupScript");
+                }
+            }
+        }
+        
+        public ToolBarType ToolBar {
+            get {
+                return this.toolBarField;
+            }
+            set {
+                if ((this.toolBarField != null)) {
+                    if ((toolBarField.Equals(value) != true)) {
+                        this.toolBarField = value;
+                        this.OnPropertyChanged("ToolBar");
+                    }
+                }
+                else {
+                    this.toolBarField = value;
+                    this.OnPropertyChanged("ToolBar");
+                }
+            }
+        }
+        
+        public InformationPaneType InformationPane {
+            get {
+                return this.informationPaneField;
+            }
+            set {
+                if ((this.informationPaneField != null)) {
+                    if ((informationPaneField.Equals(value) != true)) {
+                        this.informationPaneField = value;
+                        this.OnPropertyChanged("InformationPane");
+                    }
+                }
+                else {
+                    this.informationPaneField = value;
+                    this.OnPropertyChanged("InformationPane");
+                }
+            }
+        }
+        
+        public ContextMenuType ContextMenu {
+            get {
+                return this.contextMenuField;
+            }
+            set {
+                if ((this.contextMenuField != null)) {
+                    if ((contextMenuField.Equals(value) != true)) {
+                        this.contextMenuField = value;
+                        this.OnPropertyChanged("ContextMenu");
+                    }
+                }
+                else {
+                    this.contextMenuField = value;
+                    this.OnPropertyChanged("ContextMenu");
+                }
+            }
+        }
+        
+        public TaskPaneType TaskPane {
+            get {
+                return this.taskPaneField;
+            }
+            set {
+                if ((this.taskPaneField != null)) {
+                    if ((taskPaneField.Equals(value) != true)) {
+                        this.taskPaneField = value;
+                        this.OnPropertyChanged("TaskPane");
+                    }
+                }
+                else {
+                    this.taskPaneField = value;
+                    this.OnPropertyChanged("TaskPane");
+                }
+            }
+        }
+        
+        public StatusBarType StatusBar {
+            get {
+                return this.statusBarField;
+            }
+            set {
+                if ((this.statusBarField != null)) {
+                    if ((statusBarField.Equals(value) != true)) {
+                        this.statusBarField = value;
+                        this.OnPropertyChanged("StatusBar");
+                    }
+                }
+                else {
+                    this.statusBarField = value;
+                    this.OnPropertyChanged("StatusBar");
+                }
+            }
+        }
+        
+        public ZoomControlType ZoomControl {
+            get {
+                return this.zoomControlField;
+            }
+            set {
+                if ((this.zoomControlField != null)) {
+                    if ((zoomControlField.Equals(value) != true)) {
+                        this.zoomControlField = value;
+                        this.OnPropertyChanged("ZoomControl");
+                    }
+                }
+                else {
+                    this.zoomControlField = value;
+                    this.OnPropertyChanged("ZoomControl");
+                }
+            }
+        }
+        
+        [System.Xml.Serialization.XmlArrayItemAttribute("Command", IsNullable=false)]
+        public BindingList<CommandType> CommandSet {
+            get {
+                return this.commandSetField;
+            }
+            set {
+                if ((this.commandSetField != null)) {
+                    if ((commandSetField.Equals(value) != true)) {
+                        this.commandSetField = value;
+                        this.OnPropertyChanged("CommandSet");
+                    }
+                }
+                else {
+                    this.commandSetField = value;
+                    this.OnPropertyChanged("CommandSet");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(WebLayoutType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current WebLayoutType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            return base.NormalizedSerialize(Serializer, this);
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an WebLayoutType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output WebLayoutType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out WebLayoutType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(WebLayoutType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out WebLayoutType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static WebLayoutType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((WebLayoutType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current WebLayoutType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an WebLayoutType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output WebLayoutType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out WebLayoutType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(WebLayoutType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out WebLayoutType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static WebLayoutType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this WebLayoutType object
+        /// </summary>
+        public virtual WebLayoutType Clone() {
+            return ((WebLayoutType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class MapType : ResourceReferenceType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private MapViewType initialViewField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TargetType hyperlinkTargetField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string hyperlinkTargetFrameField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public MapViewType InitialView {
+            get {
+                return this.initialViewField;
+            }
+            set {
+                if ((this.initialViewField != null)) {
+                    if ((initialViewField.Equals(value) != true)) {
+                        this.initialViewField = value;
+                        this.OnPropertyChanged("InitialView");
+                    }
+                }
+                else {
+                    this.initialViewField = value;
+                    this.OnPropertyChanged("InitialView");
+                }
+            }
+        }
+        
+        public TargetType HyperlinkTarget {
+            get {
+                return this.hyperlinkTargetField;
+            }
+            set {
+                if ((hyperlinkTargetField.Equals(value) != true)) {
+                    this.hyperlinkTargetField = value;
+                    this.OnPropertyChanged("HyperlinkTarget");
+                }
+            }
+        }
+        
+        public string HyperlinkTargetFrame {
+            get {
+                return this.hyperlinkTargetFrameField;
+            }
+            set {
+                if ((this.hyperlinkTargetFrameField != null)) {
+                    if ((hyperlinkTargetFrameField.Equals(value) != true)) {
+                        this.hyperlinkTargetFrameField = value;
+                        this.OnPropertyChanged("HyperlinkTargetFrame");
+                    }
+                }
+                else {
+                    this.hyperlinkTargetFrameField = value;
+                    this.OnPropertyChanged("HyperlinkTargetFrame");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapType));
+                }
+                return serializer;
+            }
+        }
+        
+        /*
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }*/
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current MapType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an MapType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output MapType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out MapType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(MapType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out MapType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static MapType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((MapType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current MapType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an MapType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output MapType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out MapType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(MapType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out MapType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static MapType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this MapType object
+        /// </summary>
+        public virtual MapType Clone() {
+            return ((MapType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class MapViewType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private double centerXField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private double centerYField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private double scaleField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public double CenterX {
+            get {
+                return this.centerXField;
+            }
+            set {
+                if ((centerXField.Equals(value) != true)) {
+                    this.centerXField = value;
+                    this.OnPropertyChanged("CenterX");
+                }
+            }
+        }
+        
+        public double CenterY {
+            get {
+                return this.centerYField;
+            }
+            set {
+                if ((centerYField.Equals(value) != true)) {
+                    this.centerYField = value;
+                    this.OnPropertyChanged("CenterY");
+                }
+            }
+        }
+        
+        public double Scale {
+            get {
+                return this.scaleField;
+            }
+            set {
+                if ((scaleField.Equals(value) != true)) {
+                    this.scaleField = value;
+                    this.OnPropertyChanged("Scale");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapViewType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current MapViewType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an MapViewType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output MapViewType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out MapViewType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(MapViewType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out MapViewType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static MapViewType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((MapViewType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current MapViewType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an MapViewType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output MapViewType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out MapViewType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(MapViewType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out MapViewType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static MapViewType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this MapViewType object
+        /// </summary>
+        public virtual MapViewType Clone() {
+            return ((MapViewType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ParameterPairType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string keyField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string valueField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Key {
+            get {
+                return this.keyField;
+            }
+            set {
+                if ((this.keyField != null)) {
+                    if ((keyField.Equals(value) != true)) {
+                        this.keyField = value;
+                        this.OnPropertyChanged("Key");
+                    }
+                }
+                else {
+                    this.keyField = value;
+                    this.OnPropertyChanged("Key");
+                }
+            }
+        }
+        
+        public string Value {
+            get {
+                return this.valueField;
+            }
+            set {
+                if ((this.valueField != null)) {
+                    if ((valueField.Equals(value) != true)) {
+                        this.valueField = value;
+                        this.OnPropertyChanged("Value");
+                    }
+                }
+                else {
+                    this.valueField = value;
+                    this.OnPropertyChanged("Value");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ParameterPairType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ParameterPairType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ParameterPairType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ParameterPairType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ParameterPairType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ParameterPairType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ParameterPairType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ParameterPairType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ParameterPairType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ParameterPairType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ParameterPairType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ParameterPairType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ParameterPairType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ParameterPairType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ParameterPairType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ParameterPairType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ParameterPairType object
+        /// </summary>
+        public virtual ParameterPairType Clone() {
+            return ((ParameterPairType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ResultColumnType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string nameField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string propertyField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Name {
+            get {
+                return this.nameField;
+            }
+            set {
+                if ((this.nameField != null)) {
+                    if ((nameField.Equals(value) != true)) {
+                        this.nameField = value;
+                        this.OnPropertyChanged("Name");
+                    }
+                }
+                else {
+                    this.nameField = value;
+                    this.OnPropertyChanged("Name");
+                }
+            }
+        }
+        
+        public string Property {
+            get {
+                return this.propertyField;
+            }
+            set {
+                if ((this.propertyField != null)) {
+                    if ((propertyField.Equals(value) != true)) {
+                        this.propertyField = value;
+                        this.OnPropertyChanged("Property");
+                    }
+                }
+                else {
+                    this.propertyField = value;
+                    this.OnPropertyChanged("Property");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ResultColumnType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ResultColumnType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ResultColumnType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ResultColumnType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ResultColumnType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ResultColumnType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ResultColumnType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ResultColumnType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ResultColumnType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ResultColumnType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ResultColumnType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ResultColumnType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ResultColumnType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ResultColumnType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ResultColumnType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ResultColumnType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ResultColumnType object
+        /// </summary>
+        public virtual ResultColumnType Clone() {
+            return ((ResultColumnType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(CustomCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvokeScriptCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(PrintCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetedCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(HelpCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ViewOptionsCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeasureCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetPrintablePageCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SelectWithinCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(BufferCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvokeURLCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(BasicCommandType))]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public abstract partial class CommandType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string nameField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string labelField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string tooltipField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string descriptionField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string imageURLField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string disabledImageURLField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TargetViewerType targetViewerField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Name {
+            get {
+                return this.nameField;
+            }
+            set {
+                if ((this.nameField != null)) {
+                    if ((nameField.Equals(value) != true)) {
+                        this.nameField = value;
+                        this.OnPropertyChanged("Name");
+                    }
+                }
+                else {
+                    this.nameField = value;
+                    this.OnPropertyChanged("Name");
+                }
+            }
+        }
+        
+        public string Label {
+            get {
+                return this.labelField;
+            }
+            set {
+                if ((this.labelField != null)) {
+                    if ((labelField.Equals(value) != true)) {
+                        this.labelField = value;
+                        this.OnPropertyChanged("Label");
+                    }
+                }
+                else {
+                    this.labelField = value;
+                    this.OnPropertyChanged("Label");
+                }
+            }
+        }
+        
+        public string Tooltip {
+            get {
+                return this.tooltipField;
+            }
+            set {
+                if ((this.tooltipField != null)) {
+                    if ((tooltipField.Equals(value) != true)) {
+                        this.tooltipField = value;
+                        this.OnPropertyChanged("Tooltip");
+                    }
+                }
+                else {
+                    this.tooltipField = value;
+                    this.OnPropertyChanged("Tooltip");
+                }
+            }
+        }
+        
+        public string Description {
+            get {
+                return this.descriptionField;
+            }
+            set {
+                if ((this.descriptionField != null)) {
+                    if ((descriptionField.Equals(value) != true)) {
+                        this.descriptionField = value;
+                        this.OnPropertyChanged("Description");
+                    }
+                }
+                else {
+                    this.descriptionField = value;
+                    this.OnPropertyChanged("Description");
+                }
+            }
+        }
+        
+        public string ImageURL {
+            get {
+                return this.imageURLField;
+            }
+            set {
+                if ((this.imageURLField != null)) {
+                    if ((imageURLField.Equals(value) != true)) {
+                        this.imageURLField = value;
+                        this.OnPropertyChanged("ImageURL");
+                    }
+                }
+                else {
+                    this.imageURLField = value;
+                    this.OnPropertyChanged("ImageURL");
+                }
+            }
+        }
+        
+        public string DisabledImageURL {
+            get {
+                return this.disabledImageURLField;
+            }
+            set {
+                if ((this.disabledImageURLField != null)) {
+                    if ((disabledImageURLField.Equals(value) != true)) {
+                        this.disabledImageURLField = value;
+                        this.OnPropertyChanged("DisabledImageURL");
+                    }
+                }
+                else {
+                    this.disabledImageURLField = value;
+                    this.OnPropertyChanged("DisabledImageURL");
+                }
+            }
+        }
+        
+        public TargetViewerType TargetViewer {
+            get {
+                return this.targetViewerField;
+            }
+            set {
+                if ((targetViewerField.Equals(value) != true)) {
+                    this.targetViewerField = value;
+                    this.OnPropertyChanged("TargetViewer");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(CommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current CommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an CommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output CommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out CommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out CommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static CommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((CommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current CommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an CommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output CommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out CommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out CommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static CommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this CommandType object
+        /// </summary>
+        public virtual CommandType Clone() {
+            return ((CommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvokeScriptCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(PrintCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(TargetedCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(HelpCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ViewOptionsCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeasureCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetPrintablePageCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SelectWithinCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(BufferCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvokeURLCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchCommandType))]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public abstract partial class CustomCommandType : CommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(CustomCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current CustomCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an CustomCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output CustomCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out CustomCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CustomCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out CustomCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static CustomCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((CustomCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current CustomCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an CustomCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output CustomCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out CustomCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CustomCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out CustomCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static CustomCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this CustomCommandType object
+        /// </summary>
+        public virtual CustomCommandType Clone() {
+            return ((CustomCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class InvokeScriptCommandType : CustomCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string scriptField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Script {
+            get {
+                return this.scriptField;
+            }
+            set {
+                if ((this.scriptField != null)) {
+                    if ((scriptField.Equals(value) != true)) {
+                        this.scriptField = value;
+                        this.OnPropertyChanged("Script");
+                    }
+                }
+                else {
+                    this.scriptField = value;
+                    this.OnPropertyChanged("Script");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(InvokeScriptCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current InvokeScriptCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an InvokeScriptCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output InvokeScriptCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out InvokeScriptCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(InvokeScriptCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out InvokeScriptCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static InvokeScriptCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((InvokeScriptCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current InvokeScriptCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an InvokeScriptCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output InvokeScriptCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out InvokeScriptCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(InvokeScriptCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out InvokeScriptCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static InvokeScriptCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this InvokeScriptCommandType object
+        /// </summary>
+        public virtual InvokeScriptCommandType Clone() {
+            return ((InvokeScriptCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class PrintCommandType : CustomCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<ResourceReferenceType> printLayoutField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        [System.Xml.Serialization.XmlElementAttribute("PrintLayout")]
+        public BindingList<ResourceReferenceType> PrintLayout {
+            get {
+                return this.printLayoutField;
+            }
+            set {
+                if ((this.printLayoutField != null)) {
+                    if ((printLayoutField.Equals(value) != true)) {
+                        this.printLayoutField = value;
+                        this.OnPropertyChanged("PrintLayout");
+                    }
+                }
+                else {
+                    this.printLayoutField = value;
+                    this.OnPropertyChanged("PrintLayout");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(PrintCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current PrintCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an PrintCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output PrintCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out PrintCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(PrintCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out PrintCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static PrintCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((PrintCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current PrintCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an PrintCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output PrintCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out PrintCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(PrintCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out PrintCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static PrintCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this PrintCommandType object
+        /// </summary>
+        public virtual PrintCommandType Clone() {
+            return ((PrintCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(MapType))]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ResourceReferenceType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string resourceIdField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string ResourceId {
+            get {
+                return this.resourceIdField;
+            }
+            set {
+                if ((this.resourceIdField != null)) {
+                    if ((resourceIdField.Equals(value) != true)) {
+                        this.resourceIdField = value;
+                        this.OnPropertyChanged("ResourceId");
+                    }
+                }
+                else {
+                    this.resourceIdField = value;
+                    this.OnPropertyChanged("ResourceId");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ResourceReferenceType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ResourceReferenceType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ResourceReferenceType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ResourceReferenceType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ResourceReferenceType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ResourceReferenceType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ResourceReferenceType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ResourceReferenceType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ResourceReferenceType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ResourceReferenceType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ResourceReferenceType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ResourceReferenceType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ResourceReferenceType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ResourceReferenceType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ResourceReferenceType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ResourceReferenceType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ResourceReferenceType object
+        /// </summary>
+        public virtual ResourceReferenceType Clone() {
+            return ((ResourceReferenceType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(HelpCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ViewOptionsCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(MeasureCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(GetPrintablePageCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SelectWithinCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(BufferCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(InvokeURLCommandType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchCommandType))]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public abstract partial class TargetedCommandType : CustomCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TargetType targetField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string targetFrameField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public TargetType Target {
+            get {
+                return this.targetField;
+            }
+            set {
+                if ((targetField.Equals(value) != true)) {
+                    this.targetField = value;
+                    this.OnPropertyChanged("Target");
+                }
+            }
+        }
+        
+        public string TargetFrame {
+            get {
+                return this.targetFrameField;
+            }
+            set {
+                if ((this.targetFrameField != null)) {
+                    if ((targetFrameField.Equals(value) != true)) {
+                        this.targetFrameField = value;
+                        this.OnPropertyChanged("TargetFrame");
+                    }
+                }
+                else {
+                    this.targetFrameField = value;
+                    this.OnPropertyChanged("TargetFrame");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(TargetedCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current TargetedCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an TargetedCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output TargetedCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out TargetedCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TargetedCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out TargetedCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static TargetedCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((TargetedCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current TargetedCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an TargetedCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output TargetedCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out TargetedCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TargetedCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out TargetedCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static TargetedCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this TargetedCommandType object
+        /// </summary>
+        public virtual TargetedCommandType Clone() {
+            return ((TargetedCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class HelpCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string uRLField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string URL {
+            get {
+                return this.uRLField;
+            }
+            set {
+                if ((this.uRLField != null)) {
+                    if ((uRLField.Equals(value) != true)) {
+                        this.uRLField = value;
+                        this.OnPropertyChanged("URL");
+                    }
+                }
+                else {
+                    this.uRLField = value;
+                    this.OnPropertyChanged("URL");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(HelpCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current HelpCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an HelpCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output HelpCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out HelpCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(HelpCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out HelpCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static HelpCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((HelpCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current HelpCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an HelpCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output HelpCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out HelpCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(HelpCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out HelpCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static HelpCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this HelpCommandType object
+        /// </summary>
+        public virtual HelpCommandType Clone() {
+            return ((HelpCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ViewOptionsCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ViewOptionsCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ViewOptionsCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ViewOptionsCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ViewOptionsCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ViewOptionsCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ViewOptionsCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ViewOptionsCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ViewOptionsCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ViewOptionsCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ViewOptionsCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ViewOptionsCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ViewOptionsCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ViewOptionsCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ViewOptionsCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ViewOptionsCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ViewOptionsCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ViewOptionsCommandType object
+        /// </summary>
+        public virtual ViewOptionsCommandType Clone() {
+            return ((ViewOptionsCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class MeasureCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(MeasureCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current MeasureCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an MeasureCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output MeasureCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out MeasureCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(MeasureCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out MeasureCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static MeasureCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((MeasureCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current MeasureCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an MeasureCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output MeasureCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out MeasureCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(MeasureCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out MeasureCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static MeasureCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this MeasureCommandType object
+        /// </summary>
+        public virtual MeasureCommandType Clone() {
+            return ((MeasureCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class GetPrintablePageCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(GetPrintablePageCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current GetPrintablePageCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an GetPrintablePageCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output GetPrintablePageCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out GetPrintablePageCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(GetPrintablePageCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out GetPrintablePageCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static GetPrintablePageCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((GetPrintablePageCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current GetPrintablePageCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an GetPrintablePageCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output GetPrintablePageCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out GetPrintablePageCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(GetPrintablePageCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out GetPrintablePageCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static GetPrintablePageCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this GetPrintablePageCommandType object
+        /// </summary>
+        public virtual GetPrintablePageCommandType Clone() {
+            return ((GetPrintablePageCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class SelectWithinCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(SelectWithinCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current SelectWithinCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an SelectWithinCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output SelectWithinCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out SelectWithinCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(SelectWithinCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out SelectWithinCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static SelectWithinCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((SelectWithinCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current SelectWithinCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an SelectWithinCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output SelectWithinCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out SelectWithinCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(SelectWithinCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out SelectWithinCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static SelectWithinCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this SelectWithinCommandType object
+        /// </summary>
+        public virtual SelectWithinCommandType Clone() {
+            return ((SelectWithinCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class BufferCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(BufferCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current BufferCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an BufferCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output BufferCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out BufferCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(BufferCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out BufferCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static BufferCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((BufferCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current BufferCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an BufferCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output BufferCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out BufferCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(BufferCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out BufferCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static BufferCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this BufferCommandType object
+        /// </summary>
+        public virtual BufferCommandType Clone() {
+            return ((BufferCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class InvokeURLCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string uRLField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<string> layerSetField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<ParameterPairType> additionalParameterField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private bool disableIfSelectionEmptyField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string URL {
+            get {
+                return this.uRLField;
+            }
+            set {
+                if ((this.uRLField != null)) {
+                    if ((uRLField.Equals(value) != true)) {
+                        this.uRLField = value;
+                        this.OnPropertyChanged("URL");
+                    }
+                }
+                else {
+                    this.uRLField = value;
+                    this.OnPropertyChanged("URL");
+                }
+            }
+        }
+        
+        [System.Xml.Serialization.XmlArrayItemAttribute("Layer", IsNullable=false)]
+        public BindingList<string> LayerSet {
+            get {
+                return this.layerSetField;
+            }
+            set {
+                if ((this.layerSetField != null)) {
+                    if ((layerSetField.Equals(value) != true)) {
+                        this.layerSetField = value;
+                        this.OnPropertyChanged("LayerSet");
+                    }
+                }
+                else {
+                    this.layerSetField = value;
+                    this.OnPropertyChanged("LayerSet");
+                }
+            }
+        }
+        
+        [System.Xml.Serialization.XmlElementAttribute("AdditionalParameter")]
+        public BindingList<ParameterPairType> AdditionalParameter {
+            get {
+                return this.additionalParameterField;
+            }
+            set {
+                if ((this.additionalParameterField != null)) {
+                    if ((additionalParameterField.Equals(value) != true)) {
+                        this.additionalParameterField = value;
+                        this.OnPropertyChanged("AdditionalParameter");
+                    }
+                }
+                else {
+                    this.additionalParameterField = value;
+                    this.OnPropertyChanged("AdditionalParameter");
+                }
+            }
+        }
+        
+        public bool DisableIfSelectionEmpty {
+            get {
+                return this.disableIfSelectionEmptyField;
+            }
+            set {
+                if ((disableIfSelectionEmptyField.Equals(value) != true)) {
+                    this.disableIfSelectionEmptyField = value;
+                    this.OnPropertyChanged("DisableIfSelectionEmpty");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(InvokeURLCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current InvokeURLCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an InvokeURLCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output InvokeURLCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out InvokeURLCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(InvokeURLCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out InvokeURLCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static InvokeURLCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((InvokeURLCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current InvokeURLCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an InvokeURLCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output InvokeURLCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out InvokeURLCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(InvokeURLCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out InvokeURLCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static InvokeURLCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this InvokeURLCommandType object
+        /// </summary>
+        public virtual InvokeURLCommandType Clone() {
+            return ((InvokeURLCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class SearchCommandType : TargetedCommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string layerField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string promptField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<ResultColumnType> resultColumnsField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string filterField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string matchLimitField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Layer {
+            get {
+                return this.layerField;
+            }
+            set {
+                if ((this.layerField != null)) {
+                    if ((layerField.Equals(value) != true)) {
+                        this.layerField = value;
+                        this.OnPropertyChanged("Layer");
+                    }
+                }
+                else {
+                    this.layerField = value;
+                    this.OnPropertyChanged("Layer");
+                }
+            }
+        }
+        
+        public string Prompt {
+            get {
+                return this.promptField;
+            }
+            set {
+                if ((this.promptField != null)) {
+                    if ((promptField.Equals(value) != true)) {
+                        this.promptField = value;
+                        this.OnPropertyChanged("Prompt");
+                    }
+                }
+                else {
+                    this.promptField = value;
+                    this.OnPropertyChanged("Prompt");
+                }
+            }
+        }
+        
+        [System.Xml.Serialization.XmlArrayItemAttribute("Column", IsNullable=false)]
+        public BindingList<ResultColumnType> ResultColumns {
+            get {
+                return this.resultColumnsField;
+            }
+            set {
+                if ((this.resultColumnsField != null)) {
+                    if ((resultColumnsField.Equals(value) != true)) {
+                        this.resultColumnsField = value;
+                        this.OnPropertyChanged("ResultColumns");
+                    }
+                }
+                else {
+                    this.resultColumnsField = value;
+                    this.OnPropertyChanged("ResultColumns");
+                }
+            }
+        }
+        
+        public string Filter {
+            get {
+                return this.filterField;
+            }
+            set {
+                if ((this.filterField != null)) {
+                    if ((filterField.Equals(value) != true)) {
+                        this.filterField = value;
+                        this.OnPropertyChanged("Filter");
+                    }
+                }
+                else {
+                    this.filterField = value;
+                    this.OnPropertyChanged("Filter");
+                }
+            }
+        }
+        
+        [System.Xml.Serialization.XmlElementAttribute(DataType="integer")]
+        public string MatchLimit {
+            get {
+                return this.matchLimitField;
+            }
+            set {
+                if ((this.matchLimitField != null)) {
+                    if ((matchLimitField.Equals(value) != true)) {
+                        this.matchLimitField = value;
+                        this.OnPropertyChanged("MatchLimit");
+                    }
+                }
+                else {
+                    this.matchLimitField = value;
+                    this.OnPropertyChanged("MatchLimit");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(SearchCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current SearchCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an SearchCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output SearchCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out SearchCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(SearchCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out SearchCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static SearchCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((SearchCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current SearchCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an SearchCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output SearchCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out SearchCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(SearchCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out SearchCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static SearchCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this SearchCommandType object
+        /// </summary>
+        public virtual SearchCommandType Clone() {
+            return ((SearchCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class BasicCommandType : CommandType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BasicCommandActionType actionField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public BasicCommandActionType Action {
+            get {
+                return this.actionField;
+            }
+            set {
+                if ((actionField.Equals(value) != true)) {
+                    this.actionField = value;
+                    this.OnPropertyChanged("Action");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(BasicCommandType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current BasicCommandType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an BasicCommandType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output BasicCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out BasicCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(BasicCommandType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out BasicCommandType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static BasicCommandType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((BasicCommandType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current BasicCommandType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an BasicCommandType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output BasicCommandType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out BasicCommandType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(BasicCommandType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out BasicCommandType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static BasicCommandType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this BasicCommandType object
+        /// </summary>
+        public virtual BasicCommandType Clone() {
+            return ((BasicCommandType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(CommandItemType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(SeparatorItemType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(FlyoutItemType))]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class UIItemType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private UIItemFunctionType functionField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public UIItemFunctionType Function {
+            get {
+                return this.functionField;
+            }
+            set {
+                if ((functionField.Equals(value) != true)) {
+                    this.functionField = value;
+                    this.OnPropertyChanged("Function");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(UIItemType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current UIItemType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an UIItemType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output UIItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out UIItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(UIItemType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out UIItemType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static UIItemType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((UIItemType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current UIItemType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an UIItemType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output UIItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out UIItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(UIItemType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out UIItemType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static UIItemType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this UIItemType object
+        /// </summary>
+        public virtual UIItemType Clone() {
+            return ((UIItemType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class CommandItemType : UIItemType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string commandField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Command {
+            get {
+                return this.commandField;
+            }
+            set {
+                if ((this.commandField != null)) {
+                    if ((commandField.Equals(value) != true)) {
+                        this.commandField = value;
+                        this.OnPropertyChanged("Command");
+                    }
+                }
+                else {
+                    this.commandField = value;
+                    this.OnPropertyChanged("Command");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(CommandItemType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current CommandItemType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an CommandItemType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output CommandItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out CommandItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CommandItemType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out CommandItemType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static CommandItemType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((CommandItemType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current CommandItemType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an CommandItemType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output CommandItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out CommandItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CommandItemType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out CommandItemType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static CommandItemType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this CommandItemType object
+        /// </summary>
+        public virtual CommandItemType Clone() {
+            return ((CommandItemType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class SeparatorItemType : UIItemType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(SeparatorItemType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current SeparatorItemType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an SeparatorItemType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output SeparatorItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out SeparatorItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(SeparatorItemType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out SeparatorItemType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static SeparatorItemType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((SeparatorItemType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current SeparatorItemType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an SeparatorItemType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output SeparatorItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out SeparatorItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(SeparatorItemType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out SeparatorItemType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static SeparatorItemType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this SeparatorItemType object
+        /// </summary>
+        public virtual SeparatorItemType Clone() {
+            return ((SeparatorItemType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class FlyoutItemType : UIItemType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string labelField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string tooltipField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string descriptionField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string imageURLField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string disabledImageURLField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<UIItemType> subItemField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Label {
+            get {
+                return this.labelField;
+            }
+            set {
+                if ((this.labelField != null)) {
+                    if ((labelField.Equals(value) != true)) {
+                        this.labelField = value;
+                        this.OnPropertyChanged("Label");
+                    }
+                }
+                else {
+                    this.labelField = value;
+                    this.OnPropertyChanged("Label");
+                }
+            }
+        }
+        
+        public string Tooltip {
+            get {
+                return this.tooltipField;
+            }
+            set {
+                if ((this.tooltipField != null)) {
+                    if ((tooltipField.Equals(value) != true)) {
+                        this.tooltipField = value;
+                        this.OnPropertyChanged("Tooltip");
+                    }
+                }
+                else {
+                    this.tooltipField = value;
+                    this.OnPropertyChanged("Tooltip");
+                }
+            }
+        }
+        
+        public string Description {
+            get {
+                return this.descriptionField;
+            }
+            set {
+                if ((this.descriptionField != null)) {
+                    if ((descriptionField.Equals(value) != true)) {
+                        this.descriptionField = value;
+                        this.OnPropertyChanged("Description");
+                    }
+                }
+                else {
+                    this.descriptionField = value;
+                    this.OnPropertyChanged("Description");
+                }
+            }
+        }
+        
+        public string ImageURL {
+            get {
+                return this.imageURLField;
+            }
+            set {
+                if ((this.imageURLField != null)) {
+                    if ((imageURLField.Equals(value) != true)) {
+                        this.imageURLField = value;
+                        this.OnPropertyChanged("ImageURL");
+                    }
+                }
+                else {
+                    this.imageURLField = value;
+                    this.OnPropertyChanged("ImageURL");
+                }
+            }
+        }
+        
+        public string DisabledImageURL {
+            get {
+                return this.disabledImageURLField;
+            }
+            set {
+                if ((this.disabledImageURLField != null)) {
+                    if ((disabledImageURLField.Equals(value) != true)) {
+                        this.disabledImageURLField = value;
+                        this.OnPropertyChanged("DisabledImageURL");
+                    }
+                }
+                else {
+                    this.disabledImageURLField = value;
+                    this.OnPropertyChanged("DisabledImageURL");
+                }
+            }
+        }
+        
+        [System.Xml.Serialization.XmlElementAttribute("SubItem")]
+        public BindingList<UIItemType> SubItem {
+            get {
+                return this.subItemField;
+            }
+            set {
+                if ((this.subItemField != null)) {
+                    if ((subItemField.Equals(value) != true)) {
+                        this.subItemField = value;
+                        this.OnPropertyChanged("SubItem");
+                    }
+                }
+                else {
+                    this.subItemField = value;
+                    this.OnPropertyChanged("SubItem");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(FlyoutItemType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current FlyoutItemType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an FlyoutItemType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output FlyoutItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out FlyoutItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(FlyoutItemType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out FlyoutItemType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static FlyoutItemType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((FlyoutItemType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current FlyoutItemType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an FlyoutItemType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output FlyoutItemType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out FlyoutItemType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(FlyoutItemType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out FlyoutItemType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static FlyoutItemType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this FlyoutItemType object
+        /// </summary>
+        public virtual FlyoutItemType Clone() {
+            return ((FlyoutItemType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class TaskButtonType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string nameField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string tooltipField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string descriptionField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string imageURLField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string disabledImageURLField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public string Name {
+            get {
+                return this.nameField;
+            }
+            set {
+                if ((this.nameField != null)) {
+                    if ((nameField.Equals(value) != true)) {
+                        this.nameField = value;
+                        this.OnPropertyChanged("Name");
+                    }
+                }
+                else {
+                    this.nameField = value;
+                    this.OnPropertyChanged("Name");
+                }
+            }
+        }
+        
+        public string Tooltip {
+            get {
+                return this.tooltipField;
+            }
+            set {
+                if ((this.tooltipField != null)) {
+                    if ((tooltipField.Equals(value) != true)) {
+                        this.tooltipField = value;
+                        this.OnPropertyChanged("Tooltip");
+                    }
+                }
+                else {
+                    this.tooltipField = value;
+                    this.OnPropertyChanged("Tooltip");
+                }
+            }
+        }
+        
+        public string Description {
+            get {
+                return this.descriptionField;
+            }
+            set {
+                if ((this.descriptionField != null)) {
+                    if ((descriptionField.Equals(value) != true)) {
+                        this.descriptionField = value;
+                        this.OnPropertyChanged("Description");
+                    }
+                }
+                else {
+                    this.descriptionField = value;
+                    this.OnPropertyChanged("Description");
+                }
+            }
+        }
+        
+        public string ImageURL {
+            get {
+                return this.imageURLField;
+            }
+            set {
+                if ((this.imageURLField != null)) {
+                    if ((imageURLField.Equals(value) != true)) {
+                        this.imageURLField = value;
+                        this.OnPropertyChanged("ImageURL");
+                    }
+                }
+                else {
+                    this.imageURLField = value;
+                    this.OnPropertyChanged("ImageURL");
+                }
+            }
+        }
+        
+        public string DisabledImageURL {
+            get {
+                return this.disabledImageURLField;
+            }
+            set {
+                if ((this.disabledImageURLField != null)) {
+                    if ((disabledImageURLField.Equals(value) != true)) {
+                        this.disabledImageURLField = value;
+                        this.OnPropertyChanged("DisabledImageURL");
+                    }
+                }
+                else {
+                    this.disabledImageURLField = value;
+                    this.OnPropertyChanged("DisabledImageURL");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(TaskButtonType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current TaskButtonType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an TaskButtonType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output TaskButtonType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out TaskButtonType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TaskButtonType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out TaskButtonType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static TaskButtonType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((TaskButtonType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current TaskButtonType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an TaskButtonType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output TaskButtonType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out TaskButtonType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TaskButtonType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out TaskButtonType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static TaskButtonType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this TaskButtonType object
+        /// </summary>
+        public virtual TaskButtonType Clone() {
+            return ((TaskButtonType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ZoomControlType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(StatusBarType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ContextMenuType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ToolBarType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(TaskBarType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(WebLayoutResizableControlType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(TaskPaneType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(InformationPaneType))]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class WebLayoutControlType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private bool visibleField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public bool Visible {
+            get {
+                return this.visibleField;
+            }
+            set {
+                if ((visibleField.Equals(value) != true)) {
+                    this.visibleField = value;
+                    this.OnPropertyChanged("Visible");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(WebLayoutControlType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current WebLayoutControlType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an WebLayoutControlType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output WebLayoutControlType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out WebLayoutControlType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(WebLayoutControlType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out WebLayoutControlType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static WebLayoutControlType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((WebLayoutControlType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current WebLayoutControlType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an WebLayoutControlType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output WebLayoutControlType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out WebLayoutControlType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(WebLayoutControlType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out WebLayoutControlType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static WebLayoutControlType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this WebLayoutControlType object
+        /// </summary>
+        public virtual WebLayoutControlType Clone() {
+            return ((WebLayoutControlType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ZoomControlType : WebLayoutControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ZoomControlType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ZoomControlType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ZoomControlType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ZoomControlType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ZoomControlType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ZoomControlType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ZoomControlType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ZoomControlType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ZoomControlType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ZoomControlType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ZoomControlType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ZoomControlType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ZoomControlType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ZoomControlType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ZoomControlType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ZoomControlType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ZoomControlType object
+        /// </summary>
+        public virtual ZoomControlType Clone() {
+            return ((ZoomControlType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class StatusBarType : WebLayoutControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(StatusBarType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current StatusBarType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an StatusBarType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output StatusBarType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out StatusBarType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(StatusBarType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out StatusBarType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static StatusBarType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((StatusBarType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current StatusBarType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an StatusBarType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output StatusBarType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out StatusBarType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(StatusBarType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out StatusBarType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static StatusBarType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this StatusBarType object
+        /// </summary>
+        public virtual StatusBarType Clone() {
+            return ((StatusBarType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ContextMenuType : WebLayoutControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<UIItemType> menuItemField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        [System.Xml.Serialization.XmlElementAttribute("MenuItem")]
+        public BindingList<UIItemType> MenuItem {
+            get {
+                return this.menuItemField;
+            }
+            set {
+                if ((this.menuItemField != null)) {
+                    if ((menuItemField.Equals(value) != true)) {
+                        this.menuItemField = value;
+                        this.OnPropertyChanged("MenuItem");
+                    }
+                }
+                else {
+                    this.menuItemField = value;
+                    this.OnPropertyChanged("MenuItem");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ContextMenuType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ContextMenuType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ContextMenuType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ContextMenuType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ContextMenuType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ContextMenuType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ContextMenuType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ContextMenuType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ContextMenuType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ContextMenuType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ContextMenuType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ContextMenuType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ContextMenuType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ContextMenuType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ContextMenuType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ContextMenuType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ContextMenuType object
+        /// </summary>
+        public virtual ContextMenuType Clone() {
+            return ((ContextMenuType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ToolBarType : WebLayoutControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<UIItemType> buttonField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        [System.Xml.Serialization.XmlElementAttribute("Button")]
+        public BindingList<UIItemType> Button {
+            get {
+                return this.buttonField;
+            }
+            set {
+                if ((this.buttonField != null)) {
+                    if ((buttonField.Equals(value) != true)) {
+                        this.buttonField = value;
+                        this.OnPropertyChanged("Button");
+                    }
+                }
+                else {
+                    this.buttonField = value;
+                    this.OnPropertyChanged("Button");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ToolBarType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ToolBarType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ToolBarType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ToolBarType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ToolBarType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ToolBarType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ToolBarType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ToolBarType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ToolBarType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ToolBarType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ToolBarType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ToolBarType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ToolBarType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ToolBarType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ToolBarType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ToolBarType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ToolBarType object
+        /// </summary>
+        public virtual ToolBarType Clone() {
+            return ((ToolBarType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class TaskBarType : WebLayoutControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TaskButtonType homeField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TaskButtonType forwardField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TaskButtonType backField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TaskButtonType tasksField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<UIItemType> menuButtonField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public TaskButtonType Home {
+            get {
+                return this.homeField;
+            }
+            set {
+                if ((this.homeField != null)) {
+                    if ((homeField.Equals(value) != true)) {
+                        this.homeField = value;
+                        this.OnPropertyChanged("Home");
+                    }
+                }
+                else {
+                    this.homeField = value;
+                    this.OnPropertyChanged("Home");
+                }
+            }
+        }
+        
+        public TaskButtonType Forward {
+            get {
+                return this.forwardField;
+            }
+            set {
+                if ((this.forwardField != null)) {
+                    if ((forwardField.Equals(value) != true)) {
+                        this.forwardField = value;
+                        this.OnPropertyChanged("Forward");
+                    }
+                }
+                else {
+                    this.forwardField = value;
+                    this.OnPropertyChanged("Forward");
+                }
+            }
+        }
+        
+        public TaskButtonType Back {
+            get {
+                return this.backField;
+            }
+            set {
+                if ((this.backField != null)) {
+                    if ((backField.Equals(value) != true)) {
+                        this.backField = value;
+                        this.OnPropertyChanged("Back");
+                    }
+                }
+                else {
+                    this.backField = value;
+                    this.OnPropertyChanged("Back");
+                }
+            }
+        }
+        
+        public TaskButtonType Tasks {
+            get {
+                return this.tasksField;
+            }
+            set {
+                if ((this.tasksField != null)) {
+                    if ((tasksField.Equals(value) != true)) {
+                        this.tasksField = value;
+                        this.OnPropertyChanged("Tasks");
+                    }
+                }
+                else {
+                    this.tasksField = value;
+                    this.OnPropertyChanged("Tasks");
+                }
+            }
+        }
+        
+        [System.Xml.Serialization.XmlElementAttribute("MenuButton")]
+        public BindingList<UIItemType> MenuButton {
+            get {
+                return this.menuButtonField;
+            }
+            set {
+                if ((this.menuButtonField != null)) {
+                    if ((menuButtonField.Equals(value) != true)) {
+                        this.menuButtonField = value;
+                        this.OnPropertyChanged("MenuButton");
+                    }
+                }
+                else {
+                    this.menuButtonField = value;
+                    this.OnPropertyChanged("MenuButton");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(TaskBarType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current TaskBarType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an TaskBarType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output TaskBarType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out TaskBarType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TaskBarType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out TaskBarType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static TaskBarType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((TaskBarType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current TaskBarType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an TaskBarType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output TaskBarType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out TaskBarType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TaskBarType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out TaskBarType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static TaskBarType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this TaskBarType object
+        /// </summary>
+        public virtual TaskBarType Clone() {
+            return ((TaskBarType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(TaskPaneType))]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(InformationPaneType))]
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class WebLayoutResizableControlType : WebLayoutControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private int widthField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public int Width {
+            get {
+                return this.widthField;
+            }
+            set {
+                if ((widthField.Equals(value) != true)) {
+                    this.widthField = value;
+                    this.OnPropertyChanged("Width");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(WebLayoutResizableControlType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current WebLayoutResizableControlType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an WebLayoutResizableControlType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output WebLayoutResizableControlType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out WebLayoutResizableControlType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(WebLayoutResizableControlType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out WebLayoutResizableControlType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static WebLayoutResizableControlType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((WebLayoutResizableControlType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current WebLayoutResizableControlType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an WebLayoutResizableControlType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output WebLayoutResizableControlType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out WebLayoutResizableControlType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(WebLayoutResizableControlType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out WebLayoutResizableControlType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static WebLayoutResizableControlType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this WebLayoutResizableControlType object
+        /// </summary>
+        public virtual WebLayoutResizableControlType Clone() {
+            return ((WebLayoutResizableControlType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class TaskPaneType : WebLayoutResizableControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private TaskBarType taskBarField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string initialTaskField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public TaskBarType TaskBar {
+            get {
+                return this.taskBarField;
+            }
+            set {
+                if ((this.taskBarField != null)) {
+                    if ((taskBarField.Equals(value) != true)) {
+                        this.taskBarField = value;
+                        this.OnPropertyChanged("TaskBar");
+                    }
+                }
+                else {
+                    this.taskBarField = value;
+                    this.OnPropertyChanged("TaskBar");
+                }
+            }
+        }
+        
+        public string InitialTask {
+            get {
+                return this.initialTaskField;
+            }
+            set {
+                if ((this.initialTaskField != null)) {
+                    if ((initialTaskField.Equals(value) != true)) {
+                        this.initialTaskField = value;
+                        this.OnPropertyChanged("InitialTask");
+                    }
+                }
+                else {
+                    this.initialTaskField = value;
+                    this.OnPropertyChanged("InitialTask");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(TaskPaneType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current TaskPaneType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an TaskPaneType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output TaskPaneType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out TaskPaneType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TaskPaneType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out TaskPaneType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static TaskPaneType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((TaskPaneType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current TaskPaneType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an TaskPaneType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output TaskPaneType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out TaskPaneType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(TaskPaneType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out TaskPaneType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static TaskPaneType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this TaskPaneType object
+        /// </summary>
+        public virtual TaskPaneType Clone() {
+            return ((TaskPaneType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class InformationPaneType : WebLayoutResizableControlType, System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private bool legendVisibleField;
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private bool propertiesVisibleField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        public bool LegendVisible {
+            get {
+                return this.legendVisibleField;
+            }
+            set {
+                if ((legendVisibleField.Equals(value) != true)) {
+                    this.legendVisibleField = value;
+                    this.OnPropertyChanged("LegendVisible");
+                }
+            }
+        }
+        
+        public bool PropertiesVisible {
+            get {
+                return this.propertiesVisibleField;
+            }
+            set {
+                if ((propertiesVisibleField.Equals(value) != true)) {
+                    this.propertiesVisibleField = value;
+                    this.OnPropertyChanged("PropertiesVisible");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(InformationPaneType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current InformationPaneType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an InformationPaneType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output InformationPaneType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out InformationPaneType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(InformationPaneType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out InformationPaneType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static InformationPaneType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((InformationPaneType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current InformationPaneType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an InformationPaneType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output InformationPaneType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out InformationPaneType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(InformationPaneType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out InformationPaneType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static InformationPaneType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this InformationPaneType object
+        /// </summary>
+        public virtual InformationPaneType Clone() {
+            return ((InformationPaneType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class CommandSetType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<CommandType> commandField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        [System.Xml.Serialization.XmlElementAttribute("Command")]
+        public BindingList<CommandType> Command {
+            get {
+                return this.commandField;
+            }
+            set {
+                if ((this.commandField != null)) {
+                    if ((commandField.Equals(value) != true)) {
+                        this.commandField = value;
+                        this.OnPropertyChanged("Command");
+                    }
+                }
+                else {
+                    this.commandField = value;
+                    this.OnPropertyChanged("Command");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(CommandSetType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current CommandSetType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an CommandSetType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output CommandSetType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out CommandSetType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CommandSetType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out CommandSetType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static CommandSetType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((CommandSetType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current CommandSetType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an CommandSetType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output CommandSetType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out CommandSetType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(CommandSetType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out CommandSetType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static CommandSetType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this CommandSetType object
+        /// </summary>
+        public virtual CommandSetType Clone() {
+            return ((CommandSetType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class LayerSetType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<string> layerField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        [System.Xml.Serialization.XmlElementAttribute("Layer")]
+        public BindingList<string> Layer {
+            get {
+                return this.layerField;
+            }
+            set {
+                if ((this.layerField != null)) {
+                    if ((layerField.Equals(value) != true)) {
+                        this.layerField = value;
+                        this.OnPropertyChanged("Layer");
+                    }
+                }
+                else {
+                    this.layerField = value;
+                    this.OnPropertyChanged("Layer");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(LayerSetType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current LayerSetType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an LayerSetType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output LayerSetType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out LayerSetType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(LayerSetType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out LayerSetType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static LayerSetType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((LayerSetType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current LayerSetType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an LayerSetType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output LayerSetType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out LayerSetType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(LayerSetType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out LayerSetType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static LayerSetType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this LayerSetType object
+        /// </summary>
+        public virtual LayerSetType Clone() {
+            return ((LayerSetType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+    
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
+    public partial class ResultColumnSetType : System.ComponentModel.INotifyPropertyChanged {
+        
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private BindingList<ResultColumnType> columnField;
+        
+        private static System.Xml.Serialization.XmlSerializer serializer;
+        
+        [System.Xml.Serialization.XmlElementAttribute("Column")]
+        public BindingList<ResultColumnType> Column {
+            get {
+                return this.columnField;
+            }
+            set {
+                if ((this.columnField != null)) {
+                    if ((columnField.Equals(value) != true)) {
+                        this.columnField = value;
+                        this.OnPropertyChanged("Column");
+                    }
+                }
+                else {
+                    this.columnField = value;
+                    this.OnPropertyChanged("Column");
+                }
+            }
+        }
+        
+        private static System.Xml.Serialization.XmlSerializer Serializer {
+            get {
+                if ((serializer == null)) {
+                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ResultColumnSetType));
+                }
+                return serializer;
+            }
+        }
+        
+        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
+        
+        public virtual void OnPropertyChanged(string info) {
+            System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
+            if ((handler != null)) {
+                handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
+            }
+        }
+        
+        #region Serialize/Deserialize
+        /// <summary>
+        /// Serializes current ResultColumnSetType object into an XML document
+        /// </summary>
+        /// <returns>string XML value</returns>
+        public virtual string Serialize() {
+            System.IO.StreamReader streamReader = null;
+            System.IO.MemoryStream memoryStream = null;
+            try {
+                memoryStream = new System.IO.MemoryStream();
+                Serializer.Serialize(memoryStream, this);
+                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
+                streamReader = new System.IO.StreamReader(memoryStream);
+                return streamReader.ReadToEnd();
+            }
+            finally {
+                if ((streamReader != null)) {
+                    streamReader.Dispose();
+                }
+                if ((memoryStream != null)) {
+                    memoryStream.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes workflow markup into an ResultColumnSetType object
+        /// </summary>
+        /// <param name="xml">string workflow markup to deserialize</param>
+        /// <param name="obj">Output ResultColumnSetType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool Deserialize(string xml, out ResultColumnSetType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ResultColumnSetType);
+            try {
+                obj = Deserialize(xml);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool Deserialize(string xml, out ResultColumnSetType obj) {
+            System.Exception exception = null;
+            return Deserialize(xml, out obj, out exception);
+        }
+        
+        public static ResultColumnSetType Deserialize(string xml) {
+            System.IO.StringReader stringReader = null;
+            try {
+                stringReader = new System.IO.StringReader(xml);
+                return ((ResultColumnSetType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
+            }
+            finally {
+                if ((stringReader != null)) {
+                    stringReader.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Serializes current ResultColumnSetType object into file
+        /// </summary>
+        /// <param name="fileName">full path of outupt xml file</param>
+        /// <param name="exception">output Exception value if failed</param>
+        /// <returns>true if can serialize and save into file; otherwise, false</returns>
+        public virtual bool SaveToFile(string fileName, out System.Exception exception) {
+            exception = null;
+            try {
+                SaveToFile(fileName);
+                return true;
+            }
+            catch (System.Exception e) {
+                exception = e;
+                return false;
+            }
+        }
+        
+        public virtual void SaveToFile(string fileName) {
+            System.IO.StreamWriter streamWriter = null;
+            try {
+                string xmlString = Serialize();
+                System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
+                streamWriter = xmlFile.CreateText();
+                streamWriter.WriteLine(xmlString);
+                streamWriter.Close();
+            }
+            finally {
+                if ((streamWriter != null)) {
+                    streamWriter.Dispose();
+                }
+            }
+        }
+        
+        /// <summary>
+        /// Deserializes xml markup from file into an ResultColumnSetType object
+        /// </summary>
+        /// <param name="fileName">string xml file to load and deserialize</param>
+        /// <param name="obj">Output ResultColumnSetType object</param>
+        /// <param name="exception">output Exception value if deserialize failed</param>
+        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
+        public static bool LoadFromFile(string fileName, out ResultColumnSetType obj, out System.Exception exception) {
+            exception = null;
+            obj = default(ResultColumnSetType);
+            try {
+                obj = LoadFromFile(fileName);
+                return true;
+            }
+            catch (System.Exception ex) {
+                exception = ex;
+                return false;
+            }
+        }
+        
+        public static bool LoadFromFile(string fileName, out ResultColumnSetType obj) {
+            System.Exception exception = null;
+            return LoadFromFile(fileName, out obj, out exception);
+        }
+        
+        public static ResultColumnSetType LoadFromFile(string fileName) {
+            System.IO.FileStream file = null;
+            System.IO.StreamReader sr = null;
+            try {
+                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
+                sr = new System.IO.StreamReader(file);
+                string xmlString = sr.ReadToEnd();
+                sr.Close();
+                file.Close();
+                return Deserialize(xmlString);
+            }
+            finally {
+                if ((file != null)) {
+                    file.Dispose();
+                }
+                if ((sr != null)) {
+                    sr.Dispose();
+                }
+            }
+        }
+        #endregion
+        
+        #region Clone method
+        /// <summary>
+        /// Create a clone of this ResultColumnSetType object
+        /// </summary>
+        public virtual ResultColumnSetType Clone() {
+            return ((ResultColumnSetType)(this.MemberwiseClone()));
+        }
+        #endregion
+    }
+}

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_0_0/GridLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_0_0/GridLayerDefinitionImpl.cs	2014-12-25 13:55:42 UTC (rev 8462)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_0_0/GridLayerDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -20,6 +20,7 @@
 
 #endregion Disclaimer / License
 
+#define LDF_100
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_0_0/LayerElementFactoryImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_0_0/LayerElementFactoryImpl.cs	2014-12-25 13:55:42 UTC (rev 8462)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_0_0/LayerElementFactoryImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -20,6 +20,7 @@
 
 #endregion Disclaimer / License
 
+#define LDF_100
 using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
 using System;
 using System.Collections.Generic;

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_0_0/VectorLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_0_0/VectorLayerDefinitionImpl.cs	2014-12-25 13:55:42 UTC (rev 8462)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_0_0/VectorLayerDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -20,6 +20,7 @@
 
 #endregion Disclaimer / License
 
+#define LDF_100
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_1_0/GridLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_1_0/GridLayerDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_1_0/GridLayerDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,734 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LDF_110
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LDF_110
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0
+#elif LDF_120
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0
+#elif LDF_130
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0
+#elif LDF_230
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0
+#elif LDF_240
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0
+#endif
+{
+    using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+    using System.Xml.Serialization;
+
+    partial class GridLayerDefinitionType : IRasterLayerDefinition
+    {
+        [XmlIgnore]
+        public override LayerType LayerType
+        {
+            get { return LayerType.Raster; }
+        }
+
+        [XmlIgnore]
+        string ISubLayerDefinition.ResourceId
+        {
+            get { return this.ResourceId; }
+            set { this.ResourceId = value; }
+        }
+
+        [XmlIgnore]
+        string IRasterLayerDefinition.FeatureName
+        {
+            get
+            {
+                return this.FeatureName;
+            }
+            set
+            {
+                this.FeatureName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IRasterLayerDefinition.Geometry
+        {
+            get
+            {
+                return this.Geometry;
+            }
+            set
+            {
+                this.Geometry = value;
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IGridScaleRange> IRasterLayerDefinition.GridScaleRange
+        {
+            get
+            {
+                foreach (var gsr in this.GridScaleRange)
+                {
+                    yield return gsr;
+                }
+            }
+        }
+
+        public void AddGridScaleRange(IGridScaleRange range)
+        {
+            var gsr = range as GridScaleRangeType;
+            if (gsr != null)
+            {
+                this.GridScaleRange.Add(gsr);
+            }
+        }
+
+        public void RemoveGridScaleRange(IGridScaleRange range)
+        {
+            var gsr = range as GridScaleRangeType;
+            if (gsr != null)
+            {
+                this.GridScaleRange.Remove(gsr);
+            }
+        }
+
+        public int IndexOfScaleRange(IGridScaleRange range)
+        {
+            var gsr = range as GridScaleRangeType;
+            if (gsr != null)
+            {
+                this.GridScaleRange.IndexOf(gsr);
+            }
+            return -1;
+        }
+
+        public IGridScaleRange GetScaleRangeAt(int index)
+        {
+            return this.GridScaleRange[index];
+        }
+
+        [XmlIgnore]
+        public int GridScaleRangeCount { get { return this.GridScaleRange.Count; } }
+    }
+
+    partial class ChannelBandType : IChannelBand
+    {
+        [XmlIgnore]
+        string IChannelBand.Band
+        {
+            get
+            {
+                return this.Band;
+            }
+            set
+            {
+                this.Band = value;
+            }
+        }
+
+        [XmlIgnore]
+        double? IChannelBand.LowBand
+        {
+            get
+            {
+                return this.LowBandSpecified ? new Nullable<double>(this.LowBand) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.LowBand = value.Value;
+                    this.LowBandSpecified = true;
+                }
+                else
+                {
+                    this.LowBandSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        double? IChannelBand.HighBand
+        {
+            get
+            {
+                return this.HighBandSpecified ? new Nullable<double>(this.HighBand) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.HighBand = value.Value;
+                    this.HighBandSpecified = true;
+                }
+                else
+                {
+                    this.HighBandSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        byte IChannelBand.LowChannel
+        {
+            get
+            {
+                return this.LowChannel;
+            }
+            set
+            {
+                this.LowChannel = value;
+            }
+        }
+
+        [XmlIgnore]
+        byte IChannelBand.HighChannel
+        {
+            get
+            {
+                return this.HighChannel;
+            }
+            set
+            {
+                this.HighChannel = value;
+            }
+        }
+    }
+
+    partial class GridColorBandsType : IGridColorBands
+    {
+        [XmlIgnore]
+        IChannelBand IGridColorBands.RedBand
+        {
+            get
+            {
+                return this.RedBand;
+            }
+            set
+            {
+                this.RedBand = (ChannelBandType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IChannelBand IGridColorBands.GreenBand
+        {
+            get
+            {
+                return this.GreenBand;
+            }
+            set
+            {
+                this.GreenBand = (ChannelBandType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IChannelBand IGridColorBands.BlueBand
+        {
+            get
+            {
+                return this.BlueBand;
+            }
+            set
+            {
+                this.BlueBand = (ChannelBandType)value;
+            }
+        }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal abstract class ExplicitColorBase : IExplicitColor
+    {
+        [XmlIgnore]
+        public abstract ItemChoiceType Type { get; }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal class ExplicitColorBand : ExplicitColorBase, IExplicitColorBand
+    {
+        [XmlIgnore]
+        public string Band { get; set; }
+
+        [XmlIgnore]
+        public override ItemChoiceType Type
+        {
+            get { return ItemChoiceType.Band; }
+        }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal class ExplicitColor : ExplicitColorBase, IExplictColorValue
+    {
+        [XmlIgnore]
+        public string Value { get; set; }
+
+        [XmlIgnore]
+        public override ItemChoiceType Type
+        {
+            get { return ItemChoiceType.ExplicitColor; }
+        }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal class ExplicitColorBands : ExplicitColorBase, IExplicitColorBands
+    {
+        [XmlIgnore]
+        public IGridColorBands Bands { get; set; }
+
+        [XmlIgnore]
+        public override ItemChoiceType Type
+        {
+            get { return ItemChoiceType.Bands; }
+        }
+    }
+
+    partial class GridColorType : IGridColor
+    {
+        [XmlIgnore]
+        IExplicitColor IGridColor.ExplicitColor
+        {
+            get
+            {
+                return ParseItem();
+            }
+            set
+            {
+                switch (this.ItemElementName)
+                {
+                    case ItemChoiceType.Band:
+                        this.Item = ((ExplicitColorBand)value).Band;
+                        break;
+
+                    case ItemChoiceType.Bands:
+                        this.Item = ((ExplicitColorBands)value).Bands;
+                        break;
+
+                    case ItemChoiceType.ExplicitColor:
+                        this.Item = ((ExplicitColor)value).Value;
+                        break;
+                }
+            }
+        }
+
+        private IExplicitColor ParseItem()
+        {
+            if (this.Item == null)
+                return null;
+
+            switch (this.ItemElementName)
+            {
+                case ItemChoiceType.Band:
+                    return new ExplicitColorBand() { Band = (string)this.Item };
+
+                case ItemChoiceType.Bands:
+                    return new ExplicitColorBands() { Bands = (IGridColorBands)this.Item };
+
+                case ItemChoiceType.ExplicitColor:
+                    return new ExplicitColor() { Value = (string)this.Item };
+            }
+
+            throw new Exception(); //Should never get here
+        }
+
+        public void SetValue(string htmlColor)
+        {
+            this.ItemElementName = ItemChoiceType.ExplicitColor;
+            this.Item = htmlColor;
+        }
+
+        public string GetValue()
+        {
+            if (this.Item != null && this.ItemElementName == ItemChoiceType.ExplicitColor)
+            {
+                return this.Item.ToString();
+            }
+            return null;
+        }
+    }
+
+    partial class GridColorRuleType : IGridColorRule
+    {
+        [XmlIgnore]
+        string IGridColorRule.LegendLabel
+        {
+            get
+            {
+                return this.LegendLabel;
+            }
+            set
+            {
+                this.LegendLabel = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IGridColorRule.Filter
+        {
+            get
+            {
+                return this.Filter;
+            }
+            set
+            {
+                this.Filter = value;
+            }
+        }
+
+        [XmlIgnore]
+        ITextSymbol IGridColorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IGridColor IGridColorRule.Color
+        {
+            get
+            {
+                return this.Color;
+            }
+            set
+            {
+                this.Color = (GridColorType)value;
+            }
+        }
+    }
+
+    partial class HillShadeType : IHillShade
+    {
+        [XmlIgnore]
+        string IHillShade.Band
+        {
+            get
+            {
+                return this.Band;
+            }
+            set
+            {
+                this.Band = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IHillShade.Azimuth
+        {
+            get
+            {
+                return this.Azimuth;
+            }
+            set
+            {
+                this.Azimuth = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IHillShade.Altitude
+        {
+            get
+            {
+                return this.Altitude;
+            }
+            set
+            {
+                this.Altitude = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IHillShade.ScaleFactor
+        {
+            get
+            {
+                return this.ScaleFactor;
+            }
+            set
+            {
+                this.ScaleFactor = value;
+            }
+        }
+    }
+
+    partial class GridColorStyleType : IGridColorStyle
+    {
+        [XmlIgnore]
+        IHillShade IGridColorStyle.HillShade
+        {
+            get
+            {
+                return this.HillShade;
+            }
+            set
+            {
+                this.HillShade = (HillShadeType)value;
+            }
+        }
+
+        [XmlIgnore]
+        string IGridColorStyle.TransparencyColor
+        {
+            get
+            {
+                return this.TransparencyColor == null ? string.Empty : this.TransparencyColor.ToString();
+            }
+            set
+            {
+                this.TransparencyColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        double? IGridColorStyle.BrightnessFactor
+        {
+            get
+            {
+                return this.BrightnessFactor;
+            }
+            set
+            {
+                this.BrightnessFactor = value.HasValue ? value.Value : default(double);
+            }
+        }
+
+        [XmlIgnore]
+        double? IGridColorStyle.ContrastFactor
+        {
+            get
+            {
+                return this.ContrastFactor;
+            }
+            set
+            {
+                this.ContrastFactor = value.HasValue ? value.Value : default(double);
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IGridColorRule> IGridColorStyle.ColorRule
+        {
+            get
+            {
+                foreach (var cr in this.ColorRule)
+                {
+                    yield return cr;
+                }
+            }
+        }
+
+        void IGridColorStyle.AddColorRule(IGridColorRule rule)
+        {
+            var cr = rule as GridColorRuleType;
+            if (cr != null)
+                this.ColorRule.Add((GridColorRuleType)cr);
+        }
+
+        void IGridColorStyle.RemoveColorRule(IGridColorRule rule)
+        {
+            var cr = rule as GridColorRuleType;
+            if (cr != null)
+                this.ColorRule.Remove((GridColorRuleType)cr);
+        }
+
+        [XmlIgnore]
+        public int ColorRuleCount
+        {
+            get { return this.ColorRule.Count; }
+        }
+
+        public IGridColorRule GetColorRuleAt(int index)
+        {
+            return this.ColorRule[index];
+        }
+
+        public IHillShade CreateHillShade()
+        {
+            return new HillShadeType();
+        }
+    }
+
+    partial class GridSurfaceStyleType : IGridSurfaceStyle
+    {
+        [XmlIgnore]
+        string IGridSurfaceStyle.Band
+        {
+            get
+            {
+                return this.Band;
+            }
+            set
+            {
+                this.Band = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IGridSurfaceStyle.ZeroValue
+        {
+            get
+            {
+                return this.ZeroValue;
+            }
+            set
+            {
+                this.ZeroValue = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IGridSurfaceStyle.ScaleFactor
+        {
+            get
+            {
+                return this.ScaleFactor;
+            }
+            set
+            {
+                this.ScaleFactor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IGridSurfaceStyle.DefaultColor
+        {
+            get
+            {
+                return this.DefaultColor;
+            }
+            set
+            {
+                this.DefaultColor = value;
+            }
+        }
+    }
+
+    partial class GridScaleRangeType : IGridScaleRange
+    {
+        [XmlIgnore]
+        double? IGridScaleRange.MinScale
+        {
+            get
+            {
+                return this.MinScale;
+            }
+            set
+            {
+                if (value.HasValue)
+                    this.MinScale = value.Value;
+            }
+        }
+
+        [XmlIgnore]
+        double? IGridScaleRange.MaxScale
+        {
+            get
+            {
+                return this.MaxScaleSpecified ? new Nullable<double>(this.MaxScale) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.MaxScale = value.Value;
+                    this.MaxScaleSpecified = true;
+                }
+                else
+                {
+                    this.MaxScaleSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        IGridSurfaceStyle IGridScaleRange.SurfaceStyle
+        {
+            get
+            {
+                return this.SurfaceStyle;
+            }
+            set
+            {
+                this.SurfaceStyle = (GridSurfaceStyleType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IGridColorStyle IGridScaleRange.ColorStyle
+        {
+            get
+            {
+                return this.ColorStyle;
+            }
+            set
+            {
+                this.ColorStyle = (GridColorStyleType)value;
+            }
+        }
+
+        [XmlIgnore]
+        double IGridScaleRange.RebuildFactor
+        {
+            get
+            {
+                return this.RebuildFactor;
+            }
+            set
+            {
+                this.RebuildFactor = value;
+            }
+        }
+
+        public IGridColorStyle CreateColorStyle()
+        {
+            return new GridColorStyleType()
+            {
+                ColorRule = new System.ComponentModel.BindingList<GridColorRuleType>(),
+                HillShade = new HillShadeType()
+            };
+        }
+
+        public IGridSurfaceStyle CreateSurfaceStyle()
+        {
+            return new GridSurfaceStyleType();
+        }
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_1_0/LayerElementFactoryImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_1_0/LayerElementFactoryImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_1_0/LayerElementFactoryImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,488 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LDF_110
+using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LDF_110
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0
+#elif LDF_120
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0
+#elif LDF_130
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0
+#elif LDF_230
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0
+#elif LDF_240
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0
+#endif
+{
+    /// <summary>
+    /// A publically accessible entry point primarily used for registration with the <see cref="ObjectFactory"/> and
+    /// <see cref="ResourceTypeRegistry"/> classes
+    /// </summary>
+    public static class LdfEntryPoint
+    {
+        public static ILayerDefinition CreateDefault(LayerType type)
+        {
+            return LayerDefinition.CreateDefault(type);
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            return LayerDefinition.Deserialize(xml);
+        }
+
+        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 ctss = vsr2.CompositeStyle;
+                        if (ctss != null)
+                        {
+                            foreach (var cts in ctss)
+                            {
+                                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();
+        }
+    }
+
+    partial class LayerDefinition : ILayerElementFactory
+    {
+        public static ILayerDefinition CreateDefault(LayerType type)
+        {
+            var lyr = new LayerDefinition();
+            switch (type)
+            {
+                case LayerType.Drawing:
+                    lyr.CreateDrawingLayer();
+                    break;
+
+                case LayerType.Raster:
+                    lyr.CreateRasterLayer();
+                    break;
+
+                case LayerType.Vector:
+                    lyr.CreateVectorLayer();
+                    break;
+            }
+            return lyr;
+        }
+
+        protected virtual VectorLayerDefinitionType CreateVectorLayerInstance()
+        {
+            return new VectorLayerDefinitionType();
+        }
+
+        protected virtual VectorScaleRangeType CreateVectorScaleRangeInstance()
+        {
+            return new VectorScaleRangeType()
+            {
+                Items = new System.ComponentModel.BindingList<object>(),
+                AreaStyle = CreateDefaultAreaStyle(),
+                LineStyle = CreateDefaultLineStyle(),
+                PointStyle = CreateDefaultPointStyle()
+            };
+        }
+
+        public void CreateVectorLayer()
+        {
+            var vl = this.CreateVectorLayerInstance();
+            /*
+            var vl = new VectorLayerDefinitionType()
+            {
+#if LDF_240
+                Watermarks = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_4_0.WatermarkType>()
+#elif LDF_230
+                Watermarks = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_3_0.WatermarkType>()
+#endif
+            };
+             */
+
+            //TODO: Create composite type style if 1.2 or 1.3 schema
+
+            vl.VectorScaleRange = new System.ComponentModel.BindingList<VectorScaleRangeType>();
+            var defaultRange = this.CreateVectorScaleRangeInstance();
+            /*
+            var defaultRange = new VectorScaleRangeType()
+            {
+                Items = new System.ComponentModel.BindingList<object>(),
+                AreaStyle = CreateDefaultAreaStyle(),
+                LineStyle = CreateDefaultLineStyle(),
+                PointStyle = CreateDefaultPointStyle(),
+#if LDF_100 || LDF_110
+#else
+                CompositeStyle = new ICompositeTypeStyle[] { CreateDefaultCompositeStyle() }
+#endif
+            };
+             */
+            vl.VectorScaleRange.Add(defaultRange);
+
+            this.Item = vl;
+        }
+
+        public void CreateRasterLayer()
+        {
+            var gl = new GridLayerDefinitionType()
+            {
+                GridScaleRange = new System.ComponentModel.BindingList<GridScaleRangeType>(),
+            };
+
+            gl.AddGridScaleRange(new GridScaleRangeType()
+            {
+                ColorStyle = new GridColorStyleType()
+                {
+                    ColorRule = new System.ComponentModel.BindingList<GridColorRuleType>()
+                    {
+                        new GridColorRuleType() {
+                            LegendLabel = string.Empty,
+                            Color = new GridColorType()
+                        },
+                        new GridColorRuleType() {
+                            LegendLabel = string.Empty,
+                            Color = new GridColorType()
+                        }
+                    }
+                },
+                RebuildFactor = 1.0
+            });
+
+            gl.GetScaleRangeAt(0).ColorStyle.GetColorRuleAt(0).Color.SetValue("000000"); //NOXLATE
+            gl.GetScaleRangeAt(0).ColorStyle.GetColorRuleAt(1).Color.SetValue("FFFFFF"); //NOXLATE
+
+            this.Item = gl;
+        }
+
+        public void CreateDrawingLayer()
+        {
+            this.Item = new DrawingLayerDefinitionType();
+        }
+
+        /// <summary>
+        /// Creates a fill
+        /// </summary>
+        /// <param name="pattern"></param>
+        /// <param name="background"></param>
+        /// <param name="foreground"></param>
+        /// <returns></returns>
+        public IFill CreateFill(string pattern, System.Drawing.Color background, System.Drawing.Color foreground)
+        {
+            return new FillType()
+            {
+                BackgroundColor = Utility.SerializeHTMLColor(background, true),
+                FillPattern = pattern,
+                ForegroundColor = Utility.SerializeHTMLColor(foreground, true)
+            };
+        }
+
+        /// <summary>
+        /// Creates a line stroke with default settings
+        /// </summary>
+        /// <param name="color"></param>
+        /// <returns></returns>
+        public IStroke CreateStroke(System.Drawing.Color color)
+        {
+            return new StrokeType()
+            {
+                Color = Utility.SerializeHTMLColor(color, true),
+                LineStyle = "Solid", //NOXLATE
+                Thickness = "1", //NOXLATE
+                Unit = LengthUnitType.Points
+            };
+        }
+
+        public IStroke CreateDefaultStroke()
+        {
+            return CreateStroke(Color.Black);
+        }
+
+        public IPointVectorStyle CreateDefaultPointStyle()
+        {
+            IPointVectorStyle pts = new PointTypeStyleType()
+            {
+                PointRule = new System.ComponentModel.BindingList<PointRuleType>()
+            };
+            pts.AddRule(CreateDefaultPointRule());
+            return pts;
+        }
+
+        public ILineVectorStyle CreateDefaultLineStyle()
+        {
+            ILineVectorStyle lts = new LineTypeStyleType()
+            {
+                LineRule = new System.ComponentModel.BindingList<LineRuleType>()
+            };
+            lts.AddRule(CreateDefaultLineRule());
+            return lts;
+        }
+
+        public IAreaVectorStyle CreateDefaultAreaStyle()
+        {
+            IAreaVectorStyle ats = new AreaTypeStyleType()
+            {
+                AreaRule = new System.ComponentModel.BindingList<AreaRuleType>()
+            };
+            ats.AddRule(CreateDefaultAreaRule());
+            return ats;
+        }
+
+        public IVectorScaleRange CreateVectorScaleRange()
+        {
+            return new VectorScaleRangeType()
+            {
+                Items = new System.ComponentModel.BindingList<object>(),
+                AreaStyle = CreateDefaultAreaStyle(),
+                LineStyle = CreateDefaultLineStyle(),
+                PointStyle = CreateDefaultPointStyle()
+            };
+        }
+
+        public IFill CreateDefaultFill()
+        {
+            return CreateFill("Solid", Color.White, Color.White); //NOXLATE
+        }
+
+        public IMarkSymbol CreateDefaultMarkSymbol()
+        {
+            IMarkSymbol sym = new MarkSymbolType()
+            {
+                SizeContext = SizeContextType.DeviceUnits,
+                MaintainAspect = true,
+                Shape = ShapeType.Square,
+                Rotation = "0", //NOXLATE
+                SizeX = "10", //NOXLATE
+                SizeY = "10", //NOXLATE
+                Unit = LengthUnitType.Points
+            };
+            sym.Edge = CreateDefaultStroke();
+            sym.Fill = CreateDefaultFill();
+            return sym;
+        }
+
+        public IFontSymbol CreateDefaultFontSymbol()
+        {
+            IFontSymbol sym = new FontSymbolType()
+            {
+                SizeContext = SizeContextType.DeviceUnits,
+                MaintainAspect = true,
+                FontName = "Arial", //NOXLATE
+                Rotation = "0", //NOXLATE
+                SizeX = "10", //NOXLATE
+                SizeY = "10", //NOXLATE
+                Unit = LengthUnitType.Points
+            };
+            sym.SetForegroundColor(Color.Black);
+            return sym;
+        }
+
+        public IPointSymbolization2D CreateDefaultPointSymbolization2D()
+        {
+            IPointSymbolization2D sym = new PointSymbolization2DType();
+            sym.Symbol = CreateDefaultMarkSymbol();
+            return sym;
+        }
+
+        public IPointRule CreateDefaultPointRule()
+        {
+            IPointRule pr = new PointRuleType()
+            {
+                LegendLabel = string.Empty
+            };
+            pr.PointSymbolization2D = CreateDefaultPointSymbolization2D();
+            return pr;
+        }
+
+        public IAreaRule CreateDefaultAreaRule()
+        {
+            IAreaRule ar = new AreaRuleType()
+            {
+                LegendLabel = string.Empty
+            };
+            ar.AreaSymbolization2D = CreateDefaultAreaSymbolizationFill();
+            return ar;
+        }
+
+        public IAreaSymbolizationFill CreateDefaultAreaSymbolizationFill()
+        {
+            IAreaSymbolizationFill fill = new AreaSymbolizationFillType();
+            fill.Fill = CreateDefaultFill();
+            fill.Stroke = CreateDefaultStroke();
+
+            return fill;
+        }
+
+        public ILineRule CreateDefaultLineRule()
+        {
+            ILineRule lr = new LineRuleType()
+            {
+                LegendLabel = "",
+                Items = new System.ComponentModel.BindingList<StrokeType>()
+            };
+            lr.AddStroke(CreateDefaultStroke());
+            return lr;
+        }
+
+        public IAdvancedPlacement CreateDefaultAdvancedPlacement(double scaleLimit)
+        {
+            return new TextSymbolTypeAdvancedPlacement() { ScaleLimit = scaleLimit };
+        }
+
+        public ITextSymbol CreateDefaultTextSymbol()
+        {
+            return new TextSymbolType()
+            {
+                AdvancedPlacement = null,
+                BackgroundColor = Utility.SerializeHTMLColor(Color.White, true),
+                BackgroundStyle = BackgroundStyleType.Transparent,
+                Bold = "false", //NOXLATE
+                FontName = "Arial", //NOXLATE
+                ForegroundColor = Utility.SerializeHTMLColor(Color.Black, true),
+                HorizontalAlignment = "'Center'", //NOXLATE
+                Italic = "false", //NOXLATE
+                Rotation = "0", //NOXLATE
+                SizeContext = SizeContextType.DeviceUnits,
+                SizeX = "10", //NOXLATE
+                SizeY = "10", //NOXLATE
+                Text = string.Empty,
+                Underlined = "false", //NOXLATE
+                Unit = LengthUnitType.Points,
+                VerticalAlignment = "'Baseline'" //NOXLATE
+            };
+        }
+
+        public IW2DSymbol CreateDefaultW2DSymbol(string symbolLibrary, string symbolName)
+        {
+            return new W2DSymbolType()
+            {
+                W2DSymbol = new W2DSymbolTypeW2DSymbol()
+                {
+                    ResourceId = symbolLibrary,
+                    LibraryItemName = symbolName
+                },
+            };
+        }
+
+        public virtual ICompositeRule CreateDefaultCompositeRule()
+        {
+#if LDF_100
+            throw new NotImplementedException();
+#else
+            return new CompositeRule()
+            {
+                LegendLabel = string.Empty,
+                CompositeSymbolization = new CompositeSymbolization()
+                {
+                    SymbolInstance = new System.ComponentModel.BindingList<SymbolInstance>()
+                }
+            };
+#endif
+        }
+
+        public virtual ICompositeTypeStyle CreateDefaultCompositeStyle()
+        {
+#if LDF_100
+            throw new NotImplementedException();
+#else
+            var cts = new CompositeTypeStyle()
+            {
+                CompositeRule = new System.ComponentModel.BindingList<CompositeRule>(),
+#if LDF_110 || LDF_120
+#else
+                ShowInLegend = true,
+#endif
+            };
+            cts.AddCompositeRule(CreateDefaultCompositeRule());
+            return cts;
+#endif
+        }
+
+        public virtual IUrlData CreateUrlData()
+        {
+#if LDF_240
+            return new URLDataType();
+#else
+            throw new NotImplementedException();
+#endif
+        }
+
+        public virtual ICompositeSymbolization CloneCompositeSymbolization(ICompositeSymbolization sym)
+        {
+#if LDF_100
+            throw new NotImplementedException();
+#else
+            var csym = (CompositeSymbolization)sym;
+            //Use quick and dirty XML in'n'out cloning to ensure no existing child references are
+            //carried over
+            var clone = CompositeSymbolization.Deserialize(csym.Serialize());
+            /*
+            foreach (var oldInst in csym.SymbolInstance)
+            {
+                System.Diagnostics.Debug.WriteLine("old symbol instance: {0}", oldInst.GetHashCode());
+            }
+            foreach (var newInst in clone.SymbolInstance)
+            {
+                System.Diagnostics.Debug.WriteLine("new symbol instance: {0}", newInst.GetHashCode());
+            }*/
+            return clone;
+#endif
+        }
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_1_0/VectorLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_1_0/VectorLayerDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_1_0/VectorLayerDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,2468 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LDF_110
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LDF_110
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0
+#elif LDF_120
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0
+#elif LDF_130
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0
+#elif LDF_230
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0
+#elif LDF_240
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0
+#endif
+{
+    using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+    using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
+    using System.Xml.Serialization;
+
+    abstract partial class BaseLayerDefinitionType : ISubLayerDefinition
+#if LDF_230 || LDF_240
+, ISubLayerDefinition2
+#endif
+    {
+        [XmlIgnore]
+        public abstract LayerType LayerType { get; }
+
+#if LDF_230 || LDF_240
+
+        [XmlIgnore]
+        IEnumerable<IWatermark> IWatermarkCollection.Watermarks
+        {
+            get
+            {
+                foreach (var wm in this.Watermarks)
+                    yield return wm;
+            }
+        }
+
+        IWatermark IWatermarkCollection.AddWatermark(IWatermarkDefinition watermark)
+        {
+            return WatermarkCollectionUtil.AddWatermark(this.Watermarks, watermark);
+        }
+
+        void IWatermarkCollection.RemoveWatermark(IWatermark watermark)
+        {
+            WatermarkCollectionUtil.RemoveWatermark(this.Watermarks, watermark);
+        }
+
+        [XmlIgnore]
+        int IWatermarkCollection.WatermarkCount
+        {
+            get { return this.Watermarks.Count; }
+        }
+
+#endif
+    }
+
+    partial class NameStringPairType : INameStringPair
+    {
+        [XmlIgnore]
+        string INameStringPair.Name
+        {
+            get
+            {
+                return this.Name;
+            }
+            set
+            {
+                this.Name = value;
+            }
+        }
+
+        [XmlIgnore]
+        string INameStringPair.Value
+        {
+            get
+            {
+                return this.Value;
+            }
+            set
+            {
+                this.Value = value;
+            }
+        }
+    }
+
+    partial class VectorScaleRangeType : IVectorScaleRange
+#if !LDF_100
+, IVectorScaleRange2
+#endif
+    {
+        #region Missing generated stuff
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private bool minScaleFieldSpecified;
+
+        [System.Xml.Serialization.XmlIgnoreAttribute()]
+        public bool MinScaleSpecified
+        {
+            get
+            {
+                return this.minScaleFieldSpecified;
+            }
+            set
+            {
+                if ((minScaleFieldSpecified.Equals(value) != true))
+                {
+                    this.minScaleFieldSpecified = value;
+                    this.OnPropertyChanged("MinScaleSpecified"); //NOXLATE
+                }
+            }
+        }
+
+        #endregion Missing generated stuff
+
+        [XmlIgnore]
+        public IAreaVectorStyle AreaStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(IAreaVectorStyle).IsAssignableFrom(item.GetType()))
+                        return (IAreaVectorStyle)item;
+                }
+
+                return null;
+            }
+            set
+            {
+                //Remove old one if it exists
+                var item = this.AreaStyle;
+                if (item != null)
+                {
+                    this.itemsField.Remove(item);
+                }
+                //Put the new one in if it is not null
+                if (value != null)
+                {
+                    this.itemsField.Add(value);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public ILineVectorStyle LineStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ILineVectorStyle).IsAssignableFrom(item.GetType()))
+                        return (ILineVectorStyle)item;
+                }
+
+                return null;
+            }
+            set
+            {
+                //Remove old one if it exists
+                var item = this.LineStyle;
+                if (item != null)
+                {
+                    this.itemsField.Remove(item);
+                }
+                //Put the new one in if it is not null
+                if (value != null)
+                {
+                    this.itemsField.Add(value);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public IPointVectorStyle PointStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(IPointVectorStyle).IsAssignableFrom(item.GetType()))
+                        return (IPointVectorStyle)item;
+                }
+
+                return null;
+            }
+            set
+            {
+                //Remove old one if it exists
+                var item = this.PointStyle;
+                if (item != null)
+                {
+                    this.itemsField.Remove(item);
+                }
+                //Put the new one in if it is not null
+                if (value != null)
+                {
+                    this.itemsField.Add(value);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        double? IVectorScaleRange.MinScale
+        {
+            get
+            {
+                return this.MinScaleSpecified ? new Nullable<double>(this.MinScale) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.MinScaleSpecified = true;
+                    this.MinScale = value.Value;
+                }
+                else
+                {
+                    this.MinScaleSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        double? IVectorScaleRange.MaxScale
+        {
+            get
+            {
+                return this.MaxScaleSpecified ? new Nullable<double>(this.MaxScale) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.MaxScaleSpecified = true;
+                    this.MaxScale = value.Value;
+                }
+                else
+                {
+                    this.MaxScaleSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public IList<IVectorStyle> AllStyles
+        {
+            get { return (IList<IVectorStyle>)this.Items; }
+        }
+
+        IVectorScaleRange IVectorScaleRange.Clone()
+        {
+            return VectorScaleRangeType.Deserialize(this.Serialize());
+        }
+
+#if LDF_110 || LDF_120
+
+        [XmlIgnore]
+        public IEnumerable<ICompositeTypeStyle> CompositeStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                        yield return (ICompositeTypeStyle)item;
+                }
+            }
+            set
+            {
+                //Clear old ones
+                var remove = new List<object>();
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                        remove.Add(item);
+                }
+
+                foreach (var obj in remove)
+                {
+                    this.itemsField.Remove(obj);
+                }
+
+                //Put the new ones in if it is not null
+                if (value != null)
+                {
+                    foreach (var item in value)
+                    {
+                        if (!typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                            throw new InvalidOperationException(Strings.ErrorObjectNotICompositeTypeStyle);
+
+                        this.itemsField.Add(item);
+                    }
+                }
+            }
+        }
+
+#elif LDF_130 || LDF_230 || LDF_240
+
+        [XmlIgnore]
+        public IEnumerable<ICompositeTypeStyle> CompositeStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+                        yield return (ICompositeTypeStyle2)item;
+                }
+            }
+            set
+            {
+                //Clear old ones
+                var remove = new List<object>();
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+                        remove.Add(item);
+                }
+
+                foreach (var obj in remove)
+                {
+                    this.itemsField.Remove(obj);
+                }
+
+                //Put the new ones in if it is not null
+                if (value != null)
+                {
+                    foreach (var item in value)
+                    {
+                        if (!typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+                            throw new InvalidOperationException(Strings.ErrorObjectNotICompositeTypeStyle);
+
+                        this.itemsField.Add(item);
+                    }
+                }
+            }
+        }
+
+#endif
+
+#if LDF_100
+#else
+
+        IElevationSettings IVectorScaleRange2.ElevationSettings
+        {
+            get { return this.ElevationSettings; }
+            set { this.ElevationSettings = (ElevationSettingsType)value; }
+        }
+
+        IElevationSettings IVectorScaleRange2.Create(string zOffset, string zExtrusion, ElevationTypeType zOffsetType, LengthUnitType unit)
+        {
+            return new ElevationSettingsType()
+            {
+                ZOffset = zOffset,
+                ZOffsetType = zOffsetType,
+                ZExtrusion = zExtrusion,
+                Unit = unit
+            };
+        }
+
+        [XmlIgnore]
+        int IVectorScaleRange2.CompositeStyleCount
+        {
+            get
+            {
+                int count = 0;
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                        count++;
+                }
+                return count;
+            }
+        }
+
+#endif
+    }
+
+#if LDF_100
+#else
+
+    partial class ElevationSettingsType : IElevationSettings { }
+
+#endif
+
+#if LDF_100
+
+    partial class StrokeType : IStroke
+#else
+
+    partial class StrokeType : IStroke, IStroke2
+#endif
+    {
+        internal StrokeType()
+        {
+        }
+
+        IStroke ICloneableLayerElement<IStroke>.Clone()
+        {
+            return StrokeType.Deserialize(this.Serialize());
+        }
+
+#if LDF_100
+#else
+
+        IStroke2 ICloneableLayerElement<IStroke2>.Clone()
+        {
+            return StrokeType.Deserialize(this.Serialize());
+        }
+
+#endif
+    }
+
+    partial class FillType : IFill
+    {
+        internal FillType()
+        {
+        }
+
+        IFill ICloneableLayerElement<IFill>.Clone()
+        {
+            return FillType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class AreaTypeStyleType : IAreaVectorStyle
+#if LDF_130 || LDF_230 || LDF_240
+, IAreaVectorStyle2
+#endif
+    {
+        [XmlIgnore]
+        IEnumerable<IAreaRule> IAreaVectorStyle.Rules
+        {
+            get
+            {
+                foreach (var ar in this.AreaRule)
+                {
+                    yield return ar;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int IVectorStyle.RuleCount
+        {
+            get
+            {
+                if (this.AreaRule != null)
+                    return this.AreaRule.Count;
+                return 0;
+            }
+        }
+
+        void IAreaVectorStyle.RemoveAllRules()
+        {
+            this.AreaRule.Clear();
+        }
+
+        void IAreaVectorStyle.AddRule(IAreaRule rule)
+        {
+            var ar = rule as AreaRuleType;
+            if (ar != null)
+                this.AreaRule.Add(ar);
+        }
+
+        void IAreaVectorStyle.RemoveRule(IAreaRule rule)
+        {
+            var ar = rule as AreaRuleType;
+            if (ar != null)
+                this.AreaRule.Remove(ar);
+        }
+
+        [XmlIgnore]
+        StyleType IVectorStyle.StyleType
+        {
+            get { return StyleType.Area; }
+        }
+
+        #region IRuleCollection<IAreaRule> Members
+
+        public int IndexOfRule(IAreaRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+                return this.AreaRule.IndexOf(r);
+            return -1;
+        }
+
+        public IAreaRule GetRuleAt(int index)
+        {
+            return this.AreaRule[index];
+        }
+
+        public bool MoveUp(IAreaRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveUp(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        public bool MoveDown(IAreaRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveDown(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        #endregion IRuleCollection<IAreaRule> Members
+
+        #region IRuleCollection Members
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.AreaRule[index];
+        }
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+                return this.AreaRule.IndexOf(r);
+            return -1;
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveUp(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveDown(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        #endregion IRuleCollection Members
+    }
+
+    internal static class CollectionUtil
+    {
+        public static bool MoveUp<T>(IList<T> list, T obj)
+        {
+            var idx = list.IndexOf(obj);
+            if (idx == 0) //Already at top
+                return false;
+
+            var newIdx = idx - 1;
+            //Get object at index
+            var obj2 = list[newIdx];
+            //Swap them
+            list[idx] = obj2;
+            list[newIdx] = obj;
+
+            return true;
+        }
+
+        public static bool MoveDown<T>(IList<T> list, T obj)
+        {
+            var idx = list.IndexOf(obj);
+            if (idx == list.Count - 1) //Already at bottom
+                return false;
+
+            var newIdx = idx + 1;
+            //Get object at index
+            var obj2 = list[newIdx];
+            //Swap them
+            list[idx] = obj2;
+            list[newIdx] = obj;
+
+            return true;
+        }
+    }
+
+    partial class AreaRuleType : IAreaRule
+    {
+        [XmlIgnore]
+        IAreaSymbolizationFill IAreaRule.AreaSymbolization2D
+        {
+            get
+            {
+                return this.Item;
+            }
+            set
+            {
+                this.Item = (AreaSymbolizationFillType)value;
+            }
+        }
+
+        [XmlIgnore]
+        ITextSymbol IBasicVectorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+    }
+
+    partial class PointTypeStyleType : IPointVectorStyle
+#if LDF_130 || LDF_230 || LDF_240
+, IPointVectorStyle2
+#endif
+    {
+        [XmlIgnore]
+        public IEnumerable<IPointRule> Rules
+        {
+            get
+            {
+                foreach (var pr in this.PointRule)
+                {
+                    yield return pr;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int IVectorStyle.RuleCount
+        {
+            get
+            {
+                if (this.PointRule != null)
+                    return this.PointRule.Count;
+                return 0;
+            }
+        }
+
+        public void RemoveAllRules()
+        {
+            this.PointRule.Clear();
+        }
+
+        public void AddRule(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                this.PointRule.Add(pr);
+        }
+
+        public void RemoveRule(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                this.PointRule.Remove(pr);
+        }
+
+        [XmlIgnore]
+        public StyleType StyleType
+        {
+            get { return StyleType.Point; }
+        }
+
+        #region IRuleCollection<IPointRule> Members
+
+        public int IndexOfRule(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return this.PointRule.IndexOf(pr);
+            return -1;
+        }
+
+        public IPointRule GetRuleAt(int index)
+        {
+            return this.PointRule[index];
+        }
+
+        public bool MoveUp(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveUp(this.PointRule, pr);
+            return false;
+        }
+
+        public bool MoveDown(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveDown(this.PointRule, pr);
+            return false;
+        }
+
+        #endregion IRuleCollection<IPointRule> Members
+
+        #region IRuleCollection Members
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.PointRule[index];
+        }
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return this.PointRule.IndexOf(pr);
+            return -1;
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveUp(this.PointRule, pr);
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveDown(this.PointRule, pr);
+            return false;
+        }
+
+        #endregion IRuleCollection Members
+    }
+
+    partial class PointRuleType : IPointRule
+    {
+        [XmlIgnore]
+        ITextSymbol IBasicVectorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IPointSymbolization2D IPointRule.PointSymbolization2D
+        {
+            get { return this.Item; }
+            set { this.Item = (PointSymbolization2DType)value; }
+        }
+    }
+
+    partial class PointSymbolization2DType : IPointSymbolization2D
+    {
+        [XmlIgnore]
+        ISymbol IPointSymbolization2D.Symbol
+        {
+            get { return (ISymbol)this.Item; }
+            set { this.Item = (SymbolType)value; }
+        }
+
+        IPointSymbolization2D ICloneableLayerElement<IPointSymbolization2D>.Clone()
+        {
+            return PointSymbolization2DType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class LineTypeStyleType : ILineVectorStyle
+#if LDF_130 || LDF_230 || LDF_240
+, ILineVectorStyle2
+#endif
+    {
+        [XmlIgnore]
+        public IEnumerable<ILineRule> Rules
+        {
+            get
+            {
+                foreach (var lr in this.LineRule)
+                {
+                    yield return lr;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int IVectorStyle.RuleCount
+        {
+            get
+            {
+                if (this.LineRule != null)
+                    return this.LineRule.Count;
+                return 0;
+            }
+        }
+
+        public ILineRule GetRuleAt(int index)
+        {
+            return this.LineRule[index];
+        }
+
+        public void RemoveAllRules()
+        {
+            this.LineRule.Clear();
+        }
+
+        public void AddRule(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                this.LineRule.Add(lr);
+        }
+
+        public void RemoveRule(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                this.LineRule.Remove(lr);
+        }
+
+        [XmlIgnore]
+        public StyleType StyleType
+        {
+            get { return StyleType.Line; }
+        }
+
+        #region IRuleCollection<ILineRule> Members
+
+        public int IndexOfRule(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return this.LineRule.IndexOf(lr);
+            return -1;
+        }
+
+        public bool MoveUp(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveUp(this.LineRule, lr);
+            return false;
+        }
+
+        public bool MoveDown(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveDown(this.LineRule, lr);
+            return false;
+        }
+
+        #endregion IRuleCollection<ILineRule> Members
+
+        #region IRuleCollection Members
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.LineRule[index];
+        }
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return this.LineRule.IndexOf(lr);
+            return -1;
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveUp(this.LineRule, lr);
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveDown(this.LineRule, lr);
+            return false;
+        }
+
+        #endregion IRuleCollection Members
+    }
+
+    partial class LineRuleType : ILineRule
+    {
+        [XmlIgnore]
+        IEnumerable<IStroke> ILineRule.Strokes
+        {
+            get
+            {
+                foreach (var str in this.Items)
+                {
+                    yield return str;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int ILineRule.StrokeCount
+        {
+            get { return this.Items.Count; }
+        }
+
+        void ILineRule.SetStrokes(IEnumerable<IStroke> strokes)
+        {
+            Check.NotNull(strokes, "strokes"); //NOXLATE
+            this.Items.Clear();
+            foreach (var stroke in strokes)
+            {
+                var st = stroke as StrokeType;
+                if (st != null)
+                    this.Items.Add(st);
+            }
+        }
+
+        void ILineRule.AddStroke(IStroke stroke)
+        {
+            var st = stroke as StrokeType;
+            if (st != null)
+                this.Items.Add(st);
+        }
+
+        void ILineRule.RemoveStroke(IStroke stroke)
+        {
+            var st = stroke as StrokeType;
+            if (st != null)
+                this.Items.Remove(st);
+        }
+
+        [XmlIgnore]
+        ITextSymbol IBasicVectorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+    }
+
+    partial class TextSymbolType : ITextSymbol
+    {
+        [XmlIgnore]
+        IAdvancedPlacement ITextSymbol.AdvancedPlacement
+        {
+            get
+            {
+                return this.AdvancedPlacement;
+            }
+            set
+            {
+                this.AdvancedPlacement = (TextSymbolTypeAdvancedPlacement)value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Text
+        {
+            get
+            {
+                return this.Text;
+            }
+            set
+            {
+                this.Text = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.FontName
+        {
+            get
+            {
+                return this.FontName;
+            }
+            set
+            {
+                this.FontName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.ForegroundColor
+        {
+            get
+            {
+                return this.ForegroundColor;
+            }
+            set
+            {
+                this.ForegroundColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.BackgroundColor
+        {
+            get
+            {
+                return this.BackgroundColor;
+            }
+            set
+            {
+                this.BackgroundColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        BackgroundStyleType ITextSymbol.BackgroundStyle
+        {
+            get
+            {
+                return this.BackgroundStyle;
+            }
+            set
+            {
+                this.BackgroundStyle = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.HorizontalAlignment
+        {
+            get
+            {
+                return this.HorizontalAlignment;
+            }
+            set
+            {
+                this.HorizontalAlignment = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.VerticalAlignment
+        {
+            get
+            {
+                return this.VerticalAlignment;
+            }
+            set
+            {
+                this.VerticalAlignment = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Bold
+        {
+            get
+            {
+                return this.Bold;
+            }
+            set
+            {
+                this.Bold = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Italic
+        {
+            get
+            {
+                return this.Italic;
+            }
+            set
+            {
+                this.Italic = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Underlined
+        {
+            get
+            {
+                return this.Underlined;
+            }
+            set
+            {
+                this.Underlined = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Font; }
+        }
+
+        ITextSymbol ICloneableLayerElement<ITextSymbol>.Clone()
+        {
+            return TextSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class MarkSymbolType : IMarkSymbol
+    {
+        [XmlIgnore]
+        ShapeType IMarkSymbol.Shape
+        {
+            get
+            {
+                return this.Shape;
+            }
+            set
+            {
+                this.Shape = value;
+            }
+        }
+
+        [XmlIgnore]
+        IFill IMarkSymbol.Fill
+        {
+            get
+            {
+                return (IFill)this.Fill;
+            }
+            set
+            {
+                this.Fill = (FillType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IStroke IMarkSymbol.Edge
+        {
+            get
+            {
+                return (IStroke)this.Edge;
+            }
+            set
+            {
+                this.Edge = (StrokeType)value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Mark; }
+        }
+
+        IMarkSymbol ICloneableLayerElement<IMarkSymbol>.Clone()
+        {
+            return MarkSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    internal class ImageBinaryContainer : IInlineImageSymbol
+    {
+        [XmlIgnore]
+        public byte[] Content
+        {
+            get;
+            set;
+        }
+
+        [XmlIgnore]
+        public ImageSymbolReferenceType Type
+        {
+            get { return ImageSymbolReferenceType.Inline; }
+        }
+
+        IInlineImageSymbol ICloneableLayerElement<IInlineImageSymbol>.Clone()
+        {
+            byte[] array = null;
+            if (this.Content != null)
+            {
+                array = new byte[this.Content.Length];
+                Array.Copy(this.Content, array, this.Content.Length);
+            }
+            return new ImageBinaryContainer()
+            {
+                Content = array
+            };
+        }
+    }
+
+    partial class ImageSymbolType : IImageSymbol
+    {
+        [XmlIgnore]
+        IBaseImageSymbol IImageSymbol.Image
+        {
+            get
+            {
+                IBaseImageSymbol img = null;
+                if (this.Item == null)
+                    return null;
+
+                if (typeof(byte[]).IsAssignableFrom(this.Item.GetType()))
+                    img = new ImageBinaryContainer() { Content = (byte[])this.Item };
+                else
+                    img = (ISymbolReference)this.Item;
+                return img;
+            }
+            set
+            {
+                if (typeof(IInlineImageSymbol).IsAssignableFrom(value.GetType()))
+                    this.Item = ((IInlineImageSymbol)value).Content;
+                else
+                    this.Item = (ImageSymbolTypeImage)value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Image; }
+        }
+
+        IImageSymbol ICloneableLayerElement<IImageSymbol>.Clone()
+        {
+            return ImageSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    abstract partial class SymbolType : ISymbol
+    {
+        [XmlIgnore]
+        LengthUnitType ISymbol.Unit
+        {
+            get
+            {
+                return this.Unit;
+            }
+            set
+            {
+                this.Unit = value;
+            }
+        }
+
+        [XmlIgnore]
+        SizeContextType ISymbol.SizeContext
+        {
+            get
+            {
+                return this.SizeContext;
+            }
+            set
+            {
+                this.SizeContext = value;
+            }
+        }
+
+        [XmlIgnore]
+        bool ISymbol.MaintainAspect
+        {
+            get
+            {
+                return this.MaintainAspect;
+            }
+            set
+            {
+                this.MaintainAspect = true;
+            }
+        }
+
+        [XmlIgnore]
+        public abstract PointSymbolType Type { get; }
+
+        [XmlIgnore]
+        string ISymbol.InsertionPointY
+        {
+            get
+            {
+                return this.InsertionPointY.ToString();
+            }
+            set
+            {
+                this.InsertionPointY = Convert.ToDouble(value);
+            }
+        }
+    }
+
+    partial class FontSymbolType : IFontSymbol
+    {
+        [XmlIgnore]
+        string IFontSymbol.FontName
+        {
+            get
+            {
+                return this.FontName;
+            }
+            set
+            {
+                this.FontName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IFontSymbol.Character
+        {
+            get
+            {
+                return this.Character;
+            }
+            set
+            {
+                this.Character = value;
+            }
+        }
+
+        [XmlIgnore]
+        bool? IFontSymbol.Bold
+        {
+            get
+            {
+                return this.BoldSpecified ? new Nullable<bool>(this.Bold) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.Bold = value.Value;
+                    this.BoldSpecified = true;
+                }
+                else
+                {
+                    this.BoldSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        bool? IFontSymbol.Italic
+        {
+            get
+            {
+                return this.ItalicSpecified ? new Nullable<bool>(this.Italic) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.Italic = value.Value;
+                    this.ItalicSpecified = true;
+                }
+                else
+                {
+                    this.ItalicSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        bool? IFontSymbol.Underlined
+        {
+            get
+            {
+                return this.UnderlinedSpecified ? new Nullable<bool>(this.Underlined) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.Underlined = value.Value;
+                    this.UnderlinedSpecified = true;
+                }
+                else
+                {
+                    this.UnderlinedSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        string IFontSymbol.ForegroundColor
+        {
+            get
+            {
+                return this.ForegroundColor;
+            }
+            set
+            {
+                this.ForegroundColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Font; }
+        }
+
+        IFontSymbol ICloneableLayerElement<IFontSymbol>.Clone()
+        {
+            return FontSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class BlockSymbolType : IBlockSymbol
+    {
+        [XmlIgnore]
+        string IBlockSymbol.DrawingName
+        {
+            get
+            {
+                return this.DrawingName;
+            }
+            set
+            {
+                this.DrawingName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IBlockSymbol.BlockName
+        {
+            get
+            {
+                return this.BlockName;
+            }
+            set
+            {
+                this.BlockName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IBlockSymbol.BlockColor
+        {
+            get
+            {
+                return this.BlockColor;
+            }
+            set
+            {
+                this.BlockColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IBlockSymbol.LayerColor
+        {
+            get
+            {
+                return this.LayerColor;
+            }
+            set
+            {
+                this.LayerColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Block; }
+        }
+
+        IBlockSymbol ICloneableLayerElement<IBlockSymbol>.Clone()
+        {
+            return BlockSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class W2DSymbolType : IW2DSymbol
+    {
+        [XmlIgnore]
+        ISymbolReference IW2DSymbol.W2DSymbol
+        {
+            get
+            {
+                return (ISymbolReference)this.W2DSymbol;
+            }
+            set
+            {
+                this.W2DSymbol = (W2DSymbolTypeW2DSymbol)value;
+            }
+        }
+
+        [XmlIgnore]
+        string IW2DSymbol.FillColor
+        {
+            get
+            {
+                return this.FillColor;
+            }
+            set
+            {
+                this.FillColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IW2DSymbol.LineColor
+        {
+            get
+            {
+                return this.LineColor;
+            }
+            set
+            {
+                this.LineColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IW2DSymbol.TextColor
+        {
+            get
+            {
+                return this.TextColor;
+            }
+            set
+            {
+                this.TextColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.W2D; }
+        }
+
+        IW2DSymbol ICloneableLayerElement<IW2DSymbol>.Clone()
+        {
+            return W2DSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class W2DSymbolTypeW2DSymbol : ISymbolReference
+    {
+        [XmlIgnore]
+        ImageSymbolReferenceType IBaseImageSymbol.Type
+        {
+            get { return ImageSymbolReferenceType.SymbolReference; }
+        }
+
+        ISymbolReference ICloneableLayerElement<ISymbolReference>.Clone()
+        {
+            return W2DSymbolTypeW2DSymbol.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class ImageSymbolTypeImage : ISymbolReference
+    {
+        [XmlIgnore]
+        string ISymbolReference.ResourceId
+        {
+            get
+            {
+                return this.ResourceId == null ? string.Empty : this.ResourceId.ToString();
+            }
+            set
+            {
+                this.ResourceId = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ISymbolReference.LibraryItemName
+        {
+            get
+            {
+                return this.LibraryItemName == null ? string.Empty : this.LibraryItemName.ToString();
+            }
+            set
+            {
+                this.LibraryItemName = value;
+            }
+        }
+
+        [XmlIgnore]
+        ImageSymbolReferenceType IBaseImageSymbol.Type
+        {
+            get { return ImageSymbolReferenceType.SymbolReference; }
+        }
+
+        ISymbolReference ICloneableLayerElement<ISymbolReference>.Clone()
+        {
+            return ImageSymbolTypeImage.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class TextSymbolTypeAdvancedPlacement : IAdvancedPlacement
+    {
+    }
+
+    partial class AreaSymbolizationFillType : IAreaSymbolizationFill
+    {
+        [XmlIgnore]
+        IFill IAreaSymbolizationFill.Fill
+        {
+            get
+            {
+                return this.Fill;
+            }
+            set
+            {
+                this.Fill = (FillType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IStroke IAreaSymbolizationFill.Stroke
+        {
+            get
+            {
+                return this.Stroke;
+            }
+            set
+            {
+                this.Stroke = (StrokeType)value;
+            }
+        }
+
+        IAreaSymbolizationFill ICloneableLayerElement<IAreaSymbolizationFill>.Clone()
+        {
+            return AreaSymbolizationFillType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class LayerDefinition : ILayerDefinition
+    {
+        //internal LayerDefinition() { }
+
+#if LDF_110
+        private static readonly Version RES_VERSION = new Version(1, 1, 0);
+#elif LDF_120
+        private static readonly Version RES_VERSION = new Version(1, 2, 0);
+#elif LDF_130
+        private static readonly Version RES_VERSION = new Version(1, 3, 0);
+#elif LDF_230
+        private static readonly Version RES_VERSION = new Version(2, 3, 0);
+#elif LDF_240
+        private static readonly Version RES_VERSION = new Version(2, 4, 0);
+#else
+        private static readonly Version RES_VERSION = new Version(1, 0, 0);
+#endif
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.LayerDefinition.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.LayerDefinition));
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.LayerDefinition.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public virtual Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        object ICloneable.Clone()
+        {
+            return this.Clone();
+        }
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")] //NOXLATE
+        public string ValidatingSchema
+        {
+#if LDF_110
+            get { return "LayerDefinition-1.1.0.xsd"; } //NOXLATE
+#elif LDF_120
+            get { return "LayerDefinition-1.2.0.xsd"; } //NOXLATE
+#elif LDF_130
+            get { return "LayerDefinition-1.3.0.xsd"; } //NOXLATE
+#elif LDF_230
+            get { return "LayerDefinition-2.3.0.xsd"; } //NOXLATE
+#elif LDF_240
+            get { return "LayerDefinition-2.4.0.xsd"; } //NOXLATE
+#else
+            get { return ResourceTypes.LayerDefinition.ToString() + "-" + this.ResourceVersion.ToString() + ".xsd"; } //NOXLATE
+#endif
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        [XmlIgnore]
+        public ISubLayerDefinition SubLayer
+        {
+            get { return this.Item; }
+        }
+
+        public INameStringPair CreatePair(string name, string value)
+        {
+            return new NameStringPairType() { Name = name, Value = value };
+        }
+    }
+
+    partial class DrawingLayerDefinitionType : IDrawingLayerDefinition
+    {
+        [XmlIgnore]
+        public override LayerType LayerType
+        {
+            get { return LayerType.Drawing; }
+        }
+
+        [XmlIgnore]
+        string ISubLayerDefinition.ResourceId
+        {
+            get { return this.ResourceId; }
+            set { this.ResourceId = value; }
+        }
+    }
+
+    partial class VectorLayerDefinitionType : IVectorLayerDefinition
+#if LDF_240
+, IVectorLayerDefinition2
+#endif
+    {
+        [XmlIgnore]
+        public override LayerType LayerType
+        {
+            get { return LayerType.Vector; }
+        }
+
+        [XmlIgnore]
+        string ISubLayerDefinition.ResourceId
+        {
+            get { return this.ResourceId; }
+            set { this.ResourceId = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.FeatureName
+        {
+            get { return this.FeatureName; }
+            set { this.FeatureName = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.Geometry
+        {
+            get { return this.Geometry; }
+            set { this.Geometry = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.Url
+        {
+#if LDF_240
+            get
+            {
+                if (this.urlDataField == null)
+                    return string.Empty;
+                else
+                    return this.urlDataField.Content;
+            }
+            set
+            {
+                if (!string.IsNullOrEmpty(value))
+                {
+                    if (this.urlDataField == null)
+                        this.urlDataField = new URLDataType();
+                    this.urlDataField.Content = value;
+                    OnPropertyChanged("Url"); //NOXLATE
+                }
+                else
+                {
+                    //NOTE: None of the other URLData properties seem to be used atm
+                    //hence why we are nulling this
+                    this.urlDataField = null;
+                    OnPropertyChanged("Url"); //NOXLATE
+                }
+            }
+#else
+            get { return this.Url; }
+            set { this.Url = value; }
+#endif
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.ToolTip
+        {
+            get { return this.ToolTip; }
+            set { this.ToolTip = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.Filter
+        {
+            get { return this.Filter; }
+            set { this.Filter = value; }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IVectorScaleRange> IVectorLayerDefinition.VectorScaleRange
+        {
+            get
+            {
+                foreach (var vsr in this.VectorScaleRange)
+                {
+                    yield return vsr;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<INameStringPair> IVectorLayerDefinition.PropertyMapping
+        {
+            get
+            {
+                foreach (var pair in this.PropertyMapping)
+                {
+                    yield return pair;
+                }
+            }
+        }
+
+        INameStringPair IVectorLayerDefinition.GetPropertyMapping(string name)
+        {
+            foreach (var p in this.PropertyMapping)
+            {
+                if (p.Name == name)
+                    return p;
+            }
+            return null;
+        }
+
+        INameStringPair IVectorLayerDefinition.GetPropertyMappingAt(int index)
+        {
+            if (index < 0 || index >= this.PropertyMapping.Count)
+                throw new ArgumentOutOfRangeException();
+
+            var item = this.PropertyMapping[index];
+            return item;
+        }
+
+        void IVectorLayerDefinition.AddVectorScaleRange(IVectorScaleRange range)
+        {
+            var r = range as VectorScaleRangeType;
+            if (r != null)
+                this.VectorScaleRange.Add(r);
+        }
+
+        void IVectorLayerDefinition.RemoveVectorScaleRange(IVectorScaleRange range)
+        {
+            var r = range as VectorScaleRangeType;
+            if (r != null)
+                this.VectorScaleRange.Remove(r);
+        }
+
+        void IVectorLayerDefinition.AddPropertyMapping(INameStringPair pair)
+        {
+            var p = pair as NameStringPairType;
+            if (p != null)
+                this.PropertyMapping.Add(p);
+        }
+
+        void IVectorLayerDefinition.RemovePropertyMapping(INameStringPair pair)
+        {
+            var p = pair as NameStringPairType;
+            if (p != null)
+                this.PropertyMapping.Remove(p);
+        }
+
+        int IVectorLayerDefinition.GetPosition(INameStringPair pair)
+        {
+            var p = pair as NameStringPairType;
+            if (p != null)
+                return this.PropertyMapping.IndexOf(p);
+
+            return -1;
+        }
+
+        int IVectorLayerDefinition.MoveUp(INameStringPair pair)
+        {
+            int pos = ((IVectorLayerDefinition)this).GetPosition(pair);
+            if (pos > 0)
+            {
+                int dest = pos - 1;
+                var p = this.PropertyMapping[dest];
+                var p2 = (NameStringPairType)pair;
+
+                //Swap
+                this.PropertyMapping[dest] = p2;
+                this.PropertyMapping[pos] = p;
+
+                return dest;
+            }
+            return -1;
+        }
+
+        int IVectorLayerDefinition.MoveDown(INameStringPair pair)
+        {
+            int pos = ((IVectorLayerDefinition)this).GetPosition(pair);
+            if (pos < this.PropertyMapping.Count - 1)
+            {
+                int dest = pos + 1;
+                var p = this.PropertyMapping[dest];
+                var p2 = (NameStringPairType)pair;
+
+                //Swap
+                this.PropertyMapping[dest] = p2;
+                this.PropertyMapping[pos] = p;
+
+                return dest;
+            }
+            return -1;
+        }
+
+        void IVectorLayerDefinition.RemoveAllScaleRanges()
+        {
+            this.VectorScaleRange.Clear();
+        }
+
+        int IVectorLayerDefinition.IndexOfScaleRange(IVectorScaleRange range)
+        {
+            var r = range as VectorScaleRangeType;
+            if (r != null)
+                return this.VectorScaleRange.IndexOf(r);
+
+            return -1;
+        }
+
+        IVectorScaleRange IVectorLayerDefinition.GetScaleRangeAt(int index)
+        {
+            if (index >= this.VectorScaleRange.Count)
+                return null;
+
+            return this.VectorScaleRange[index];
+        }
+
+        [XmlIgnore]
+        Version IVectorLayerDefinition.SymbolDefinitionVersion
+        {
+            get
+            {
+#if LDF_110
+                return new Version(1, 0, 0);
+#elif LDF_120 || LDF_130 || LDF_230
+                return new Version(1, 1, 0);
+#elif LDF_240
+                return new Version(2, 4, 0);
+#else
+                return null;
+#endif
+            }
+        }
+
+#if LDF_240
+
+        [XmlIgnore]
+        IUrlData IVectorLayerDefinition2.UrlData
+        {
+            get
+            {
+                return this.UrlData;
+            }
+            set
+            {
+                this.UrlData = (URLDataType)value;
+            }
+        }
+
+#endif
+
+        void IVectorLayerDefinition.ClearPropertyMappings()
+        {
+            propertyMappingField.Clear();
+        }
+    }
+
+    #region Composite Symbolization
+
+#if !LDF_100
+
+    partial class CompositeRule : ICompositeRule
+    {
+        [XmlIgnore]
+        ICompositeSymbolization ICompositeRule.CompositeSymbolization
+        {
+            get
+            {
+                return this.CompositeSymbolization;
+            }
+            set
+            {
+                this.CompositeSymbolization = (CompositeSymbolization)value;
+            }
+        }
+    }
+
+    partial class CompositeSymbolization : ICompositeSymbolization
+    {
+        [XmlIgnore]
+        IEnumerable<ISymbolInstance> ICompositeSymbolization.SymbolInstance
+        {
+            get
+            {
+                foreach (var sym in this.SymbolInstance)
+                {
+                    yield return sym;
+                }
+            }
+        }
+
+        public string ToXml()
+        {
+            return this.Serialize();
+        }
+
+        public void UpdateFromXml(string xml)
+        {
+            var compsym = CompositeSymbolization.Deserialize(xml);
+            this.SymbolInstance.Clear();
+            foreach (var sym in compsym.SymbolInstance)
+            {
+                this.AddSymbolInstance(sym);
+            }
+        }
+
+        public void AddSymbolInstance(ISymbolInstance inst)
+        {
+            var sym = inst as SymbolInstance;
+            if (sym != null)
+                this.SymbolInstance.Add(sym);
+        }
+
+        public void RemoveSymbolInstance(ISymbolInstance inst)
+        {
+            var sym = inst as SymbolInstance;
+            if (sym != null)
+                this.SymbolInstance.Remove(sym);
+        }
+
+        public void RemoveAllSymbolInstances()
+        {
+            this.SymbolInstance.Clear();
+        }
+
+        public ISymbolInstance CreateSymbolReference(string resourceId)
+        {
+            return new SymbolInstance()
+            {
+                Item = resourceId,
+                ParameterOverrides = new ParameterOverrides()
+                {
+                    Override = new BindingList<Override>()
+                },
+            };
+        }
+
+        public ISymbolInstance CreateInlineSimpleSymbol(ISimpleSymbolDefinition symDef)
+        {
+            return new SymbolInstance()
+            {
+#if LDF_110
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition)symDef,
+#elif LDF_120 || LDF_130 || LDF_230
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.SimpleSymbolDefinition)symDef,
+#else
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_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.v1_0_0.CompoundSymbolDefinition)compDef,
+#elif LDF_120 || LDF_130 || LDF_230
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.CompoundSymbolDefinition)compDef,
+#else
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.CompoundSymbolDefinition)compDef,
+#endif
+                ParameterOverrides = new ParameterOverrides()
+                {
+                    Override = new BindingList<Override>()
+                }
+            };
+        }
+    }
+
+    partial class SymbolInstance : ISymbolInstance
+#if LDF_100 || LDF_110
+#else
+, ISymbolInstance2
+#endif
+    {
+        [XmlIgnore]
+        IParameterOverrideCollection ISymbolInstance.ParameterOverrides
+        {
+            get { return this.ParameterOverrides; }
+        }
+
+        [XmlIgnore]
+        public ISymbolInstanceReference Reference
+        {
+            get
+            {
+                var libId = this.Item as string;
+#if LDF_110
+                var simpSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition;
+                var compSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.CompoundSymbolDefinition;
+#elif LDF_120 || LDF_130 || LDF_230
+                var simpSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.SimpleSymbolDefinition;
+                var compSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.CompoundSymbolDefinition;
+#else
+                var simpSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.SimpleSymbolDefinition;
+                var compSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.CompoundSymbolDefinition;
+#endif
+                if (libId != null)
+                    return new SymbolInstanceLibrary() { ResourceId = libId };
+                else if (simpSym != null)
+                    return new SymbolInstanceInline() { SymbolDefinition = simpSym };
+                else if (compSym != null)
+                    return new SymbolInstanceInline() { SymbolDefinition = compSym };
+                return null;
+            }
+            set
+            {
+                var sr = value as ISymbolInstanceReferenceLibrary;
+                var ir = value as ISymbolInstanceReferenceInline;
+                if (sr != null)
+                {
+                    this.Item = sr.ResourceId;
+                }
+                else if (ir != null)
+                {
+#if LDF_110
+                    if (ir.SymbolDefinition.Type == SymbolDefinitionType.Simple)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition)ir.SymbolDefinition;
+                    else if (ir.SymbolDefinition.Type == SymbolDefinitionType.Compound)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.CompoundSymbolDefinition)ir.SymbolDefinition;
+#elif LDF_120 || LDF_130 || LDF_230
+                    if (ir.SymbolDefinition.Type == SymbolDefinitionType.Simple)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.SimpleSymbolDefinition)ir.SymbolDefinition;
+                    else if (ir.SymbolDefinition.Type == SymbolDefinitionType.Compound)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.CompoundSymbolDefinition)ir.SymbolDefinition;
+#else
+                    if (ir.SymbolDefinition.Type == SymbolDefinitionType.Simple)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.SimpleSymbolDefinition)ir.SymbolDefinition;
+                    else if (ir.SymbolDefinition.Type == SymbolDefinitionType.Compound)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.CompoundSymbolDefinition)ir.SymbolDefinition;
+#endif
+                }
+                this.Item = null;
+            }
+        }
+    }
+
+    partial class SymbolInstanceLibrary : ISymbolInstanceReferenceLibrary
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceId
+        {
+            get { return _resId; }
+            set
+            {
+                if (_resId == value) return;
+                _resId = value;
+                OnPropertyChanged("ResourceId"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public SymbolInstanceType Type
+        {
+            get { return SymbolInstanceType.Reference; }
+        }
+
+        public event PropertyChangedEventHandler PropertyChanged;
+
+        private void OnPropertyChanged(string name)
+        {
+            var handler = this.PropertyChanged;
+            if (handler != null)
+                handler(this, new PropertyChangedEventArgs(name));
+        }
+    }
+
+    partial class SymbolInstanceInline : ISymbolInstanceReferenceInline
+    {
+        [XmlIgnore]
+        public ISymbolDefinitionBase SymbolDefinition
+        {
+            get;
+            set;
+        }
+
+        [XmlIgnore]
+        public SymbolInstanceType Type
+        {
+            get { return SymbolInstanceType.Inline; }
+        }
+    }
+
+    partial class ParameterOverrides : IParameterOverrideCollection
+    {
+        [XmlIgnore]
+        IEnumerable<IParameterOverride> IParameterOverrideCollection.Override
+        {
+            get
+            {
+                foreach (var ov in this.Override)
+                {
+                    yield return ov;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public int Count
+        {
+            get { return this.Override.Count; }
+        }
+
+        [XmlIgnore]
+        public IParameterOverride this[int index]
+        {
+            get
+            {
+                if (index >= this.Override.Count)
+                    throw new ArgumentOutOfRangeException();
+
+                return this.Override[index];
+            }
+        }
+
+        public void AddOverride(IParameterOverride ov)
+        {
+            var o = ov as Override;
+            if (o != null)
+                this.Override.Add(o);
+        }
+
+        public void RemoveOverride(IParameterOverride ov)
+        {
+            var o = ov as Override;
+            if (o != null)
+                this.Override.Remove(o);
+        }
+
+        public IParameterOverride CreateParameterOverride(string symbol, string name)
+        {
+            return new Override()
+            {
+                ParameterIdentifier = name,
+                SymbolName = symbol
+            };
+        }
+    }
+
+    partial class Override : IParameterOverride
+    {
+    }
+
+    partial class CompositeTypeStyle : ICompositeTypeStyle
+#if LDF_130 || LDF_230 || LDF_240
+, ICompositeTypeStyle2
+#endif
+    {
+        [XmlIgnore]
+        string ICompositeTypeStyle.DisplayString
+        {
+            get
+            {
+                return Strings.CompositeStyleDisplayString;
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<ICompositeRule> ICompositeTypeStyle.CompositeRule
+        {
+            get
+            {
+                foreach (var cr in this.CompositeRule)
+                {
+                    yield return cr;
+                }
+            }
+        }
+
+        public void AddCompositeRule(ICompositeRule compRule)
+        {
+            var cr = compRule as CompositeRule;
+            if (cr != null)
+                this.CompositeRule.Add(cr);
+        }
+
+        public void RemoveCompositeRule(ICompositeRule compRule)
+        {
+            var cr = compRule as CompositeRule;
+            if (cr != null)
+                this.CompositeRule.Remove(cr);
+        }
+
+        [XmlIgnore]
+        public StyleType StyleType
+        {
+            get { return StyleType.Composite; }
+        }
+
+        [XmlIgnore]
+        public int RuleCount
+        {
+            get { return this.CompositeRule.Count; }
+        }
+
+    #region IRuleCollection<ICompositeRule> Members
+
+        public int IndexOfRule(ICompositeRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return this.CompositeRule.IndexOf(cr);
+            return -1;
+        }
+
+        public ICompositeRule GetRuleAt(int index)
+        {
+            return this.CompositeRule[index];
+        }
+
+        public bool MoveUp(ICompositeRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveUp(this.CompositeRule, cr);
+            return false;
+        }
+
+        public bool MoveDown(ICompositeRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveDown(this.CompositeRule, cr);
+            return false;
+        }
+
+    #endregion IRuleCollection<ICompositeRule> Members
+
+    #region IRuleCollection Members
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return this.CompositeRule.IndexOf(cr);
+            return -1;
+        }
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.CompositeRule[index];
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveUp(this.CompositeRule, cr);
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveDown(this.CompositeRule, cr);
+            return false;
+        }
+
+    #endregion IRuleCollection Members
+    }
+
+#endif
+
+    #endregion Composite Symbolization
+
+#if LDF_240
+
+    partial class URLDataType : IUrlData
+    {
+    }
+
+#endif
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_2_0/GridLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_2_0/GridLayerDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_2_0/GridLayerDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,735 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LDF_120
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LDF_110
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0
+#elif LDF_120
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0
+#elif LDF_130
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0
+#elif LDF_230
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0
+#elif LDF_240
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0
+#endif
+{
+    using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+    using System.Xml.Serialization;
+
+    partial class GridLayerDefinitionType : IRasterLayerDefinition
+    {
+        [XmlIgnore]
+        public override LayerType LayerType
+        {
+            get { return LayerType.Raster; }
+        }
+
+        [XmlIgnore]
+        string ISubLayerDefinition.ResourceId
+        {
+            get { return this.ResourceId; }
+            set { this.ResourceId = value; }
+        }
+
+        [XmlIgnore]
+        string IRasterLayerDefinition.FeatureName
+        {
+            get
+            {
+                return this.FeatureName;
+            }
+            set
+            {
+                this.FeatureName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IRasterLayerDefinition.Geometry
+        {
+            get
+            {
+                return this.Geometry;
+            }
+            set
+            {
+                this.Geometry = value;
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IGridScaleRange> IRasterLayerDefinition.GridScaleRange
+        {
+            get
+            {
+                foreach (var gsr in this.GridScaleRange)
+                {
+                    yield return gsr;
+                }
+            }
+        }
+
+        public void AddGridScaleRange(IGridScaleRange range)
+        {
+            var gsr = range as GridScaleRangeType;
+            if (gsr != null)
+            {
+                this.GridScaleRange.Add(gsr);
+            }
+        }
+
+        public void RemoveGridScaleRange(IGridScaleRange range)
+        {
+            var gsr = range as GridScaleRangeType;
+            if (gsr != null)
+            {
+                this.GridScaleRange.Remove(gsr);
+            }
+        }
+
+        public int IndexOfScaleRange(IGridScaleRange range)
+        {
+            var gsr = range as GridScaleRangeType;
+            if (gsr != null)
+            {
+                this.GridScaleRange.IndexOf(gsr);
+            }
+            return -1;
+        }
+
+        public IGridScaleRange GetScaleRangeAt(int index)
+        {
+            return this.GridScaleRange[index];
+        }
+
+        [XmlIgnore]
+        public int GridScaleRangeCount { get { return this.GridScaleRange.Count; } }
+    }
+
+    partial class ChannelBandType : IChannelBand
+    {
+        [XmlIgnore]
+        string IChannelBand.Band
+        {
+            get
+            {
+                return this.Band;
+            }
+            set
+            {
+                this.Band = value;
+            }
+        }
+
+        [XmlIgnore]
+        double? IChannelBand.LowBand
+        {
+            get
+            {
+                return this.LowBandSpecified ? new Nullable<double>(this.LowBand) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.LowBand = value.Value;
+                    this.LowBandSpecified = true;
+                }
+                else
+                {
+                    this.LowBandSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        double? IChannelBand.HighBand
+        {
+            get
+            {
+                return this.HighBandSpecified ? new Nullable<double>(this.HighBand) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.HighBand = value.Value;
+                    this.HighBandSpecified = true;
+                }
+                else
+                {
+                    this.HighBandSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        byte IChannelBand.LowChannel
+        {
+            get
+            {
+                return this.LowChannel;
+            }
+            set
+            {
+                this.LowChannel = value;
+            }
+        }
+
+        [XmlIgnore]
+        byte IChannelBand.HighChannel
+        {
+            get
+            {
+                return this.HighChannel;
+            }
+            set
+            {
+                this.HighChannel = value;
+            }
+        }
+    }
+
+    partial class GridColorBandsType : IGridColorBands
+    {
+        [XmlIgnore]
+        IChannelBand IGridColorBands.RedBand
+        {
+            get
+            {
+                return this.RedBand;
+            }
+            set
+            {
+                this.RedBand = (ChannelBandType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IChannelBand IGridColorBands.GreenBand
+        {
+            get
+            {
+                return this.GreenBand;
+            }
+            set
+            {
+                this.GreenBand = (ChannelBandType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IChannelBand IGridColorBands.BlueBand
+        {
+            get
+            {
+                return this.BlueBand;
+            }
+            set
+            {
+                this.BlueBand = (ChannelBandType)value;
+            }
+        }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal abstract class ExplicitColorBase : IExplicitColor
+    {
+        [XmlIgnore]
+        public abstract ItemChoiceType Type { get; }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal class ExplicitColorBand : ExplicitColorBase, IExplicitColorBand
+    {
+        [XmlIgnore]
+        public string Band { get; set; }
+
+        [XmlIgnore]
+        public override ItemChoiceType Type
+        {
+            get { return ItemChoiceType.Band; }
+        }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal class ExplicitColor : ExplicitColorBase, IExplictColorValue
+    {
+        [XmlIgnore]
+        public string Value { get; set; }
+
+        [XmlIgnore]
+        public override ItemChoiceType Type
+        {
+            get { return ItemChoiceType.ExplicitColor; }
+        }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal class ExplicitColorBands : ExplicitColorBase, IExplicitColorBands
+    {
+        [XmlIgnore]
+        public IGridColorBands Bands { get; set; }
+
+        [XmlIgnore]
+        public override ItemChoiceType Type
+        {
+            get { return ItemChoiceType.Bands; }
+        }
+    }
+
+    partial class GridColorType : IGridColor
+    {
+        [XmlIgnore]
+        IExplicitColor IGridColor.ExplicitColor
+        {
+            get
+            {
+                return ParseItem();
+            }
+            set
+            {
+                switch (this.ItemElementName)
+                {
+                    case ItemChoiceType.Band:
+                        this.Item = ((ExplicitColorBand)value).Band;
+                        break;
+
+                    case ItemChoiceType.Bands:
+                        this.Item = ((ExplicitColorBands)value).Bands;
+                        break;
+
+                    case ItemChoiceType.ExplicitColor:
+                        this.Item = ((ExplicitColor)value).Value;
+                        break;
+                }
+            }
+        }
+
+        private IExplicitColor ParseItem()
+        {
+            if (this.Item == null)
+                return null;
+
+            switch (this.ItemElementName)
+            {
+                case ItemChoiceType.Band:
+                    return new ExplicitColorBand() { Band = (string)this.Item };
+
+                case ItemChoiceType.Bands:
+                    return new ExplicitColorBands() { Bands = (IGridColorBands)this.Item };
+
+                case ItemChoiceType.ExplicitColor:
+                    return new ExplicitColor() { Value = (string)this.Item };
+            }
+
+            throw new Exception(); //Should never get here
+        }
+
+        public void SetValue(string htmlColor)
+        {
+            this.ItemElementName = ItemChoiceType.ExplicitColor;
+            this.Item = htmlColor;
+        }
+
+        public string GetValue()
+        {
+            if (this.Item != null && this.ItemElementName == ItemChoiceType.ExplicitColor)
+            {
+                return this.Item.ToString();
+            }
+            return null;
+        }
+    }
+
+    partial class GridColorRuleType : IGridColorRule
+    {
+        [XmlIgnore]
+        string IGridColorRule.LegendLabel
+        {
+            get
+            {
+                return this.LegendLabel;
+            }
+            set
+            {
+                this.LegendLabel = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IGridColorRule.Filter
+        {
+            get
+            {
+                return this.Filter;
+            }
+            set
+            {
+                this.Filter = value;
+            }
+        }
+
+        [XmlIgnore]
+        ITextSymbol IGridColorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IGridColor IGridColorRule.Color
+        {
+            get
+            {
+                return this.Color;
+            }
+            set
+            {
+                this.Color = (GridColorType)value;
+            }
+        }
+    }
+
+    partial class HillShadeType : IHillShade
+    {
+        [XmlIgnore]
+        string IHillShade.Band
+        {
+            get
+            {
+                return this.Band;
+            }
+            set
+            {
+                this.Band = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IHillShade.Azimuth
+        {
+            get
+            {
+                return this.Azimuth;
+            }
+            set
+            {
+                this.Azimuth = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IHillShade.Altitude
+        {
+            get
+            {
+                return this.Altitude;
+            }
+            set
+            {
+                this.Altitude = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IHillShade.ScaleFactor
+        {
+            get
+            {
+                return this.ScaleFactor;
+            }
+            set
+            {
+                this.ScaleFactor = value;
+            }
+        }
+    }
+
+    partial class GridColorStyleType : IGridColorStyle
+    {
+        [XmlIgnore]
+        IHillShade IGridColorStyle.HillShade
+        {
+            get
+            {
+                return this.HillShade;
+            }
+            set
+            {
+                this.HillShade = (HillShadeType)value;
+            }
+        }
+
+        [XmlIgnore]
+        string IGridColorStyle.TransparencyColor
+        {
+            get
+            {
+                return this.TransparencyColor == null ? string.Empty : this.TransparencyColor.ToString();
+            }
+            set
+            {
+                this.TransparencyColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        double? IGridColorStyle.BrightnessFactor
+        {
+            get
+            {
+                return this.BrightnessFactor;
+            }
+            set
+            {
+                this.BrightnessFactor = value.HasValue ? value.Value : default(double);
+            }
+        }
+
+        [XmlIgnore]
+        double? IGridColorStyle.ContrastFactor
+        {
+            get
+            {
+                return this.ContrastFactor;
+            }
+            set
+            {
+                this.ContrastFactor = value.HasValue ? value.Value : default(double);
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IGridColorRule> IGridColorStyle.ColorRule
+        {
+            get
+            {
+                foreach (var cr in this.ColorRule)
+                {
+                    yield return cr;
+                }
+            }
+        }
+
+        void IGridColorStyle.AddColorRule(IGridColorRule rule)
+        {
+            var cr = rule as GridColorRuleType;
+            if (cr != null)
+                this.ColorRule.Add((GridColorRuleType)cr);
+        }
+
+        void IGridColorStyle.RemoveColorRule(IGridColorRule rule)
+        {
+            var cr = rule as GridColorRuleType;
+            if (cr != null)
+                this.ColorRule.Remove((GridColorRuleType)cr);
+        }
+
+        [XmlIgnore]
+        public int ColorRuleCount
+        {
+            get { return this.ColorRule.Count; }
+        }
+
+        public IGridColorRule GetColorRuleAt(int index)
+        {
+            return this.ColorRule[index];
+        }
+
+        public IHillShade CreateHillShade()
+        {
+            return new HillShadeType();
+        }
+    }
+
+    partial class GridSurfaceStyleType : IGridSurfaceStyle
+    {
+        [XmlIgnore]
+        string IGridSurfaceStyle.Band
+        {
+            get
+            {
+                return this.Band;
+            }
+            set
+            {
+                this.Band = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IGridSurfaceStyle.ZeroValue
+        {
+            get
+            {
+                return this.ZeroValue;
+            }
+            set
+            {
+                this.ZeroValue = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IGridSurfaceStyle.ScaleFactor
+        {
+            get
+            {
+                return this.ScaleFactor;
+            }
+            set
+            {
+                this.ScaleFactor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IGridSurfaceStyle.DefaultColor
+        {
+            get
+            {
+                return this.DefaultColor;
+            }
+            set
+            {
+                this.DefaultColor = value;
+            }
+        }
+    }
+
+    partial class GridScaleRangeType : IGridScaleRange
+    {
+        [XmlIgnore]
+        double? IGridScaleRange.MinScale
+        {
+            get
+            {
+                return this.MinScale;
+            }
+            set
+            {
+                if (value.HasValue)
+                    this.MinScale = value.Value;
+            }
+        }
+
+        [XmlIgnore]
+        double? IGridScaleRange.MaxScale
+        {
+            get
+            {
+                return this.MaxScaleSpecified ? new Nullable<double>(this.MaxScale) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.MaxScale = value.Value;
+                    this.MaxScaleSpecified = true;
+                }
+                else
+                {
+                    this.MaxScaleSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        IGridSurfaceStyle IGridScaleRange.SurfaceStyle
+        {
+            get
+            {
+                return this.SurfaceStyle;
+            }
+            set
+            {
+                this.SurfaceStyle = (GridSurfaceStyleType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IGridColorStyle IGridScaleRange.ColorStyle
+        {
+            get
+            {
+                return this.ColorStyle;
+            }
+            set
+            {
+                this.ColorStyle = (GridColorStyleType)value;
+            }
+        }
+
+        [XmlIgnore]
+        double IGridScaleRange.RebuildFactor
+        {
+            get
+            {
+                return this.RebuildFactor;
+            }
+            set
+            {
+                this.RebuildFactor = value;
+            }
+        }
+
+        public IGridColorStyle CreateColorStyle()
+        {
+            return new GridColorStyleType()
+            {
+                ColorRule = new System.ComponentModel.BindingList<GridColorRuleType>(),
+                HillShade = new HillShadeType()
+            };
+        }
+
+        public IGridSurfaceStyle CreateSurfaceStyle()
+        {
+            return new GridSurfaceStyleType();
+        }
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_2_0/LayerElementFactoryImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_2_0/LayerElementFactoryImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_2_0/LayerElementFactoryImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,489 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LDF_120
+using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LDF_110
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0
+#elif LDF_120
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0
+#elif LDF_130
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0
+#elif LDF_230
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0
+#elif LDF_240
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0
+#endif
+{
+    /// <summary>
+    /// A publically accessible entry point primarily used for registration with the <see cref="ObjectFactory"/> and
+    /// <see cref="ResourceTypeRegistry"/> classes
+    /// </summary>
+    public static class LdfEntryPoint
+    {
+        public static ILayerDefinition CreateDefault(LayerType type)
+        {
+            return LayerDefinition.CreateDefault(type);
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            return LayerDefinition.Deserialize(xml);
+        }
+
+        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 ctss = vsr2.CompositeStyle;
+                        if (ctss != null)
+                        {
+                            foreach (var cts in ctss)
+                            {
+                                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();
+        }
+    }
+
+    partial class LayerDefinition : ILayerElementFactory
+    {
+        public static ILayerDefinition CreateDefault(LayerType type)
+        {
+            var lyr = new LayerDefinition();
+            switch (type)
+            {
+                case LayerType.Drawing:
+                    lyr.CreateDrawingLayer();
+                    break;
+
+                case LayerType.Raster:
+                    lyr.CreateRasterLayer();
+                    break;
+
+                case LayerType.Vector:
+                    lyr.CreateVectorLayer();
+                    break;
+            }
+            return lyr;
+        }
+
+        protected virtual VectorLayerDefinitionType CreateVectorLayerInstance()
+        {
+            return new VectorLayerDefinitionType();
+        }
+
+        protected virtual VectorScaleRangeType CreateVectorScaleRangeInstance()
+        {
+            return new VectorScaleRangeType()
+            {
+                Items = new System.ComponentModel.BindingList<object>(),
+                AreaStyle = CreateDefaultAreaStyle(),
+                LineStyle = CreateDefaultLineStyle(),
+                PointStyle = CreateDefaultPointStyle()
+            };
+        }
+
+        public void CreateVectorLayer()
+        {
+            var vl = this.CreateVectorLayerInstance();
+            /*
+            var vl = new VectorLayerDefinitionType()
+            {
+#if LDF_240
+                Watermarks = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_4_0.WatermarkType>()
+#elif LDF_230
+                Watermarks = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_3_0.WatermarkType>()
+#endif
+            };
+             */
+
+            //TODO: Create composite type style if 1.2 or 1.3 schema
+
+            vl.VectorScaleRange = new System.ComponentModel.BindingList<VectorScaleRangeType>();
+            var defaultRange = this.CreateVectorScaleRangeInstance();
+            /*
+            var defaultRange = new VectorScaleRangeType()
+            {
+                Items = new System.ComponentModel.BindingList<object>(),
+                AreaStyle = CreateDefaultAreaStyle(),
+                LineStyle = CreateDefaultLineStyle(),
+                PointStyle = CreateDefaultPointStyle(),
+#if LDF_100 || LDF_110
+#else
+                CompositeStyle = new ICompositeTypeStyle[] { CreateDefaultCompositeStyle() }
+#endif
+            };
+             */
+            vl.VectorScaleRange.Add(defaultRange);
+
+            this.Item = vl;
+        }
+
+        public void CreateRasterLayer()
+        {
+            var gl = new GridLayerDefinitionType()
+            {
+                GridScaleRange = new System.ComponentModel.BindingList<GridScaleRangeType>(),
+            };
+
+            gl.AddGridScaleRange(new GridScaleRangeType()
+            {
+                ColorStyle = new GridColorStyleType()
+                {
+                    ColorRule = new System.ComponentModel.BindingList<GridColorRuleType>()
+                    {
+                        new GridColorRuleType() {
+                            LegendLabel = string.Empty,
+                            Color = new GridColorType()
+                        },
+                        new GridColorRuleType() {
+                            LegendLabel = string.Empty,
+                            Color = new GridColorType()
+                        }
+                    }
+                },
+                RebuildFactor = 1.0
+            });
+
+            gl.GetScaleRangeAt(0).ColorStyle.GetColorRuleAt(0).Color.SetValue("000000"); //NOXLATE
+            gl.GetScaleRangeAt(0).ColorStyle.GetColorRuleAt(1).Color.SetValue("FFFFFF"); //NOXLATE
+
+            this.Item = gl;
+        }
+
+        public void CreateDrawingLayer()
+        {
+            this.Item = new DrawingLayerDefinitionType();
+        }
+
+        /// <summary>
+        /// Creates a fill
+        /// </summary>
+        /// <param name="pattern"></param>
+        /// <param name="background"></param>
+        /// <param name="foreground"></param>
+        /// <returns></returns>
+        public IFill CreateFill(string pattern, System.Drawing.Color background, System.Drawing.Color foreground)
+        {
+            return new FillType()
+            {
+                BackgroundColor = Utility.SerializeHTMLColor(background, true),
+                FillPattern = pattern,
+                ForegroundColor = Utility.SerializeHTMLColor(foreground, true)
+            };
+        }
+
+        /// <summary>
+        /// Creates a line stroke with default settings
+        /// </summary>
+        /// <param name="color"></param>
+        /// <returns></returns>
+        public IStroke CreateStroke(System.Drawing.Color color)
+        {
+            return new StrokeType()
+            {
+                Color = Utility.SerializeHTMLColor(color, true),
+                LineStyle = "Solid", //NOXLATE
+                Thickness = "1", //NOXLATE
+                Unit = LengthUnitType.Points
+            };
+        }
+
+        public IStroke CreateDefaultStroke()
+        {
+            return CreateStroke(Color.Black);
+        }
+
+        public IPointVectorStyle CreateDefaultPointStyle()
+        {
+            IPointVectorStyle pts = new PointTypeStyleType()
+            {
+                PointRule = new System.ComponentModel.BindingList<PointRuleType>()
+            };
+            pts.AddRule(CreateDefaultPointRule());
+            return pts;
+        }
+
+        public ILineVectorStyle CreateDefaultLineStyle()
+        {
+            ILineVectorStyle lts = new LineTypeStyleType()
+            {
+                LineRule = new System.ComponentModel.BindingList<LineRuleType>()
+            };
+            lts.AddRule(CreateDefaultLineRule());
+            return lts;
+        }
+
+        public IAreaVectorStyle CreateDefaultAreaStyle()
+        {
+            IAreaVectorStyle ats = new AreaTypeStyleType()
+            {
+                AreaRule = new System.ComponentModel.BindingList<AreaRuleType>()
+            };
+            ats.AddRule(CreateDefaultAreaRule());
+            return ats;
+        }
+
+        public IVectorScaleRange CreateVectorScaleRange()
+        {
+            return new VectorScaleRangeType()
+            {
+                Items = new System.ComponentModel.BindingList<object>(),
+                AreaStyle = CreateDefaultAreaStyle(),
+                LineStyle = CreateDefaultLineStyle(),
+                PointStyle = CreateDefaultPointStyle()
+            };
+        }
+
+        public IFill CreateDefaultFill()
+        {
+            return CreateFill("Solid", Color.White, Color.White); //NOXLATE
+        }
+
+        public IMarkSymbol CreateDefaultMarkSymbol()
+        {
+            IMarkSymbol sym = new MarkSymbolType()
+            {
+                SizeContext = SizeContextType.DeviceUnits,
+                MaintainAspect = true,
+                Shape = ShapeType.Square,
+                Rotation = "0", //NOXLATE
+                SizeX = "10", //NOXLATE
+                SizeY = "10", //NOXLATE
+                Unit = LengthUnitType.Points
+            };
+            sym.Edge = CreateDefaultStroke();
+            sym.Fill = CreateDefaultFill();
+            return sym;
+        }
+
+        public IFontSymbol CreateDefaultFontSymbol()
+        {
+            IFontSymbol sym = new FontSymbolType()
+            {
+                SizeContext = SizeContextType.DeviceUnits,
+                MaintainAspect = true,
+                FontName = "Arial", //NOXLATE
+                Rotation = "0", //NOXLATE
+                SizeX = "10", //NOXLATE
+                SizeY = "10", //NOXLATE
+                Unit = LengthUnitType.Points
+            };
+            sym.SetForegroundColor(Color.Black);
+            return sym;
+        }
+
+        public IPointSymbolization2D CreateDefaultPointSymbolization2D()
+        {
+            IPointSymbolization2D sym = new PointSymbolization2DType();
+            sym.Symbol = CreateDefaultMarkSymbol();
+            return sym;
+        }
+
+        public IPointRule CreateDefaultPointRule()
+        {
+            IPointRule pr = new PointRuleType()
+            {
+                LegendLabel = string.Empty
+            };
+            pr.PointSymbolization2D = CreateDefaultPointSymbolization2D();
+            return pr;
+        }
+
+        public IAreaRule CreateDefaultAreaRule()
+        {
+            IAreaRule ar = new AreaRuleType()
+            {
+                LegendLabel = string.Empty
+            };
+            ar.AreaSymbolization2D = CreateDefaultAreaSymbolizationFill();
+            return ar;
+        }
+
+        public IAreaSymbolizationFill CreateDefaultAreaSymbolizationFill()
+        {
+            IAreaSymbolizationFill fill = new AreaSymbolizationFillType();
+            fill.Fill = CreateDefaultFill();
+            fill.Stroke = CreateDefaultStroke();
+
+            return fill;
+        }
+
+        public ILineRule CreateDefaultLineRule()
+        {
+            ILineRule lr = new LineRuleType()
+            {
+                LegendLabel = "",
+                Items = new System.ComponentModel.BindingList<StrokeType>()
+            };
+            lr.AddStroke(CreateDefaultStroke());
+            return lr;
+        }
+
+        public IAdvancedPlacement CreateDefaultAdvancedPlacement(double scaleLimit)
+        {
+            return new TextSymbolTypeAdvancedPlacement() { ScaleLimit = scaleLimit };
+        }
+
+        public ITextSymbol CreateDefaultTextSymbol()
+        {
+            return new TextSymbolType()
+            {
+                AdvancedPlacement = null,
+                BackgroundColor = Utility.SerializeHTMLColor(Color.White, true),
+                BackgroundStyle = BackgroundStyleType.Transparent,
+                Bold = "false", //NOXLATE
+                FontName = "Arial", //NOXLATE
+                ForegroundColor = Utility.SerializeHTMLColor(Color.Black, true),
+                HorizontalAlignment = "'Center'", //NOXLATE
+                Italic = "false", //NOXLATE
+                Rotation = "0", //NOXLATE
+                SizeContext = SizeContextType.DeviceUnits,
+                SizeX = "10", //NOXLATE
+                SizeY = "10", //NOXLATE
+                Text = string.Empty,
+                Underlined = "false", //NOXLATE
+                Unit = LengthUnitType.Points,
+                VerticalAlignment = "'Baseline'" //NOXLATE
+            };
+        }
+
+        public IW2DSymbol CreateDefaultW2DSymbol(string symbolLibrary, string symbolName)
+        {
+            return new W2DSymbolType()
+            {
+                W2DSymbol = new W2DSymbolTypeW2DSymbol()
+                {
+                    ResourceId = symbolLibrary,
+                    LibraryItemName = symbolName
+                },
+            };
+        }
+
+        public virtual ICompositeRule CreateDefaultCompositeRule()
+        {
+#if LDF_100
+            throw new NotImplementedException();
+#else
+            return new CompositeRule()
+            {
+                LegendLabel = string.Empty,
+                CompositeSymbolization = new CompositeSymbolization()
+                {
+                    SymbolInstance = new System.ComponentModel.BindingList<SymbolInstance>()
+                }
+            };
+#endif
+        }
+
+        public virtual ICompositeTypeStyle CreateDefaultCompositeStyle()
+        {
+#if LDF_100
+            throw new NotImplementedException();
+#else
+            var cts = new CompositeTypeStyle()
+            {
+                CompositeRule = new System.ComponentModel.BindingList<CompositeRule>(),
+#if LDF_110 || LDF_120
+#else
+                ShowInLegend = true,
+#endif
+            };
+            cts.AddCompositeRule(CreateDefaultCompositeRule());
+            return cts;
+#endif
+        }
+
+        public virtual IUrlData CreateUrlData()
+        {
+#if LDF_240
+            return new URLDataType();
+#else
+            throw new NotImplementedException();
+#endif
+        }
+
+        public virtual ICompositeSymbolization CloneCompositeSymbolization(ICompositeSymbolization sym)
+        {
+#if LDF_100
+            throw new NotImplementedException();
+#else
+            var csym = (CompositeSymbolization)sym;
+            //Use quick and dirty XML in'n'out cloning to ensure no existing child references are
+            //carried over
+            var clone = CompositeSymbolization.Deserialize(csym.Serialize());
+            /*
+            foreach (var oldInst in csym.SymbolInstance)
+            {
+                System.Diagnostics.Debug.WriteLine("old symbol instance: {0}", oldInst.GetHashCode());
+            }
+            foreach (var newInst in clone.SymbolInstance)
+            {
+                System.Diagnostics.Debug.WriteLine("new symbol instance: {0}", newInst.GetHashCode());
+            }*/
+            return clone;
+#endif
+        }
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_2_0/VectorLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_2_0/VectorLayerDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_2_0/VectorLayerDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,2468 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LDF_120
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LDF_110
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0
+#elif LDF_120
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0
+#elif LDF_130
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0
+#elif LDF_230
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0
+#elif LDF_240
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0
+#endif
+{
+    using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+    using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
+    using System.Xml.Serialization;
+
+    abstract partial class BaseLayerDefinitionType : ISubLayerDefinition
+#if LDF_230 || LDF_240
+, ISubLayerDefinition2
+#endif
+    {
+        [XmlIgnore]
+        public abstract LayerType LayerType { get; }
+
+#if LDF_230 || LDF_240
+
+        [XmlIgnore]
+        IEnumerable<IWatermark> IWatermarkCollection.Watermarks
+        {
+            get
+            {
+                foreach (var wm in this.Watermarks)
+                    yield return wm;
+            }
+        }
+
+        IWatermark IWatermarkCollection.AddWatermark(IWatermarkDefinition watermark)
+        {
+            return WatermarkCollectionUtil.AddWatermark(this.Watermarks, watermark);
+        }
+
+        void IWatermarkCollection.RemoveWatermark(IWatermark watermark)
+        {
+            WatermarkCollectionUtil.RemoveWatermark(this.Watermarks, watermark);
+        }
+
+        [XmlIgnore]
+        int IWatermarkCollection.WatermarkCount
+        {
+            get { return this.Watermarks.Count; }
+        }
+
+#endif
+    }
+
+    partial class NameStringPairType : INameStringPair
+    {
+        [XmlIgnore]
+        string INameStringPair.Name
+        {
+            get
+            {
+                return this.Name;
+            }
+            set
+            {
+                this.Name = value;
+            }
+        }
+
+        [XmlIgnore]
+        string INameStringPair.Value
+        {
+            get
+            {
+                return this.Value;
+            }
+            set
+            {
+                this.Value = value;
+            }
+        }
+    }
+
+    partial class VectorScaleRangeType : IVectorScaleRange
+#if !LDF_100
+, IVectorScaleRange2
+#endif
+    {
+        #region Missing generated stuff
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private bool minScaleFieldSpecified;
+
+        [System.Xml.Serialization.XmlIgnoreAttribute()]
+        public bool MinScaleSpecified
+        {
+            get
+            {
+                return this.minScaleFieldSpecified;
+            }
+            set
+            {
+                if ((minScaleFieldSpecified.Equals(value) != true))
+                {
+                    this.minScaleFieldSpecified = value;
+                    this.OnPropertyChanged("MinScaleSpecified"); //NOXLATE
+                }
+            }
+        }
+
+        #endregion Missing generated stuff
+
+        [XmlIgnore]
+        public IAreaVectorStyle AreaStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(IAreaVectorStyle).IsAssignableFrom(item.GetType()))
+                        return (IAreaVectorStyle)item;
+                }
+
+                return null;
+            }
+            set
+            {
+                //Remove old one if it exists
+                var item = this.AreaStyle;
+                if (item != null)
+                {
+                    this.itemsField.Remove(item);
+                }
+                //Put the new one in if it is not null
+                if (value != null)
+                {
+                    this.itemsField.Add(value);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public ILineVectorStyle LineStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ILineVectorStyle).IsAssignableFrom(item.GetType()))
+                        return (ILineVectorStyle)item;
+                }
+
+                return null;
+            }
+            set
+            {
+                //Remove old one if it exists
+                var item = this.LineStyle;
+                if (item != null)
+                {
+                    this.itemsField.Remove(item);
+                }
+                //Put the new one in if it is not null
+                if (value != null)
+                {
+                    this.itemsField.Add(value);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public IPointVectorStyle PointStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(IPointVectorStyle).IsAssignableFrom(item.GetType()))
+                        return (IPointVectorStyle)item;
+                }
+
+                return null;
+            }
+            set
+            {
+                //Remove old one if it exists
+                var item = this.PointStyle;
+                if (item != null)
+                {
+                    this.itemsField.Remove(item);
+                }
+                //Put the new one in if it is not null
+                if (value != null)
+                {
+                    this.itemsField.Add(value);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        double? IVectorScaleRange.MinScale
+        {
+            get
+            {
+                return this.MinScaleSpecified ? new Nullable<double>(this.MinScale) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.MinScaleSpecified = true;
+                    this.MinScale = value.Value;
+                }
+                else
+                {
+                    this.MinScaleSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        double? IVectorScaleRange.MaxScale
+        {
+            get
+            {
+                return this.MaxScaleSpecified ? new Nullable<double>(this.MaxScale) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.MaxScaleSpecified = true;
+                    this.MaxScale = value.Value;
+                }
+                else
+                {
+                    this.MaxScaleSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public IList<IVectorStyle> AllStyles
+        {
+            get { return (IList<IVectorStyle>)this.Items; }
+        }
+
+        IVectorScaleRange IVectorScaleRange.Clone()
+        {
+            return VectorScaleRangeType.Deserialize(this.Serialize());
+        }
+
+#if LDF_110 || LDF_120
+
+        [XmlIgnore]
+        public IEnumerable<ICompositeTypeStyle> CompositeStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                        yield return (ICompositeTypeStyle)item;
+                }
+            }
+            set
+            {
+                //Clear old ones
+                var remove = new List<object>();
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                        remove.Add(item);
+                }
+
+                foreach (var obj in remove)
+                {
+                    this.itemsField.Remove(obj);
+                }
+
+                //Put the new ones in if it is not null
+                if (value != null)
+                {
+                    foreach (var item in value)
+                    {
+                        if (!typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                            throw new InvalidOperationException(Strings.ErrorObjectNotICompositeTypeStyle);
+
+                        this.itemsField.Add(item);
+                    }
+                }
+            }
+        }
+
+#elif LDF_130 || LDF_230 || LDF_240
+
+        [XmlIgnore]
+        public IEnumerable<ICompositeTypeStyle> CompositeStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+                        yield return (ICompositeTypeStyle2)item;
+                }
+            }
+            set
+            {
+                //Clear old ones
+                var remove = new List<object>();
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+                        remove.Add(item);
+                }
+
+                foreach (var obj in remove)
+                {
+                    this.itemsField.Remove(obj);
+                }
+
+                //Put the new ones in if it is not null
+                if (value != null)
+                {
+                    foreach (var item in value)
+                    {
+                        if (!typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+                            throw new InvalidOperationException(Strings.ErrorObjectNotICompositeTypeStyle);
+
+                        this.itemsField.Add(item);
+                    }
+                }
+            }
+        }
+
+#endif
+
+#if LDF_100
+#else
+
+        IElevationSettings IVectorScaleRange2.ElevationSettings
+        {
+            get { return this.ElevationSettings; }
+            set { this.ElevationSettings = (ElevationSettingsType)value; }
+        }
+
+        IElevationSettings IVectorScaleRange2.Create(string zOffset, string zExtrusion, ElevationTypeType zOffsetType, LengthUnitType unit)
+        {
+            return new ElevationSettingsType()
+            {
+                ZOffset = zOffset,
+                ZOffsetType = zOffsetType,
+                ZExtrusion = zExtrusion,
+                Unit = unit
+            };
+        }
+
+        [XmlIgnore]
+        int IVectorScaleRange2.CompositeStyleCount
+        {
+            get
+            {
+                int count = 0;
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                        count++;
+                }
+                return count;
+            }
+        }
+
+#endif
+    }
+
+#if LDF_100
+#else
+
+    partial class ElevationSettingsType : IElevationSettings { }
+
+#endif
+
+#if LDF_100
+
+    partial class StrokeType : IStroke
+#else
+
+    partial class StrokeType : IStroke, IStroke2
+#endif
+    {
+        internal StrokeType()
+        {
+        }
+
+        IStroke ICloneableLayerElement<IStroke>.Clone()
+        {
+            return StrokeType.Deserialize(this.Serialize());
+        }
+
+#if LDF_100
+#else
+
+        IStroke2 ICloneableLayerElement<IStroke2>.Clone()
+        {
+            return StrokeType.Deserialize(this.Serialize());
+        }
+
+#endif
+    }
+
+    partial class FillType : IFill
+    {
+        internal FillType()
+        {
+        }
+
+        IFill ICloneableLayerElement<IFill>.Clone()
+        {
+            return FillType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class AreaTypeStyleType : IAreaVectorStyle
+#if LDF_130 || LDF_230 || LDF_240
+, IAreaVectorStyle2
+#endif
+    {
+        [XmlIgnore]
+        IEnumerable<IAreaRule> IAreaVectorStyle.Rules
+        {
+            get
+            {
+                foreach (var ar in this.AreaRule)
+                {
+                    yield return ar;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int IVectorStyle.RuleCount
+        {
+            get
+            {
+                if (this.AreaRule != null)
+                    return this.AreaRule.Count;
+                return 0;
+            }
+        }
+
+        void IAreaVectorStyle.RemoveAllRules()
+        {
+            this.AreaRule.Clear();
+        }
+
+        void IAreaVectorStyle.AddRule(IAreaRule rule)
+        {
+            var ar = rule as AreaRuleType;
+            if (ar != null)
+                this.AreaRule.Add(ar);
+        }
+
+        void IAreaVectorStyle.RemoveRule(IAreaRule rule)
+        {
+            var ar = rule as AreaRuleType;
+            if (ar != null)
+                this.AreaRule.Remove(ar);
+        }
+
+        [XmlIgnore]
+        StyleType IVectorStyle.StyleType
+        {
+            get { return StyleType.Area; }
+        }
+
+        #region IRuleCollection<IAreaRule> Members
+
+        public int IndexOfRule(IAreaRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+                return this.AreaRule.IndexOf(r);
+            return -1;
+        }
+
+        public IAreaRule GetRuleAt(int index)
+        {
+            return this.AreaRule[index];
+        }
+
+        public bool MoveUp(IAreaRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveUp(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        public bool MoveDown(IAreaRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveDown(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        #endregion IRuleCollection<IAreaRule> Members
+
+        #region IRuleCollection Members
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.AreaRule[index];
+        }
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+                return this.AreaRule.IndexOf(r);
+            return -1;
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveUp(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveDown(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        #endregion IRuleCollection Members
+    }
+
+    internal static class CollectionUtil
+    {
+        public static bool MoveUp<T>(IList<T> list, T obj)
+        {
+            var idx = list.IndexOf(obj);
+            if (idx == 0) //Already at top
+                return false;
+
+            var newIdx = idx - 1;
+            //Get object at index
+            var obj2 = list[newIdx];
+            //Swap them
+            list[idx] = obj2;
+            list[newIdx] = obj;
+
+            return true;
+        }
+
+        public static bool MoveDown<T>(IList<T> list, T obj)
+        {
+            var idx = list.IndexOf(obj);
+            if (idx == list.Count - 1) //Already at bottom
+                return false;
+
+            var newIdx = idx + 1;
+            //Get object at index
+            var obj2 = list[newIdx];
+            //Swap them
+            list[idx] = obj2;
+            list[newIdx] = obj;
+
+            return true;
+        }
+    }
+
+    partial class AreaRuleType : IAreaRule
+    {
+        [XmlIgnore]
+        IAreaSymbolizationFill IAreaRule.AreaSymbolization2D
+        {
+            get
+            {
+                return this.Item;
+            }
+            set
+            {
+                this.Item = (AreaSymbolizationFillType)value;
+            }
+        }
+
+        [XmlIgnore]
+        ITextSymbol IBasicVectorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+    }
+
+    partial class PointTypeStyleType : IPointVectorStyle
+#if LDF_130 || LDF_230 || LDF_240
+, IPointVectorStyle2
+#endif
+    {
+        [XmlIgnore]
+        public IEnumerable<IPointRule> Rules
+        {
+            get
+            {
+                foreach (var pr in this.PointRule)
+                {
+                    yield return pr;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int IVectorStyle.RuleCount
+        {
+            get
+            {
+                if (this.PointRule != null)
+                    return this.PointRule.Count;
+                return 0;
+            }
+        }
+
+        public void RemoveAllRules()
+        {
+            this.PointRule.Clear();
+        }
+
+        public void AddRule(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                this.PointRule.Add(pr);
+        }
+
+        public void RemoveRule(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                this.PointRule.Remove(pr);
+        }
+
+        [XmlIgnore]
+        public StyleType StyleType
+        {
+            get { return StyleType.Point; }
+        }
+
+        #region IRuleCollection<IPointRule> Members
+
+        public int IndexOfRule(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return this.PointRule.IndexOf(pr);
+            return -1;
+        }
+
+        public IPointRule GetRuleAt(int index)
+        {
+            return this.PointRule[index];
+        }
+
+        public bool MoveUp(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveUp(this.PointRule, pr);
+            return false;
+        }
+
+        public bool MoveDown(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveDown(this.PointRule, pr);
+            return false;
+        }
+
+        #endregion IRuleCollection<IPointRule> Members
+
+        #region IRuleCollection Members
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.PointRule[index];
+        }
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return this.PointRule.IndexOf(pr);
+            return -1;
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveUp(this.PointRule, pr);
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveDown(this.PointRule, pr);
+            return false;
+        }
+
+        #endregion IRuleCollection Members
+    }
+
+    partial class PointRuleType : IPointRule
+    {
+        [XmlIgnore]
+        ITextSymbol IBasicVectorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IPointSymbolization2D IPointRule.PointSymbolization2D
+        {
+            get { return this.Item; }
+            set { this.Item = (PointSymbolization2DType)value; }
+        }
+    }
+
+    partial class PointSymbolization2DType : IPointSymbolization2D
+    {
+        [XmlIgnore]
+        ISymbol IPointSymbolization2D.Symbol
+        {
+            get { return (ISymbol)this.Item; }
+            set { this.Item = (SymbolType)value; }
+        }
+
+        IPointSymbolization2D ICloneableLayerElement<IPointSymbolization2D>.Clone()
+        {
+            return PointSymbolization2DType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class LineTypeStyleType : ILineVectorStyle
+#if LDF_130 || LDF_230 || LDF_240
+, ILineVectorStyle2
+#endif
+    {
+        [XmlIgnore]
+        public IEnumerable<ILineRule> Rules
+        {
+            get
+            {
+                foreach (var lr in this.LineRule)
+                {
+                    yield return lr;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int IVectorStyle.RuleCount
+        {
+            get
+            {
+                if (this.LineRule != null)
+                    return this.LineRule.Count;
+                return 0;
+            }
+        }
+
+        public ILineRule GetRuleAt(int index)
+        {
+            return this.LineRule[index];
+        }
+
+        public void RemoveAllRules()
+        {
+            this.LineRule.Clear();
+        }
+
+        public void AddRule(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                this.LineRule.Add(lr);
+        }
+
+        public void RemoveRule(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                this.LineRule.Remove(lr);
+        }
+
+        [XmlIgnore]
+        public StyleType StyleType
+        {
+            get { return StyleType.Line; }
+        }
+
+        #region IRuleCollection<ILineRule> Members
+
+        public int IndexOfRule(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return this.LineRule.IndexOf(lr);
+            return -1;
+        }
+
+        public bool MoveUp(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveUp(this.LineRule, lr);
+            return false;
+        }
+
+        public bool MoveDown(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveDown(this.LineRule, lr);
+            return false;
+        }
+
+        #endregion IRuleCollection<ILineRule> Members
+
+        #region IRuleCollection Members
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.LineRule[index];
+        }
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return this.LineRule.IndexOf(lr);
+            return -1;
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveUp(this.LineRule, lr);
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveDown(this.LineRule, lr);
+            return false;
+        }
+
+        #endregion IRuleCollection Members
+    }
+
+    partial class LineRuleType : ILineRule
+    {
+        [XmlIgnore]
+        IEnumerable<IStroke> ILineRule.Strokes
+        {
+            get
+            {
+                foreach (var str in this.Items)
+                {
+                    yield return str;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int ILineRule.StrokeCount
+        {
+            get { return this.Items.Count; }
+        }
+
+        void ILineRule.SetStrokes(IEnumerable<IStroke> strokes)
+        {
+            Check.NotNull(strokes, "strokes"); //NOXLATE
+            this.Items.Clear();
+            foreach (var stroke in strokes)
+            {
+                var st = stroke as StrokeType;
+                if (st != null)
+                    this.Items.Add(st);
+            }
+        }
+
+        void ILineRule.AddStroke(IStroke stroke)
+        {
+            var st = stroke as StrokeType;
+            if (st != null)
+                this.Items.Add(st);
+        }
+
+        void ILineRule.RemoveStroke(IStroke stroke)
+        {
+            var st = stroke as StrokeType;
+            if (st != null)
+                this.Items.Remove(st);
+        }
+
+        [XmlIgnore]
+        ITextSymbol IBasicVectorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+    }
+
+    partial class TextSymbolType : ITextSymbol
+    {
+        [XmlIgnore]
+        IAdvancedPlacement ITextSymbol.AdvancedPlacement
+        {
+            get
+            {
+                return this.AdvancedPlacement;
+            }
+            set
+            {
+                this.AdvancedPlacement = (TextSymbolTypeAdvancedPlacement)value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Text
+        {
+            get
+            {
+                return this.Text;
+            }
+            set
+            {
+                this.Text = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.FontName
+        {
+            get
+            {
+                return this.FontName;
+            }
+            set
+            {
+                this.FontName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.ForegroundColor
+        {
+            get
+            {
+                return this.ForegroundColor;
+            }
+            set
+            {
+                this.ForegroundColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.BackgroundColor
+        {
+            get
+            {
+                return this.BackgroundColor;
+            }
+            set
+            {
+                this.BackgroundColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        BackgroundStyleType ITextSymbol.BackgroundStyle
+        {
+            get
+            {
+                return this.BackgroundStyle;
+            }
+            set
+            {
+                this.BackgroundStyle = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.HorizontalAlignment
+        {
+            get
+            {
+                return this.HorizontalAlignment;
+            }
+            set
+            {
+                this.HorizontalAlignment = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.VerticalAlignment
+        {
+            get
+            {
+                return this.VerticalAlignment;
+            }
+            set
+            {
+                this.VerticalAlignment = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Bold
+        {
+            get
+            {
+                return this.Bold;
+            }
+            set
+            {
+                this.Bold = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Italic
+        {
+            get
+            {
+                return this.Italic;
+            }
+            set
+            {
+                this.Italic = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Underlined
+        {
+            get
+            {
+                return this.Underlined;
+            }
+            set
+            {
+                this.Underlined = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Font; }
+        }
+
+        ITextSymbol ICloneableLayerElement<ITextSymbol>.Clone()
+        {
+            return TextSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class MarkSymbolType : IMarkSymbol
+    {
+        [XmlIgnore]
+        ShapeType IMarkSymbol.Shape
+        {
+            get
+            {
+                return this.Shape;
+            }
+            set
+            {
+                this.Shape = value;
+            }
+        }
+
+        [XmlIgnore]
+        IFill IMarkSymbol.Fill
+        {
+            get
+            {
+                return (IFill)this.Fill;
+            }
+            set
+            {
+                this.Fill = (FillType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IStroke IMarkSymbol.Edge
+        {
+            get
+            {
+                return (IStroke)this.Edge;
+            }
+            set
+            {
+                this.Edge = (StrokeType)value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Mark; }
+        }
+
+        IMarkSymbol ICloneableLayerElement<IMarkSymbol>.Clone()
+        {
+            return MarkSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    internal class ImageBinaryContainer : IInlineImageSymbol
+    {
+        [XmlIgnore]
+        public byte[] Content
+        {
+            get;
+            set;
+        }
+
+        [XmlIgnore]
+        public ImageSymbolReferenceType Type
+        {
+            get { return ImageSymbolReferenceType.Inline; }
+        }
+
+        IInlineImageSymbol ICloneableLayerElement<IInlineImageSymbol>.Clone()
+        {
+            byte[] array = null;
+            if (this.Content != null)
+            {
+                array = new byte[this.Content.Length];
+                Array.Copy(this.Content, array, this.Content.Length);
+            }
+            return new ImageBinaryContainer()
+            {
+                Content = array
+            };
+        }
+    }
+
+    partial class ImageSymbolType : IImageSymbol
+    {
+        [XmlIgnore]
+        IBaseImageSymbol IImageSymbol.Image
+        {
+            get
+            {
+                IBaseImageSymbol img = null;
+                if (this.Item == null)
+                    return null;
+
+                if (typeof(byte[]).IsAssignableFrom(this.Item.GetType()))
+                    img = new ImageBinaryContainer() { Content = (byte[])this.Item };
+                else
+                    img = (ISymbolReference)this.Item;
+                return img;
+            }
+            set
+            {
+                if (typeof(IInlineImageSymbol).IsAssignableFrom(value.GetType()))
+                    this.Item = ((IInlineImageSymbol)value).Content;
+                else
+                    this.Item = (ImageSymbolTypeImage)value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Image; }
+        }
+
+        IImageSymbol ICloneableLayerElement<IImageSymbol>.Clone()
+        {
+            return ImageSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    abstract partial class SymbolType : ISymbol
+    {
+        [XmlIgnore]
+        LengthUnitType ISymbol.Unit
+        {
+            get
+            {
+                return this.Unit;
+            }
+            set
+            {
+                this.Unit = value;
+            }
+        }
+
+        [XmlIgnore]
+        SizeContextType ISymbol.SizeContext
+        {
+            get
+            {
+                return this.SizeContext;
+            }
+            set
+            {
+                this.SizeContext = value;
+            }
+        }
+
+        [XmlIgnore]
+        bool ISymbol.MaintainAspect
+        {
+            get
+            {
+                return this.MaintainAspect;
+            }
+            set
+            {
+                this.MaintainAspect = true;
+            }
+        }
+
+        [XmlIgnore]
+        public abstract PointSymbolType Type { get; }
+
+        [XmlIgnore]
+        string ISymbol.InsertionPointY
+        {
+            get
+            {
+                return this.InsertionPointY.ToString();
+            }
+            set
+            {
+                this.InsertionPointY = Convert.ToDouble(value);
+            }
+        }
+    }
+
+    partial class FontSymbolType : IFontSymbol
+    {
+        [XmlIgnore]
+        string IFontSymbol.FontName
+        {
+            get
+            {
+                return this.FontName;
+            }
+            set
+            {
+                this.FontName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IFontSymbol.Character
+        {
+            get
+            {
+                return this.Character;
+            }
+            set
+            {
+                this.Character = value;
+            }
+        }
+
+        [XmlIgnore]
+        bool? IFontSymbol.Bold
+        {
+            get
+            {
+                return this.BoldSpecified ? new Nullable<bool>(this.Bold) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.Bold = value.Value;
+                    this.BoldSpecified = true;
+                }
+                else
+                {
+                    this.BoldSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        bool? IFontSymbol.Italic
+        {
+            get
+            {
+                return this.ItalicSpecified ? new Nullable<bool>(this.Italic) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.Italic = value.Value;
+                    this.ItalicSpecified = true;
+                }
+                else
+                {
+                    this.ItalicSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        bool? IFontSymbol.Underlined
+        {
+            get
+            {
+                return this.UnderlinedSpecified ? new Nullable<bool>(this.Underlined) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.Underlined = value.Value;
+                    this.UnderlinedSpecified = true;
+                }
+                else
+                {
+                    this.UnderlinedSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        string IFontSymbol.ForegroundColor
+        {
+            get
+            {
+                return this.ForegroundColor;
+            }
+            set
+            {
+                this.ForegroundColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Font; }
+        }
+
+        IFontSymbol ICloneableLayerElement<IFontSymbol>.Clone()
+        {
+            return FontSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class BlockSymbolType : IBlockSymbol
+    {
+        [XmlIgnore]
+        string IBlockSymbol.DrawingName
+        {
+            get
+            {
+                return this.DrawingName;
+            }
+            set
+            {
+                this.DrawingName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IBlockSymbol.BlockName
+        {
+            get
+            {
+                return this.BlockName;
+            }
+            set
+            {
+                this.BlockName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IBlockSymbol.BlockColor
+        {
+            get
+            {
+                return this.BlockColor;
+            }
+            set
+            {
+                this.BlockColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IBlockSymbol.LayerColor
+        {
+            get
+            {
+                return this.LayerColor;
+            }
+            set
+            {
+                this.LayerColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Block; }
+        }
+
+        IBlockSymbol ICloneableLayerElement<IBlockSymbol>.Clone()
+        {
+            return BlockSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class W2DSymbolType : IW2DSymbol
+    {
+        [XmlIgnore]
+        ISymbolReference IW2DSymbol.W2DSymbol
+        {
+            get
+            {
+                return (ISymbolReference)this.W2DSymbol;
+            }
+            set
+            {
+                this.W2DSymbol = (W2DSymbolTypeW2DSymbol)value;
+            }
+        }
+
+        [XmlIgnore]
+        string IW2DSymbol.FillColor
+        {
+            get
+            {
+                return this.FillColor;
+            }
+            set
+            {
+                this.FillColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IW2DSymbol.LineColor
+        {
+            get
+            {
+                return this.LineColor;
+            }
+            set
+            {
+                this.LineColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IW2DSymbol.TextColor
+        {
+            get
+            {
+                return this.TextColor;
+            }
+            set
+            {
+                this.TextColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.W2D; }
+        }
+
+        IW2DSymbol ICloneableLayerElement<IW2DSymbol>.Clone()
+        {
+            return W2DSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class W2DSymbolTypeW2DSymbol : ISymbolReference
+    {
+        [XmlIgnore]
+        ImageSymbolReferenceType IBaseImageSymbol.Type
+        {
+            get { return ImageSymbolReferenceType.SymbolReference; }
+        }
+
+        ISymbolReference ICloneableLayerElement<ISymbolReference>.Clone()
+        {
+            return W2DSymbolTypeW2DSymbol.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class ImageSymbolTypeImage : ISymbolReference
+    {
+        [XmlIgnore]
+        string ISymbolReference.ResourceId
+        {
+            get
+            {
+                return this.ResourceId == null ? string.Empty : this.ResourceId.ToString();
+            }
+            set
+            {
+                this.ResourceId = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ISymbolReference.LibraryItemName
+        {
+            get
+            {
+                return this.LibraryItemName == null ? string.Empty : this.LibraryItemName.ToString();
+            }
+            set
+            {
+                this.LibraryItemName = value;
+            }
+        }
+
+        [XmlIgnore]
+        ImageSymbolReferenceType IBaseImageSymbol.Type
+        {
+            get { return ImageSymbolReferenceType.SymbolReference; }
+        }
+
+        ISymbolReference ICloneableLayerElement<ISymbolReference>.Clone()
+        {
+            return ImageSymbolTypeImage.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class TextSymbolTypeAdvancedPlacement : IAdvancedPlacement
+    {
+    }
+
+    partial class AreaSymbolizationFillType : IAreaSymbolizationFill
+    {
+        [XmlIgnore]
+        IFill IAreaSymbolizationFill.Fill
+        {
+            get
+            {
+                return this.Fill;
+            }
+            set
+            {
+                this.Fill = (FillType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IStroke IAreaSymbolizationFill.Stroke
+        {
+            get
+            {
+                return this.Stroke;
+            }
+            set
+            {
+                this.Stroke = (StrokeType)value;
+            }
+        }
+
+        IAreaSymbolizationFill ICloneableLayerElement<IAreaSymbolizationFill>.Clone()
+        {
+            return AreaSymbolizationFillType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class LayerDefinition : ILayerDefinition
+    {
+        //internal LayerDefinition() { }
+
+#if LDF_110
+        private static readonly Version RES_VERSION = new Version(1, 1, 0);
+#elif LDF_120
+        private static readonly Version RES_VERSION = new Version(1, 2, 0);
+#elif LDF_130
+        private static readonly Version RES_VERSION = new Version(1, 3, 0);
+#elif LDF_230
+        private static readonly Version RES_VERSION = new Version(2, 3, 0);
+#elif LDF_240
+        private static readonly Version RES_VERSION = new Version(2, 4, 0);
+#else
+        private static readonly Version RES_VERSION = new Version(1, 0, 0);
+#endif
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.LayerDefinition.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.LayerDefinition));
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.LayerDefinition.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public virtual Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        object ICloneable.Clone()
+        {
+            return this.Clone();
+        }
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")] //NOXLATE
+        public string ValidatingSchema
+        {
+#if LDF_110
+            get { return "LayerDefinition-1.1.0.xsd"; } //NOXLATE
+#elif LDF_120
+            get { return "LayerDefinition-1.2.0.xsd"; } //NOXLATE
+#elif LDF_130
+            get { return "LayerDefinition-1.3.0.xsd"; } //NOXLATE
+#elif LDF_230
+            get { return "LayerDefinition-2.3.0.xsd"; } //NOXLATE
+#elif LDF_240
+            get { return "LayerDefinition-2.4.0.xsd"; } //NOXLATE
+#else
+            get { return ResourceTypes.LayerDefinition.ToString() + "-" + this.ResourceVersion.ToString() + ".xsd"; } //NOXLATE
+#endif
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        [XmlIgnore]
+        public ISubLayerDefinition SubLayer
+        {
+            get { return this.Item; }
+        }
+
+        public INameStringPair CreatePair(string name, string value)
+        {
+            return new NameStringPairType() { Name = name, Value = value };
+        }
+    }
+
+    partial class DrawingLayerDefinitionType : IDrawingLayerDefinition
+    {
+        [XmlIgnore]
+        public override LayerType LayerType
+        {
+            get { return LayerType.Drawing; }
+        }
+
+        [XmlIgnore]
+        string ISubLayerDefinition.ResourceId
+        {
+            get { return this.ResourceId; }
+            set { this.ResourceId = value; }
+        }
+    }
+
+    partial class VectorLayerDefinitionType : IVectorLayerDefinition
+#if LDF_240
+, IVectorLayerDefinition2
+#endif
+    {
+        [XmlIgnore]
+        public override LayerType LayerType
+        {
+            get { return LayerType.Vector; }
+        }
+
+        [XmlIgnore]
+        string ISubLayerDefinition.ResourceId
+        {
+            get { return this.ResourceId; }
+            set { this.ResourceId = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.FeatureName
+        {
+            get { return this.FeatureName; }
+            set { this.FeatureName = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.Geometry
+        {
+            get { return this.Geometry; }
+            set { this.Geometry = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.Url
+        {
+#if LDF_240
+            get
+            {
+                if (this.urlDataField == null)
+                    return string.Empty;
+                else
+                    return this.urlDataField.Content;
+            }
+            set
+            {
+                if (!string.IsNullOrEmpty(value))
+                {
+                    if (this.urlDataField == null)
+                        this.urlDataField = new URLDataType();
+                    this.urlDataField.Content = value;
+                    OnPropertyChanged("Url"); //NOXLATE
+                }
+                else
+                {
+                    //NOTE: None of the other URLData properties seem to be used atm
+                    //hence why we are nulling this
+                    this.urlDataField = null;
+                    OnPropertyChanged("Url"); //NOXLATE
+                }
+            }
+#else
+            get { return this.Url; }
+            set { this.Url = value; }
+#endif
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.ToolTip
+        {
+            get { return this.ToolTip; }
+            set { this.ToolTip = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.Filter
+        {
+            get { return this.Filter; }
+            set { this.Filter = value; }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IVectorScaleRange> IVectorLayerDefinition.VectorScaleRange
+        {
+            get
+            {
+                foreach (var vsr in this.VectorScaleRange)
+                {
+                    yield return vsr;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<INameStringPair> IVectorLayerDefinition.PropertyMapping
+        {
+            get
+            {
+                foreach (var pair in this.PropertyMapping)
+                {
+                    yield return pair;
+                }
+            }
+        }
+
+        INameStringPair IVectorLayerDefinition.GetPropertyMapping(string name)
+        {
+            foreach (var p in this.PropertyMapping)
+            {
+                if (p.Name == name)
+                    return p;
+            }
+            return null;
+        }
+
+        INameStringPair IVectorLayerDefinition.GetPropertyMappingAt(int index)
+        {
+            if (index < 0 || index >= this.PropertyMapping.Count)
+                throw new ArgumentOutOfRangeException();
+
+            var item = this.PropertyMapping[index];
+            return item;
+        }
+
+        void IVectorLayerDefinition.AddVectorScaleRange(IVectorScaleRange range)
+        {
+            var r = range as VectorScaleRangeType;
+            if (r != null)
+                this.VectorScaleRange.Add(r);
+        }
+
+        void IVectorLayerDefinition.RemoveVectorScaleRange(IVectorScaleRange range)
+        {
+            var r = range as VectorScaleRangeType;
+            if (r != null)
+                this.VectorScaleRange.Remove(r);
+        }
+
+        void IVectorLayerDefinition.AddPropertyMapping(INameStringPair pair)
+        {
+            var p = pair as NameStringPairType;
+            if (p != null)
+                this.PropertyMapping.Add(p);
+        }
+
+        void IVectorLayerDefinition.RemovePropertyMapping(INameStringPair pair)
+        {
+            var p = pair as NameStringPairType;
+            if (p != null)
+                this.PropertyMapping.Remove(p);
+        }
+
+        int IVectorLayerDefinition.GetPosition(INameStringPair pair)
+        {
+            var p = pair as NameStringPairType;
+            if (p != null)
+                return this.PropertyMapping.IndexOf(p);
+
+            return -1;
+        }
+
+        int IVectorLayerDefinition.MoveUp(INameStringPair pair)
+        {
+            int pos = ((IVectorLayerDefinition)this).GetPosition(pair);
+            if (pos > 0)
+            {
+                int dest = pos - 1;
+                var p = this.PropertyMapping[dest];
+                var p2 = (NameStringPairType)pair;
+
+                //Swap
+                this.PropertyMapping[dest] = p2;
+                this.PropertyMapping[pos] = p;
+
+                return dest;
+            }
+            return -1;
+        }
+
+        int IVectorLayerDefinition.MoveDown(INameStringPair pair)
+        {
+            int pos = ((IVectorLayerDefinition)this).GetPosition(pair);
+            if (pos < this.PropertyMapping.Count - 1)
+            {
+                int dest = pos + 1;
+                var p = this.PropertyMapping[dest];
+                var p2 = (NameStringPairType)pair;
+
+                //Swap
+                this.PropertyMapping[dest] = p2;
+                this.PropertyMapping[pos] = p;
+
+                return dest;
+            }
+            return -1;
+        }
+
+        void IVectorLayerDefinition.RemoveAllScaleRanges()
+        {
+            this.VectorScaleRange.Clear();
+        }
+
+        int IVectorLayerDefinition.IndexOfScaleRange(IVectorScaleRange range)
+        {
+            var r = range as VectorScaleRangeType;
+            if (r != null)
+                return this.VectorScaleRange.IndexOf(r);
+
+            return -1;
+        }
+
+        IVectorScaleRange IVectorLayerDefinition.GetScaleRangeAt(int index)
+        {
+            if (index >= this.VectorScaleRange.Count)
+                return null;
+
+            return this.VectorScaleRange[index];
+        }
+
+        [XmlIgnore]
+        Version IVectorLayerDefinition.SymbolDefinitionVersion
+        {
+            get
+            {
+#if LDF_110
+                return new Version(1, 0, 0);
+#elif LDF_120 || LDF_130 || LDF_230
+                return new Version(1, 1, 0);
+#elif LDF_240
+                return new Version(2, 4, 0);
+#else
+                return null;
+#endif
+            }
+        }
+
+#if LDF_240
+
+        [XmlIgnore]
+        IUrlData IVectorLayerDefinition2.UrlData
+        {
+            get
+            {
+                return this.UrlData;
+            }
+            set
+            {
+                this.UrlData = (URLDataType)value;
+            }
+        }
+
+#endif
+
+        void IVectorLayerDefinition.ClearPropertyMappings()
+        {
+            propertyMappingField.Clear();
+        }
+    }
+
+    #region Composite Symbolization
+
+#if !LDF_100
+
+    partial class CompositeRule : ICompositeRule
+    {
+        [XmlIgnore]
+        ICompositeSymbolization ICompositeRule.CompositeSymbolization
+        {
+            get
+            {
+                return this.CompositeSymbolization;
+            }
+            set
+            {
+                this.CompositeSymbolization = (CompositeSymbolization)value;
+            }
+        }
+    }
+
+    partial class CompositeSymbolization : ICompositeSymbolization
+    {
+        [XmlIgnore]
+        IEnumerable<ISymbolInstance> ICompositeSymbolization.SymbolInstance
+        {
+            get
+            {
+                foreach (var sym in this.SymbolInstance)
+                {
+                    yield return sym;
+                }
+            }
+        }
+
+        public string ToXml()
+        {
+            return this.Serialize();
+        }
+
+        public void UpdateFromXml(string xml)
+        {
+            var compsym = CompositeSymbolization.Deserialize(xml);
+            this.SymbolInstance.Clear();
+            foreach (var sym in compsym.SymbolInstance)
+            {
+                this.AddSymbolInstance(sym);
+            }
+        }
+
+        public void AddSymbolInstance(ISymbolInstance inst)
+        {
+            var sym = inst as SymbolInstance;
+            if (sym != null)
+                this.SymbolInstance.Add(sym);
+        }
+
+        public void RemoveSymbolInstance(ISymbolInstance inst)
+        {
+            var sym = inst as SymbolInstance;
+            if (sym != null)
+                this.SymbolInstance.Remove(sym);
+        }
+
+        public void RemoveAllSymbolInstances()
+        {
+            this.SymbolInstance.Clear();
+        }
+
+        public ISymbolInstance CreateSymbolReference(string resourceId)
+        {
+            return new SymbolInstance()
+            {
+                Item = resourceId,
+                ParameterOverrides = new ParameterOverrides()
+                {
+                    Override = new BindingList<Override>()
+                },
+            };
+        }
+
+        public ISymbolInstance CreateInlineSimpleSymbol(ISimpleSymbolDefinition symDef)
+        {
+            return new SymbolInstance()
+            {
+#if LDF_110
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition)symDef,
+#elif LDF_120 || LDF_130 || LDF_230
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.SimpleSymbolDefinition)symDef,
+#else
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_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.v1_0_0.CompoundSymbolDefinition)compDef,
+#elif LDF_120 || LDF_130 || LDF_230
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.CompoundSymbolDefinition)compDef,
+#else
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.CompoundSymbolDefinition)compDef,
+#endif
+                ParameterOverrides = new ParameterOverrides()
+                {
+                    Override = new BindingList<Override>()
+                }
+            };
+        }
+    }
+
+    partial class SymbolInstance : ISymbolInstance
+#if LDF_100 || LDF_110
+#else
+, ISymbolInstance2
+#endif
+    {
+        [XmlIgnore]
+        IParameterOverrideCollection ISymbolInstance.ParameterOverrides
+        {
+            get { return this.ParameterOverrides; }
+        }
+
+        [XmlIgnore]
+        public ISymbolInstanceReference Reference
+        {
+            get
+            {
+                var libId = this.Item as string;
+#if LDF_110
+                var simpSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition;
+                var compSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.CompoundSymbolDefinition;
+#elif LDF_120 || LDF_130 || LDF_230
+                var simpSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.SimpleSymbolDefinition;
+                var compSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.CompoundSymbolDefinition;
+#else
+                var simpSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.SimpleSymbolDefinition;
+                var compSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.CompoundSymbolDefinition;
+#endif
+                if (libId != null)
+                    return new SymbolInstanceLibrary() { ResourceId = libId };
+                else if (simpSym != null)
+                    return new SymbolInstanceInline() { SymbolDefinition = simpSym };
+                else if (compSym != null)
+                    return new SymbolInstanceInline() { SymbolDefinition = compSym };
+                return null;
+            }
+            set
+            {
+                var sr = value as ISymbolInstanceReferenceLibrary;
+                var ir = value as ISymbolInstanceReferenceInline;
+                if (sr != null)
+                {
+                    this.Item = sr.ResourceId;
+                }
+                else if (ir != null)
+                {
+#if LDF_110
+                    if (ir.SymbolDefinition.Type == SymbolDefinitionType.Simple)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition)ir.SymbolDefinition;
+                    else if (ir.SymbolDefinition.Type == SymbolDefinitionType.Compound)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.CompoundSymbolDefinition)ir.SymbolDefinition;
+#elif LDF_120 || LDF_130 || LDF_230
+                    if (ir.SymbolDefinition.Type == SymbolDefinitionType.Simple)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.SimpleSymbolDefinition)ir.SymbolDefinition;
+                    else if (ir.SymbolDefinition.Type == SymbolDefinitionType.Compound)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.CompoundSymbolDefinition)ir.SymbolDefinition;
+#else
+                    if (ir.SymbolDefinition.Type == SymbolDefinitionType.Simple)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.SimpleSymbolDefinition)ir.SymbolDefinition;
+                    else if (ir.SymbolDefinition.Type == SymbolDefinitionType.Compound)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.CompoundSymbolDefinition)ir.SymbolDefinition;
+#endif
+                }
+                this.Item = null;
+            }
+        }
+    }
+
+    partial class SymbolInstanceLibrary : ISymbolInstanceReferenceLibrary
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceId
+        {
+            get { return _resId; }
+            set
+            {
+                if (_resId == value) return;
+                _resId = value;
+                OnPropertyChanged("ResourceId"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public SymbolInstanceType Type
+        {
+            get { return SymbolInstanceType.Reference; }
+        }
+
+        public event PropertyChangedEventHandler PropertyChanged;
+
+        private void OnPropertyChanged(string name)
+        {
+            var handler = this.PropertyChanged;
+            if (handler != null)
+                handler(this, new PropertyChangedEventArgs(name));
+        }
+    }
+
+    partial class SymbolInstanceInline : ISymbolInstanceReferenceInline
+    {
+        [XmlIgnore]
+        public ISymbolDefinitionBase SymbolDefinition
+        {
+            get;
+            set;
+        }
+
+        [XmlIgnore]
+        public SymbolInstanceType Type
+        {
+            get { return SymbolInstanceType.Inline; }
+        }
+    }
+
+    partial class ParameterOverrides : IParameterOverrideCollection
+    {
+        [XmlIgnore]
+        IEnumerable<IParameterOverride> IParameterOverrideCollection.Override
+        {
+            get
+            {
+                foreach (var ov in this.Override)
+                {
+                    yield return ov;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public int Count
+        {
+            get { return this.Override.Count; }
+        }
+
+        [XmlIgnore]
+        public IParameterOverride this[int index]
+        {
+            get
+            {
+                if (index >= this.Override.Count)
+                    throw new ArgumentOutOfRangeException();
+
+                return this.Override[index];
+            }
+        }
+
+        public void AddOverride(IParameterOverride ov)
+        {
+            var o = ov as Override;
+            if (o != null)
+                this.Override.Add(o);
+        }
+
+        public void RemoveOverride(IParameterOverride ov)
+        {
+            var o = ov as Override;
+            if (o != null)
+                this.Override.Remove(o);
+        }
+
+        public IParameterOverride CreateParameterOverride(string symbol, string name)
+        {
+            return new Override()
+            {
+                ParameterIdentifier = name,
+                SymbolName = symbol
+            };
+        }
+    }
+
+    partial class Override : IParameterOverride
+    {
+    }
+
+    partial class CompositeTypeStyle : ICompositeTypeStyle
+#if LDF_130 || LDF_230 || LDF_240
+, ICompositeTypeStyle2
+#endif
+    {
+        [XmlIgnore]
+        string ICompositeTypeStyle.DisplayString
+        {
+            get
+            {
+                return Strings.CompositeStyleDisplayString;
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<ICompositeRule> ICompositeTypeStyle.CompositeRule
+        {
+            get
+            {
+                foreach (var cr in this.CompositeRule)
+                {
+                    yield return cr;
+                }
+            }
+        }
+
+        public void AddCompositeRule(ICompositeRule compRule)
+        {
+            var cr = compRule as CompositeRule;
+            if (cr != null)
+                this.CompositeRule.Add(cr);
+        }
+
+        public void RemoveCompositeRule(ICompositeRule compRule)
+        {
+            var cr = compRule as CompositeRule;
+            if (cr != null)
+                this.CompositeRule.Remove(cr);
+        }
+
+        [XmlIgnore]
+        public StyleType StyleType
+        {
+            get { return StyleType.Composite; }
+        }
+
+        [XmlIgnore]
+        public int RuleCount
+        {
+            get { return this.CompositeRule.Count; }
+        }
+
+    #region IRuleCollection<ICompositeRule> Members
+
+        public int IndexOfRule(ICompositeRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return this.CompositeRule.IndexOf(cr);
+            return -1;
+        }
+
+        public ICompositeRule GetRuleAt(int index)
+        {
+            return this.CompositeRule[index];
+        }
+
+        public bool MoveUp(ICompositeRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveUp(this.CompositeRule, cr);
+            return false;
+        }
+
+        public bool MoveDown(ICompositeRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveDown(this.CompositeRule, cr);
+            return false;
+        }
+
+    #endregion IRuleCollection<ICompositeRule> Members
+
+    #region IRuleCollection Members
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return this.CompositeRule.IndexOf(cr);
+            return -1;
+        }
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.CompositeRule[index];
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveUp(this.CompositeRule, cr);
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveDown(this.CompositeRule, cr);
+            return false;
+        }
+
+    #endregion IRuleCollection Members
+    }
+
+#endif
+
+    #endregion Composite Symbolization
+
+#if LDF_240
+
+    partial class URLDataType : IUrlData
+    {
+    }
+
+#endif
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_3_0/GridLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_3_0/GridLayerDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_3_0/GridLayerDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,736 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LDF_130
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LDF_110
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0
+#elif LDF_120
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0
+#elif LDF_130
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0
+#elif LDF_230
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0
+#elif LDF_240
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0
+#endif
+{
+    using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+    using System.Xml.Serialization;
+
+    partial class GridLayerDefinitionType : IRasterLayerDefinition
+    {
+        [XmlIgnore]
+        public override LayerType LayerType
+        {
+            get { return LayerType.Raster; }
+        }
+
+        [XmlIgnore]
+        string ISubLayerDefinition.ResourceId
+        {
+            get { return this.ResourceId; }
+            set { this.ResourceId = value; }
+        }
+
+        [XmlIgnore]
+        string IRasterLayerDefinition.FeatureName
+        {
+            get
+            {
+                return this.FeatureName;
+            }
+            set
+            {
+                this.FeatureName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IRasterLayerDefinition.Geometry
+        {
+            get
+            {
+                return this.Geometry;
+            }
+            set
+            {
+                this.Geometry = value;
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IGridScaleRange> IRasterLayerDefinition.GridScaleRange
+        {
+            get
+            {
+                foreach (var gsr in this.GridScaleRange)
+                {
+                    yield return gsr;
+                }
+            }
+        }
+
+        public void AddGridScaleRange(IGridScaleRange range)
+        {
+            var gsr = range as GridScaleRangeType;
+            if (gsr != null)
+            {
+                this.GridScaleRange.Add(gsr);
+            }
+        }
+
+        public void RemoveGridScaleRange(IGridScaleRange range)
+        {
+            var gsr = range as GridScaleRangeType;
+            if (gsr != null)
+            {
+                this.GridScaleRange.Remove(gsr);
+            }
+        }
+
+        public int IndexOfScaleRange(IGridScaleRange range)
+        {
+            var gsr = range as GridScaleRangeType;
+            if (gsr != null)
+            {
+                this.GridScaleRange.IndexOf(gsr);
+            }
+            return -1;
+        }
+
+        public IGridScaleRange GetScaleRangeAt(int index)
+        {
+            return this.GridScaleRange[index];
+        }
+
+        [XmlIgnore]
+        public int GridScaleRangeCount { get { return this.GridScaleRange.Count; } }
+    }
+
+    partial class ChannelBandType : IChannelBand
+    {
+        [XmlIgnore]
+        string IChannelBand.Band
+        {
+            get
+            {
+                return this.Band;
+            }
+            set
+            {
+                this.Band = value;
+            }
+        }
+
+        [XmlIgnore]
+        double? IChannelBand.LowBand
+        {
+            get
+            {
+                return this.LowBandSpecified ? new Nullable<double>(this.LowBand) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.LowBand = value.Value;
+                    this.LowBandSpecified = true;
+                }
+                else
+                {
+                    this.LowBandSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        double? IChannelBand.HighBand
+        {
+            get
+            {
+                return this.HighBandSpecified ? new Nullable<double>(this.HighBand) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.HighBand = value.Value;
+                    this.HighBandSpecified = true;
+                }
+                else
+                {
+                    this.HighBandSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        byte IChannelBand.LowChannel
+        {
+            get
+            {
+                return this.LowChannel;
+            }
+            set
+            {
+                this.LowChannel = value;
+            }
+        }
+
+        [XmlIgnore]
+        byte IChannelBand.HighChannel
+        {
+            get
+            {
+                return this.HighChannel;
+            }
+            set
+            {
+                this.HighChannel = value;
+            }
+        }
+    }
+
+    partial class GridColorBandsType : IGridColorBands
+    {
+        [XmlIgnore]
+        IChannelBand IGridColorBands.RedBand
+        {
+            get
+            {
+                return this.RedBand;
+            }
+            set
+            {
+                this.RedBand = (ChannelBandType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IChannelBand IGridColorBands.GreenBand
+        {
+            get
+            {
+                return this.GreenBand;
+            }
+            set
+            {
+                this.GreenBand = (ChannelBandType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IChannelBand IGridColorBands.BlueBand
+        {
+            get
+            {
+                return this.BlueBand;
+            }
+            set
+            {
+                this.BlueBand = (ChannelBandType)value;
+            }
+        }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal abstract class ExplicitColorBase : IExplicitColor
+    {
+        [XmlIgnore]
+        public abstract ItemChoiceType Type { get; }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal class ExplicitColorBand : ExplicitColorBase, IExplicitColorBand
+    {
+        [XmlIgnore]
+        public string Band { get; set; }
+
+        [XmlIgnore]
+        public override ItemChoiceType Type
+        {
+            get { return ItemChoiceType.Band; }
+        }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal class ExplicitColor : ExplicitColorBase, IExplictColorValue
+    {
+        [XmlIgnore]
+        public string Value { get; set; }
+
+        [XmlIgnore]
+        public override ItemChoiceType Type
+        {
+            get { return ItemChoiceType.ExplicitColor; }
+        }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal class ExplicitColorBands : ExplicitColorBase, IExplicitColorBands
+    {
+        [XmlIgnore]
+        public IGridColorBands Bands { get; set; }
+
+        [XmlIgnore]
+        public override ItemChoiceType Type
+        {
+            get { return ItemChoiceType.Bands; }
+        }
+    }
+
+    partial class GridColorType : IGridColor
+    {
+        [XmlIgnore]
+        IExplicitColor IGridColor.ExplicitColor
+        {
+            get
+            {
+                return ParseItem();
+            }
+            set
+            {
+                switch (this.ItemElementName)
+                {
+                    case ItemChoiceType.Band:
+                        this.Item = ((ExplicitColorBand)value).Band;
+                        break;
+
+                    case ItemChoiceType.Bands:
+                        this.Item = ((ExplicitColorBands)value).Bands;
+                        break;
+
+                    case ItemChoiceType.ExplicitColor:
+                        this.Item = ((ExplicitColor)value).Value;
+                        break;
+                }
+            }
+        }
+
+        private IExplicitColor ParseItem()
+        {
+            if (this.Item == null)
+                return null;
+
+            switch (this.ItemElementName)
+            {
+                case ItemChoiceType.Band:
+                    return new ExplicitColorBand() { Band = (string)this.Item };
+
+                case ItemChoiceType.Bands:
+                    return new ExplicitColorBands() { Bands = (IGridColorBands)this.Item };
+
+                case ItemChoiceType.ExplicitColor:
+                    return new ExplicitColor() { Value = (string)this.Item };
+            }
+
+            throw new Exception(); //Should never get here
+        }
+
+        public void SetValue(string htmlColor)
+        {
+            this.ItemElementName = ItemChoiceType.ExplicitColor;
+            this.Item = htmlColor;
+        }
+
+        public string GetValue()
+        {
+            if (this.Item != null && this.ItemElementName == ItemChoiceType.ExplicitColor)
+            {
+                return this.Item.ToString();
+            }
+            return null;
+        }
+    }
+
+    partial class GridColorRuleType : IGridColorRule
+    {
+        [XmlIgnore]
+        string IGridColorRule.LegendLabel
+        {
+            get
+            {
+                return this.LegendLabel;
+            }
+            set
+            {
+                this.LegendLabel = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IGridColorRule.Filter
+        {
+            get
+            {
+                return this.Filter;
+            }
+            set
+            {
+                this.Filter = value;
+            }
+        }
+
+        [XmlIgnore]
+        ITextSymbol IGridColorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IGridColor IGridColorRule.Color
+        {
+            get
+            {
+                return this.Color;
+            }
+            set
+            {
+                this.Color = (GridColorType)value;
+            }
+        }
+    }
+
+    partial class HillShadeType : IHillShade
+    {
+        [XmlIgnore]
+        string IHillShade.Band
+        {
+            get
+            {
+                return this.Band;
+            }
+            set
+            {
+                this.Band = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IHillShade.Azimuth
+        {
+            get
+            {
+                return this.Azimuth;
+            }
+            set
+            {
+                this.Azimuth = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IHillShade.Altitude
+        {
+            get
+            {
+                return this.Altitude;
+            }
+            set
+            {
+                this.Altitude = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IHillShade.ScaleFactor
+        {
+            get
+            {
+                return this.ScaleFactor;
+            }
+            set
+            {
+                this.ScaleFactor = value;
+            }
+        }
+    }
+
+    partial class GridColorStyleType : IGridColorStyle
+    {
+        [XmlIgnore]
+        IHillShade IGridColorStyle.HillShade
+        {
+            get
+            {
+                return this.HillShade;
+            }
+            set
+            {
+                this.HillShade = (HillShadeType)value;
+            }
+        }
+
+        [XmlIgnore]
+        string IGridColorStyle.TransparencyColor
+        {
+            get
+            {
+                return this.TransparencyColor == null ? string.Empty : this.TransparencyColor.ToString();
+            }
+            set
+            {
+                this.TransparencyColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        double? IGridColorStyle.BrightnessFactor
+        {
+            get
+            {
+                return this.BrightnessFactor;
+            }
+            set
+            {
+                this.BrightnessFactor = value.HasValue ? value.Value : default(double);
+            }
+        }
+
+        [XmlIgnore]
+        double? IGridColorStyle.ContrastFactor
+        {
+            get
+            {
+                return this.ContrastFactor;
+            }
+            set
+            {
+                this.ContrastFactor = value.HasValue ? value.Value : default(double);
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IGridColorRule> IGridColorStyle.ColorRule
+        {
+            get
+            {
+                foreach (var cr in this.ColorRule)
+                {
+                    yield return cr;
+                }
+            }
+        }
+
+        void IGridColorStyle.AddColorRule(IGridColorRule rule)
+        {
+            var cr = rule as GridColorRuleType;
+            if (cr != null)
+                this.ColorRule.Add((GridColorRuleType)cr);
+        }
+
+        void IGridColorStyle.RemoveColorRule(IGridColorRule rule)
+        {
+            var cr = rule as GridColorRuleType;
+            if (cr != null)
+                this.ColorRule.Remove((GridColorRuleType)cr);
+        }
+
+        [XmlIgnore]
+        public int ColorRuleCount
+        {
+            get { return this.ColorRule.Count; }
+        }
+
+        public IGridColorRule GetColorRuleAt(int index)
+        {
+            return this.ColorRule[index];
+        }
+
+        public IHillShade CreateHillShade()
+        {
+            return new HillShadeType();
+        }
+    }
+
+    partial class GridSurfaceStyleType : IGridSurfaceStyle
+    {
+        [XmlIgnore]
+        string IGridSurfaceStyle.Band
+        {
+            get
+            {
+                return this.Band;
+            }
+            set
+            {
+                this.Band = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IGridSurfaceStyle.ZeroValue
+        {
+            get
+            {
+                return this.ZeroValue;
+            }
+            set
+            {
+                this.ZeroValue = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IGridSurfaceStyle.ScaleFactor
+        {
+            get
+            {
+                return this.ScaleFactor;
+            }
+            set
+            {
+                this.ScaleFactor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IGridSurfaceStyle.DefaultColor
+        {
+            get
+            {
+                return this.DefaultColor;
+            }
+            set
+            {
+                this.DefaultColor = value;
+            }
+        }
+    }
+
+    partial class GridScaleRangeType : IGridScaleRange
+    {
+        [XmlIgnore]
+        double? IGridScaleRange.MinScale
+        {
+            get
+            {
+                return this.MinScale;
+            }
+            set
+            {
+                if (value.HasValue)
+                    this.MinScale = value.Value;
+            }
+        }
+
+        [XmlIgnore]
+        double? IGridScaleRange.MaxScale
+        {
+            get
+            {
+                return this.MaxScaleSpecified ? new Nullable<double>(this.MaxScale) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.MaxScale = value.Value;
+                    this.MaxScaleSpecified = true;
+                }
+                else
+                {
+                    this.MaxScaleSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        IGridSurfaceStyle IGridScaleRange.SurfaceStyle
+        {
+            get
+            {
+                return this.SurfaceStyle;
+            }
+            set
+            {
+                this.SurfaceStyle = (GridSurfaceStyleType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IGridColorStyle IGridScaleRange.ColorStyle
+        {
+            get
+            {
+                return this.ColorStyle;
+            }
+            set
+            {
+                this.ColorStyle = (GridColorStyleType)value;
+            }
+        }
+
+        [XmlIgnore]
+        double IGridScaleRange.RebuildFactor
+        {
+            get
+            {
+                return this.RebuildFactor;
+            }
+            set
+            {
+                this.RebuildFactor = value;
+            }
+        }
+
+        public IGridColorStyle CreateColorStyle()
+        {
+            return new GridColorStyleType()
+            {
+                ColorRule = new System.ComponentModel.BindingList<GridColorRuleType>(),
+                HillShade = new HillShadeType()
+            };
+        }
+
+        public IGridSurfaceStyle CreateSurfaceStyle()
+        {
+            return new GridSurfaceStyleType();
+        }
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_3_0/LayerElementFactoryImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_3_0/LayerElementFactoryImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_3_0/LayerElementFactoryImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,490 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LDF_130
+using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LDF_110
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0
+#elif LDF_120
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0
+#elif LDF_130
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0
+#elif LDF_230
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0
+#elif LDF_240
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0
+#endif
+{
+    /// <summary>
+    /// A publically accessible entry point primarily used for registration with the <see cref="ObjectFactory"/> and
+    /// <see cref="ResourceTypeRegistry"/> classes
+    /// </summary>
+    public static class LdfEntryPoint
+    {
+        public static ILayerDefinition CreateDefault(LayerType type)
+        {
+            return LayerDefinition.CreateDefault(type);
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            return LayerDefinition.Deserialize(xml);
+        }
+
+        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 ctss = vsr2.CompositeStyle;
+                        if (ctss != null)
+                        {
+                            foreach (var cts in ctss)
+                            {
+                                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();
+        }
+    }
+
+    partial class LayerDefinition : ILayerElementFactory
+    {
+        public static ILayerDefinition CreateDefault(LayerType type)
+        {
+            var lyr = new LayerDefinition();
+            switch (type)
+            {
+                case LayerType.Drawing:
+                    lyr.CreateDrawingLayer();
+                    break;
+
+                case LayerType.Raster:
+                    lyr.CreateRasterLayer();
+                    break;
+
+                case LayerType.Vector:
+                    lyr.CreateVectorLayer();
+                    break;
+            }
+            return lyr;
+        }
+
+        protected virtual VectorLayerDefinitionType CreateVectorLayerInstance()
+        {
+            return new VectorLayerDefinitionType();
+        }
+
+        protected virtual VectorScaleRangeType CreateVectorScaleRangeInstance()
+        {
+            return new VectorScaleRangeType()
+            {
+                Items = new System.ComponentModel.BindingList<object>(),
+                AreaStyle = CreateDefaultAreaStyle(),
+                LineStyle = CreateDefaultLineStyle(),
+                PointStyle = CreateDefaultPointStyle()
+            };
+        }
+
+        public void CreateVectorLayer()
+        {
+            var vl = this.CreateVectorLayerInstance();
+            /*
+            var vl = new VectorLayerDefinitionType()
+            {
+#if LDF_240
+                Watermarks = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_4_0.WatermarkType>()
+#elif LDF_230
+                Watermarks = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_3_0.WatermarkType>()
+#endif
+            };
+             */
+
+            //TODO: Create composite type style if 1.2 or 1.3 schema
+
+            vl.VectorScaleRange = new System.ComponentModel.BindingList<VectorScaleRangeType>();
+            var defaultRange = this.CreateVectorScaleRangeInstance();
+            /*
+            var defaultRange = new VectorScaleRangeType()
+            {
+                Items = new System.ComponentModel.BindingList<object>(),
+                AreaStyle = CreateDefaultAreaStyle(),
+                LineStyle = CreateDefaultLineStyle(),
+                PointStyle = CreateDefaultPointStyle(),
+#if LDF_100 || LDF_110
+#else
+                CompositeStyle = new ICompositeTypeStyle[] { CreateDefaultCompositeStyle() }
+#endif
+            };
+             */
+            vl.VectorScaleRange.Add(defaultRange);
+
+            this.Item = vl;
+        }
+
+        public void CreateRasterLayer()
+        {
+            var gl = new GridLayerDefinitionType()
+            {
+                GridScaleRange = new System.ComponentModel.BindingList<GridScaleRangeType>(),
+            };
+
+            gl.AddGridScaleRange(new GridScaleRangeType()
+            {
+                ColorStyle = new GridColorStyleType()
+                {
+                    ColorRule = new System.ComponentModel.BindingList<GridColorRuleType>()
+                    {
+                        new GridColorRuleType() {
+                            LegendLabel = string.Empty,
+                            Color = new GridColorType()
+                        },
+                        new GridColorRuleType() {
+                            LegendLabel = string.Empty,
+                            Color = new GridColorType()
+                        }
+                    }
+                },
+                RebuildFactor = 1.0
+            });
+
+            gl.GetScaleRangeAt(0).ColorStyle.GetColorRuleAt(0).Color.SetValue("000000"); //NOXLATE
+            gl.GetScaleRangeAt(0).ColorStyle.GetColorRuleAt(1).Color.SetValue("FFFFFF"); //NOXLATE
+
+            this.Item = gl;
+        }
+
+        public void CreateDrawingLayer()
+        {
+            this.Item = new DrawingLayerDefinitionType();
+        }
+
+        /// <summary>
+        /// Creates a fill
+        /// </summary>
+        /// <param name="pattern"></param>
+        /// <param name="background"></param>
+        /// <param name="foreground"></param>
+        /// <returns></returns>
+        public IFill CreateFill(string pattern, System.Drawing.Color background, System.Drawing.Color foreground)
+        {
+            return new FillType()
+            {
+                BackgroundColor = Utility.SerializeHTMLColor(background, true),
+                FillPattern = pattern,
+                ForegroundColor = Utility.SerializeHTMLColor(foreground, true)
+            };
+        }
+
+        /// <summary>
+        /// Creates a line stroke with default settings
+        /// </summary>
+        /// <param name="color"></param>
+        /// <returns></returns>
+        public IStroke CreateStroke(System.Drawing.Color color)
+        {
+            return new StrokeType()
+            {
+                Color = Utility.SerializeHTMLColor(color, true),
+                LineStyle = "Solid", //NOXLATE
+                Thickness = "1", //NOXLATE
+                Unit = LengthUnitType.Points
+            };
+        }
+
+        public IStroke CreateDefaultStroke()
+        {
+            return CreateStroke(Color.Black);
+        }
+
+        public IPointVectorStyle CreateDefaultPointStyle()
+        {
+            IPointVectorStyle pts = new PointTypeStyleType()
+            {
+                PointRule = new System.ComponentModel.BindingList<PointRuleType>()
+            };
+            pts.AddRule(CreateDefaultPointRule());
+            return pts;
+        }
+
+        public ILineVectorStyle CreateDefaultLineStyle()
+        {
+            ILineVectorStyle lts = new LineTypeStyleType()
+            {
+                LineRule = new System.ComponentModel.BindingList<LineRuleType>()
+            };
+            lts.AddRule(CreateDefaultLineRule());
+            return lts;
+        }
+
+        public IAreaVectorStyle CreateDefaultAreaStyle()
+        {
+            IAreaVectorStyle ats = new AreaTypeStyleType()
+            {
+                AreaRule = new System.ComponentModel.BindingList<AreaRuleType>()
+            };
+            ats.AddRule(CreateDefaultAreaRule());
+            return ats;
+        }
+
+        public IVectorScaleRange CreateVectorScaleRange()
+        {
+            return new VectorScaleRangeType()
+            {
+                Items = new System.ComponentModel.BindingList<object>(),
+                AreaStyle = CreateDefaultAreaStyle(),
+                LineStyle = CreateDefaultLineStyle(),
+                PointStyle = CreateDefaultPointStyle()
+            };
+        }
+
+        public IFill CreateDefaultFill()
+        {
+            return CreateFill("Solid", Color.White, Color.White); //NOXLATE
+        }
+
+        public IMarkSymbol CreateDefaultMarkSymbol()
+        {
+            IMarkSymbol sym = new MarkSymbolType()
+            {
+                SizeContext = SizeContextType.DeviceUnits,
+                MaintainAspect = true,
+                Shape = ShapeType.Square,
+                Rotation = "0", //NOXLATE
+                SizeX = "10", //NOXLATE
+                SizeY = "10", //NOXLATE
+                Unit = LengthUnitType.Points
+            };
+            sym.Edge = CreateDefaultStroke();
+            sym.Fill = CreateDefaultFill();
+            return sym;
+        }
+
+        public IFontSymbol CreateDefaultFontSymbol()
+        {
+            IFontSymbol sym = new FontSymbolType()
+            {
+                SizeContext = SizeContextType.DeviceUnits,
+                MaintainAspect = true,
+                FontName = "Arial", //NOXLATE
+                Rotation = "0", //NOXLATE
+                SizeX = "10", //NOXLATE
+                SizeY = "10", //NOXLATE
+                Unit = LengthUnitType.Points
+            };
+            sym.SetForegroundColor(Color.Black);
+            return sym;
+        }
+
+        public IPointSymbolization2D CreateDefaultPointSymbolization2D()
+        {
+            IPointSymbolization2D sym = new PointSymbolization2DType();
+            sym.Symbol = CreateDefaultMarkSymbol();
+            return sym;
+        }
+
+        public IPointRule CreateDefaultPointRule()
+        {
+            IPointRule pr = new PointRuleType()
+            {
+                LegendLabel = string.Empty
+            };
+            pr.PointSymbolization2D = CreateDefaultPointSymbolization2D();
+            return pr;
+        }
+
+        public IAreaRule CreateDefaultAreaRule()
+        {
+            IAreaRule ar = new AreaRuleType()
+            {
+                LegendLabel = string.Empty
+            };
+            ar.AreaSymbolization2D = CreateDefaultAreaSymbolizationFill();
+            return ar;
+        }
+
+        public IAreaSymbolizationFill CreateDefaultAreaSymbolizationFill()
+        {
+            IAreaSymbolizationFill fill = new AreaSymbolizationFillType();
+            fill.Fill = CreateDefaultFill();
+            fill.Stroke = CreateDefaultStroke();
+
+            return fill;
+        }
+
+        public ILineRule CreateDefaultLineRule()
+        {
+            ILineRule lr = new LineRuleType()
+            {
+                LegendLabel = "",
+                Items = new System.ComponentModel.BindingList<StrokeType>()
+            };
+            lr.AddStroke(CreateDefaultStroke());
+            return lr;
+        }
+
+        public IAdvancedPlacement CreateDefaultAdvancedPlacement(double scaleLimit)
+        {
+            return new TextSymbolTypeAdvancedPlacement() { ScaleLimit = scaleLimit };
+        }
+
+        public ITextSymbol CreateDefaultTextSymbol()
+        {
+            return new TextSymbolType()
+            {
+                AdvancedPlacement = null,
+                BackgroundColor = Utility.SerializeHTMLColor(Color.White, true),
+                BackgroundStyle = BackgroundStyleType.Transparent,
+                Bold = "false", //NOXLATE
+                FontName = "Arial", //NOXLATE
+                ForegroundColor = Utility.SerializeHTMLColor(Color.Black, true),
+                HorizontalAlignment = "'Center'", //NOXLATE
+                Italic = "false", //NOXLATE
+                Rotation = "0", //NOXLATE
+                SizeContext = SizeContextType.DeviceUnits,
+                SizeX = "10", //NOXLATE
+                SizeY = "10", //NOXLATE
+                Text = string.Empty,
+                Underlined = "false", //NOXLATE
+                Unit = LengthUnitType.Points,
+                VerticalAlignment = "'Baseline'" //NOXLATE
+            };
+        }
+
+        public IW2DSymbol CreateDefaultW2DSymbol(string symbolLibrary, string symbolName)
+        {
+            return new W2DSymbolType()
+            {
+                W2DSymbol = new W2DSymbolTypeW2DSymbol()
+                {
+                    ResourceId = symbolLibrary,
+                    LibraryItemName = symbolName
+                },
+            };
+        }
+
+        public virtual ICompositeRule CreateDefaultCompositeRule()
+        {
+#if LDF_100
+            throw new NotImplementedException();
+#else
+            return new CompositeRule()
+            {
+                LegendLabel = string.Empty,
+                CompositeSymbolization = new CompositeSymbolization()
+                {
+                    SymbolInstance = new System.ComponentModel.BindingList<SymbolInstance>()
+                }
+            };
+#endif
+        }
+
+        public virtual ICompositeTypeStyle CreateDefaultCompositeStyle()
+        {
+#if LDF_100
+            throw new NotImplementedException();
+#else
+            var cts = new CompositeTypeStyle()
+            {
+                CompositeRule = new System.ComponentModel.BindingList<CompositeRule>(),
+#if LDF_110 || LDF_120
+#else
+                ShowInLegend = true,
+#endif
+            };
+            cts.AddCompositeRule(CreateDefaultCompositeRule());
+            return cts;
+#endif
+        }
+
+        public virtual IUrlData CreateUrlData()
+        {
+#if LDF_240
+            return new URLDataType();
+#else
+            throw new NotImplementedException();
+#endif
+        }
+
+        public virtual ICompositeSymbolization CloneCompositeSymbolization(ICompositeSymbolization sym)
+        {
+#if LDF_100
+            throw new NotImplementedException();
+#else
+            var csym = (CompositeSymbolization)sym;
+            //Use quick and dirty XML in'n'out cloning to ensure no existing child references are
+            //carried over
+            var clone = CompositeSymbolization.Deserialize(csym.Serialize());
+            /*
+            foreach (var oldInst in csym.SymbolInstance)
+            {
+                System.Diagnostics.Debug.WriteLine("old symbol instance: {0}", oldInst.GetHashCode());
+            }
+            foreach (var newInst in clone.SymbolInstance)
+            {
+                System.Diagnostics.Debug.WriteLine("new symbol instance: {0}", newInst.GetHashCode());
+            }*/
+            return clone;
+#endif
+        }
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_3_0/VectorLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_3_0/VectorLayerDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v1_3_0/VectorLayerDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,2469 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LDF_130
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LDF_110
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0
+#elif LDF_120
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0
+#elif LDF_130
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0
+#elif LDF_230
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0
+#elif LDF_240
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0
+#endif
+{
+    using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+    using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
+    using System.Xml.Serialization;
+
+    abstract partial class BaseLayerDefinitionType : ISubLayerDefinition
+#if LDF_230 || LDF_240
+, ISubLayerDefinition2
+#endif
+    {
+        [XmlIgnore]
+        public abstract LayerType LayerType { get; }
+
+#if LDF_230 || LDF_240
+
+        [XmlIgnore]
+        IEnumerable<IWatermark> IWatermarkCollection.Watermarks
+        {
+            get
+            {
+                foreach (var wm in this.Watermarks)
+                    yield return wm;
+            }
+        }
+
+        IWatermark IWatermarkCollection.AddWatermark(IWatermarkDefinition watermark)
+        {
+            return WatermarkCollectionUtil.AddWatermark(this.Watermarks, watermark);
+        }
+
+        void IWatermarkCollection.RemoveWatermark(IWatermark watermark)
+        {
+            WatermarkCollectionUtil.RemoveWatermark(this.Watermarks, watermark);
+        }
+
+        [XmlIgnore]
+        int IWatermarkCollection.WatermarkCount
+        {
+            get { return this.Watermarks.Count; }
+        }
+
+#endif
+    }
+
+    partial class NameStringPairType : INameStringPair
+    {
+        [XmlIgnore]
+        string INameStringPair.Name
+        {
+            get
+            {
+                return this.Name;
+            }
+            set
+            {
+                this.Name = value;
+            }
+        }
+
+        [XmlIgnore]
+        string INameStringPair.Value
+        {
+            get
+            {
+                return this.Value;
+            }
+            set
+            {
+                this.Value = value;
+            }
+        }
+    }
+
+    partial class VectorScaleRangeType : IVectorScaleRange
+#if !LDF_100
+, IVectorScaleRange2
+#endif
+    {
+        #region Missing generated stuff
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private bool minScaleFieldSpecified;
+
+        [System.Xml.Serialization.XmlIgnoreAttribute()]
+        public bool MinScaleSpecified
+        {
+            get
+            {
+                return this.minScaleFieldSpecified;
+            }
+            set
+            {
+                if ((minScaleFieldSpecified.Equals(value) != true))
+                {
+                    this.minScaleFieldSpecified = value;
+                    this.OnPropertyChanged("MinScaleSpecified"); //NOXLATE
+                }
+            }
+        }
+
+        #endregion Missing generated stuff
+
+        [XmlIgnore]
+        public IAreaVectorStyle AreaStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(IAreaVectorStyle).IsAssignableFrom(item.GetType()))
+                        return (IAreaVectorStyle)item;
+                }
+
+                return null;
+            }
+            set
+            {
+                //Remove old one if it exists
+                var item = this.AreaStyle;
+                if (item != null)
+                {
+                    this.itemsField.Remove(item);
+                }
+                //Put the new one in if it is not null
+                if (value != null)
+                {
+                    this.itemsField.Add(value);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public ILineVectorStyle LineStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ILineVectorStyle).IsAssignableFrom(item.GetType()))
+                        return (ILineVectorStyle)item;
+                }
+
+                return null;
+            }
+            set
+            {
+                //Remove old one if it exists
+                var item = this.LineStyle;
+                if (item != null)
+                {
+                    this.itemsField.Remove(item);
+                }
+                //Put the new one in if it is not null
+                if (value != null)
+                {
+                    this.itemsField.Add(value);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public IPointVectorStyle PointStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(IPointVectorStyle).IsAssignableFrom(item.GetType()))
+                        return (IPointVectorStyle)item;
+                }
+
+                return null;
+            }
+            set
+            {
+                //Remove old one if it exists
+                var item = this.PointStyle;
+                if (item != null)
+                {
+                    this.itemsField.Remove(item);
+                }
+                //Put the new one in if it is not null
+                if (value != null)
+                {
+                    this.itemsField.Add(value);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        double? IVectorScaleRange.MinScale
+        {
+            get
+            {
+                return this.MinScaleSpecified ? new Nullable<double>(this.MinScale) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.MinScaleSpecified = true;
+                    this.MinScale = value.Value;
+                }
+                else
+                {
+                    this.MinScaleSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        double? IVectorScaleRange.MaxScale
+        {
+            get
+            {
+                return this.MaxScaleSpecified ? new Nullable<double>(this.MaxScale) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.MaxScaleSpecified = true;
+                    this.MaxScale = value.Value;
+                }
+                else
+                {
+                    this.MaxScaleSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public IList<IVectorStyle> AllStyles
+        {
+            get { return (IList<IVectorStyle>)this.Items; }
+        }
+
+        IVectorScaleRange IVectorScaleRange.Clone()
+        {
+            return VectorScaleRangeType.Deserialize(this.Serialize());
+        }
+
+#if LDF_110 || LDF_120
+
+        [XmlIgnore]
+        public IEnumerable<ICompositeTypeStyle> CompositeStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                        yield return (ICompositeTypeStyle)item;
+                }
+            }
+            set
+            {
+                //Clear old ones
+                var remove = new List<object>();
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                        remove.Add(item);
+                }
+
+                foreach (var obj in remove)
+                {
+                    this.itemsField.Remove(obj);
+                }
+
+                //Put the new ones in if it is not null
+                if (value != null)
+                {
+                    foreach (var item in value)
+                    {
+                        if (!typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                            throw new InvalidOperationException(Strings.ErrorObjectNotICompositeTypeStyle);
+
+                        this.itemsField.Add(item);
+                    }
+                }
+            }
+        }
+
+#elif LDF_130 || LDF_230 || LDF_240
+
+        [XmlIgnore]
+        public IEnumerable<ICompositeTypeStyle> CompositeStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+                        yield return (ICompositeTypeStyle2)item;
+                }
+            }
+            set
+            {
+                //Clear old ones
+                var remove = new List<object>();
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+                        remove.Add(item);
+                }
+
+                foreach (var obj in remove)
+                {
+                    this.itemsField.Remove(obj);
+                }
+
+                //Put the new ones in if it is not null
+                if (value != null)
+                {
+                    foreach (var item in value)
+                    {
+                        if (!typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+                            throw new InvalidOperationException(Strings.ErrorObjectNotICompositeTypeStyle);
+
+                        this.itemsField.Add(item);
+                    }
+                }
+            }
+        }
+
+#endif
+
+#if LDF_100
+#else
+
+        IElevationSettings IVectorScaleRange2.ElevationSettings
+        {
+            get { return this.ElevationSettings; }
+            set { this.ElevationSettings = (ElevationSettingsType)value; }
+        }
+
+        IElevationSettings IVectorScaleRange2.Create(string zOffset, string zExtrusion, ElevationTypeType zOffsetType, LengthUnitType unit)
+        {
+            return new ElevationSettingsType()
+            {
+                ZOffset = zOffset,
+                ZOffsetType = zOffsetType,
+                ZExtrusion = zExtrusion,
+                Unit = unit
+            };
+        }
+
+        [XmlIgnore]
+        int IVectorScaleRange2.CompositeStyleCount
+        {
+            get
+            {
+                int count = 0;
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                        count++;
+                }
+                return count;
+            }
+        }
+
+#endif
+    }
+
+#if LDF_100
+#else
+
+    partial class ElevationSettingsType : IElevationSettings { }
+
+#endif
+
+#if LDF_100
+
+    partial class StrokeType : IStroke
+#else
+
+    partial class StrokeType : IStroke, IStroke2
+#endif
+    {
+        internal StrokeType()
+        {
+        }
+
+        IStroke ICloneableLayerElement<IStroke>.Clone()
+        {
+            return StrokeType.Deserialize(this.Serialize());
+        }
+
+#if LDF_100
+#else
+
+        IStroke2 ICloneableLayerElement<IStroke2>.Clone()
+        {
+            return StrokeType.Deserialize(this.Serialize());
+        }
+
+#endif
+    }
+
+    partial class FillType : IFill
+    {
+        internal FillType()
+        {
+        }
+
+        IFill ICloneableLayerElement<IFill>.Clone()
+        {
+            return FillType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class AreaTypeStyleType : IAreaVectorStyle
+#if LDF_130 || LDF_230 || LDF_240
+, IAreaVectorStyle2
+#endif
+    {
+        [XmlIgnore]
+        IEnumerable<IAreaRule> IAreaVectorStyle.Rules
+        {
+            get
+            {
+                foreach (var ar in this.AreaRule)
+                {
+                    yield return ar;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int IVectorStyle.RuleCount
+        {
+            get
+            {
+                if (this.AreaRule != null)
+                    return this.AreaRule.Count;
+                return 0;
+            }
+        }
+
+        void IAreaVectorStyle.RemoveAllRules()
+        {
+            this.AreaRule.Clear();
+        }
+
+        void IAreaVectorStyle.AddRule(IAreaRule rule)
+        {
+            var ar = rule as AreaRuleType;
+            if (ar != null)
+                this.AreaRule.Add(ar);
+        }
+
+        void IAreaVectorStyle.RemoveRule(IAreaRule rule)
+        {
+            var ar = rule as AreaRuleType;
+            if (ar != null)
+                this.AreaRule.Remove(ar);
+        }
+
+        [XmlIgnore]
+        StyleType IVectorStyle.StyleType
+        {
+            get { return StyleType.Area; }
+        }
+
+        #region IRuleCollection<IAreaRule> Members
+
+        public int IndexOfRule(IAreaRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+                return this.AreaRule.IndexOf(r);
+            return -1;
+        }
+
+        public IAreaRule GetRuleAt(int index)
+        {
+            return this.AreaRule[index];
+        }
+
+        public bool MoveUp(IAreaRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveUp(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        public bool MoveDown(IAreaRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveDown(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        #endregion IRuleCollection<IAreaRule> Members
+
+        #region IRuleCollection Members
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.AreaRule[index];
+        }
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+                return this.AreaRule.IndexOf(r);
+            return -1;
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveUp(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveDown(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        #endregion IRuleCollection Members
+    }
+
+    internal static class CollectionUtil
+    {
+        public static bool MoveUp<T>(IList<T> list, T obj)
+        {
+            var idx = list.IndexOf(obj);
+            if (idx == 0) //Already at top
+                return false;
+
+            var newIdx = idx - 1;
+            //Get object at index
+            var obj2 = list[newIdx];
+            //Swap them
+            list[idx] = obj2;
+            list[newIdx] = obj;
+
+            return true;
+        }
+
+        public static bool MoveDown<T>(IList<T> list, T obj)
+        {
+            var idx = list.IndexOf(obj);
+            if (idx == list.Count - 1) //Already at bottom
+                return false;
+
+            var newIdx = idx + 1;
+            //Get object at index
+            var obj2 = list[newIdx];
+            //Swap them
+            list[idx] = obj2;
+            list[newIdx] = obj;
+
+            return true;
+        }
+    }
+
+    partial class AreaRuleType : IAreaRule
+    {
+        [XmlIgnore]
+        IAreaSymbolizationFill IAreaRule.AreaSymbolization2D
+        {
+            get
+            {
+                return this.Item;
+            }
+            set
+            {
+                this.Item = (AreaSymbolizationFillType)value;
+            }
+        }
+
+        [XmlIgnore]
+        ITextSymbol IBasicVectorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+    }
+
+    partial class PointTypeStyleType : IPointVectorStyle
+#if LDF_130 || LDF_230 || LDF_240
+, IPointVectorStyle2
+#endif
+    {
+        [XmlIgnore]
+        public IEnumerable<IPointRule> Rules
+        {
+            get
+            {
+                foreach (var pr in this.PointRule)
+                {
+                    yield return pr;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int IVectorStyle.RuleCount
+        {
+            get
+            {
+                if (this.PointRule != null)
+                    return this.PointRule.Count;
+                return 0;
+            }
+        }
+
+        public void RemoveAllRules()
+        {
+            this.PointRule.Clear();
+        }
+
+        public void AddRule(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                this.PointRule.Add(pr);
+        }
+
+        public void RemoveRule(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                this.PointRule.Remove(pr);
+        }
+
+        [XmlIgnore]
+        public StyleType StyleType
+        {
+            get { return StyleType.Point; }
+        }
+
+        #region IRuleCollection<IPointRule> Members
+
+        public int IndexOfRule(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return this.PointRule.IndexOf(pr);
+            return -1;
+        }
+
+        public IPointRule GetRuleAt(int index)
+        {
+            return this.PointRule[index];
+        }
+
+        public bool MoveUp(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveUp(this.PointRule, pr);
+            return false;
+        }
+
+        public bool MoveDown(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveDown(this.PointRule, pr);
+            return false;
+        }
+
+        #endregion IRuleCollection<IPointRule> Members
+
+        #region IRuleCollection Members
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.PointRule[index];
+        }
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return this.PointRule.IndexOf(pr);
+            return -1;
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveUp(this.PointRule, pr);
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveDown(this.PointRule, pr);
+            return false;
+        }
+
+        #endregion IRuleCollection Members
+    }
+
+    partial class PointRuleType : IPointRule
+    {
+        [XmlIgnore]
+        ITextSymbol IBasicVectorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IPointSymbolization2D IPointRule.PointSymbolization2D
+        {
+            get { return this.Item; }
+            set { this.Item = (PointSymbolization2DType)value; }
+        }
+    }
+
+    partial class PointSymbolization2DType : IPointSymbolization2D
+    {
+        [XmlIgnore]
+        ISymbol IPointSymbolization2D.Symbol
+        {
+            get { return (ISymbol)this.Item; }
+            set { this.Item = (SymbolType)value; }
+        }
+
+        IPointSymbolization2D ICloneableLayerElement<IPointSymbolization2D>.Clone()
+        {
+            return PointSymbolization2DType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class LineTypeStyleType : ILineVectorStyle
+#if LDF_130 || LDF_230 || LDF_240
+, ILineVectorStyle2
+#endif
+    {
+        [XmlIgnore]
+        public IEnumerable<ILineRule> Rules
+        {
+            get
+            {
+                foreach (var lr in this.LineRule)
+                {
+                    yield return lr;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int IVectorStyle.RuleCount
+        {
+            get
+            {
+                if (this.LineRule != null)
+                    return this.LineRule.Count;
+                return 0;
+            }
+        }
+
+        public ILineRule GetRuleAt(int index)
+        {
+            return this.LineRule[index];
+        }
+
+        public void RemoveAllRules()
+        {
+            this.LineRule.Clear();
+        }
+
+        public void AddRule(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                this.LineRule.Add(lr);
+        }
+
+        public void RemoveRule(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                this.LineRule.Remove(lr);
+        }
+
+        [XmlIgnore]
+        public StyleType StyleType
+        {
+            get { return StyleType.Line; }
+        }
+
+        #region IRuleCollection<ILineRule> Members
+
+        public int IndexOfRule(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return this.LineRule.IndexOf(lr);
+            return -1;
+        }
+
+        public bool MoveUp(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveUp(this.LineRule, lr);
+            return false;
+        }
+
+        public bool MoveDown(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveDown(this.LineRule, lr);
+            return false;
+        }
+
+        #endregion IRuleCollection<ILineRule> Members
+
+        #region IRuleCollection Members
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.LineRule[index];
+        }
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return this.LineRule.IndexOf(lr);
+            return -1;
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveUp(this.LineRule, lr);
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveDown(this.LineRule, lr);
+            return false;
+        }
+
+        #endregion IRuleCollection Members
+    }
+
+    partial class LineRuleType : ILineRule
+    {
+        [XmlIgnore]
+        IEnumerable<IStroke> ILineRule.Strokes
+        {
+            get
+            {
+                foreach (var str in this.Items)
+                {
+                    yield return str;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int ILineRule.StrokeCount
+        {
+            get { return this.Items.Count; }
+        }
+
+        void ILineRule.SetStrokes(IEnumerable<IStroke> strokes)
+        {
+            Check.NotNull(strokes, "strokes"); //NOXLATE
+            this.Items.Clear();
+            foreach (var stroke in strokes)
+            {
+                var st = stroke as StrokeType;
+                if (st != null)
+                    this.Items.Add(st);
+            }
+        }
+
+        void ILineRule.AddStroke(IStroke stroke)
+        {
+            var st = stroke as StrokeType;
+            if (st != null)
+                this.Items.Add(st);
+        }
+
+        void ILineRule.RemoveStroke(IStroke stroke)
+        {
+            var st = stroke as StrokeType;
+            if (st != null)
+                this.Items.Remove(st);
+        }
+
+        [XmlIgnore]
+        ITextSymbol IBasicVectorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+    }
+
+    partial class TextSymbolType : ITextSymbol
+    {
+        [XmlIgnore]
+        IAdvancedPlacement ITextSymbol.AdvancedPlacement
+        {
+            get
+            {
+                return this.AdvancedPlacement;
+            }
+            set
+            {
+                this.AdvancedPlacement = (TextSymbolTypeAdvancedPlacement)value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Text
+        {
+            get
+            {
+                return this.Text;
+            }
+            set
+            {
+                this.Text = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.FontName
+        {
+            get
+            {
+                return this.FontName;
+            }
+            set
+            {
+                this.FontName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.ForegroundColor
+        {
+            get
+            {
+                return this.ForegroundColor;
+            }
+            set
+            {
+                this.ForegroundColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.BackgroundColor
+        {
+            get
+            {
+                return this.BackgroundColor;
+            }
+            set
+            {
+                this.BackgroundColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        BackgroundStyleType ITextSymbol.BackgroundStyle
+        {
+            get
+            {
+                return this.BackgroundStyle;
+            }
+            set
+            {
+                this.BackgroundStyle = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.HorizontalAlignment
+        {
+            get
+            {
+                return this.HorizontalAlignment;
+            }
+            set
+            {
+                this.HorizontalAlignment = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.VerticalAlignment
+        {
+            get
+            {
+                return this.VerticalAlignment;
+            }
+            set
+            {
+                this.VerticalAlignment = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Bold
+        {
+            get
+            {
+                return this.Bold;
+            }
+            set
+            {
+                this.Bold = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Italic
+        {
+            get
+            {
+                return this.Italic;
+            }
+            set
+            {
+                this.Italic = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Underlined
+        {
+            get
+            {
+                return this.Underlined;
+            }
+            set
+            {
+                this.Underlined = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Font; }
+        }
+
+        ITextSymbol ICloneableLayerElement<ITextSymbol>.Clone()
+        {
+            return TextSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class MarkSymbolType : IMarkSymbol
+    {
+        [XmlIgnore]
+        ShapeType IMarkSymbol.Shape
+        {
+            get
+            {
+                return this.Shape;
+            }
+            set
+            {
+                this.Shape = value;
+            }
+        }
+
+        [XmlIgnore]
+        IFill IMarkSymbol.Fill
+        {
+            get
+            {
+                return (IFill)this.Fill;
+            }
+            set
+            {
+                this.Fill = (FillType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IStroke IMarkSymbol.Edge
+        {
+            get
+            {
+                return (IStroke)this.Edge;
+            }
+            set
+            {
+                this.Edge = (StrokeType)value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Mark; }
+        }
+
+        IMarkSymbol ICloneableLayerElement<IMarkSymbol>.Clone()
+        {
+            return MarkSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    internal class ImageBinaryContainer : IInlineImageSymbol
+    {
+        [XmlIgnore]
+        public byte[] Content
+        {
+            get;
+            set;
+        }
+
+        [XmlIgnore]
+        public ImageSymbolReferenceType Type
+        {
+            get { return ImageSymbolReferenceType.Inline; }
+        }
+
+        IInlineImageSymbol ICloneableLayerElement<IInlineImageSymbol>.Clone()
+        {
+            byte[] array = null;
+            if (this.Content != null)
+            {
+                array = new byte[this.Content.Length];
+                Array.Copy(this.Content, array, this.Content.Length);
+            }
+            return new ImageBinaryContainer()
+            {
+                Content = array
+            };
+        }
+    }
+
+    partial class ImageSymbolType : IImageSymbol
+    {
+        [XmlIgnore]
+        IBaseImageSymbol IImageSymbol.Image
+        {
+            get
+            {
+                IBaseImageSymbol img = null;
+                if (this.Item == null)
+                    return null;
+
+                if (typeof(byte[]).IsAssignableFrom(this.Item.GetType()))
+                    img = new ImageBinaryContainer() { Content = (byte[])this.Item };
+                else
+                    img = (ISymbolReference)this.Item;
+                return img;
+            }
+            set
+            {
+                if (typeof(IInlineImageSymbol).IsAssignableFrom(value.GetType()))
+                    this.Item = ((IInlineImageSymbol)value).Content;
+                else
+                    this.Item = (ImageSymbolTypeImage)value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Image; }
+        }
+
+        IImageSymbol ICloneableLayerElement<IImageSymbol>.Clone()
+        {
+            return ImageSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    abstract partial class SymbolType : ISymbol
+    {
+        [XmlIgnore]
+        LengthUnitType ISymbol.Unit
+        {
+            get
+            {
+                return this.Unit;
+            }
+            set
+            {
+                this.Unit = value;
+            }
+        }
+
+        [XmlIgnore]
+        SizeContextType ISymbol.SizeContext
+        {
+            get
+            {
+                return this.SizeContext;
+            }
+            set
+            {
+                this.SizeContext = value;
+            }
+        }
+
+        [XmlIgnore]
+        bool ISymbol.MaintainAspect
+        {
+            get
+            {
+                return this.MaintainAspect;
+            }
+            set
+            {
+                this.MaintainAspect = true;
+            }
+        }
+
+        [XmlIgnore]
+        public abstract PointSymbolType Type { get; }
+
+        [XmlIgnore]
+        string ISymbol.InsertionPointY
+        {
+            get
+            {
+                return this.InsertionPointY.ToString();
+            }
+            set
+            {
+                this.InsertionPointY = Convert.ToDouble(value);
+            }
+        }
+    }
+
+    partial class FontSymbolType : IFontSymbol
+    {
+        [XmlIgnore]
+        string IFontSymbol.FontName
+        {
+            get
+            {
+                return this.FontName;
+            }
+            set
+            {
+                this.FontName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IFontSymbol.Character
+        {
+            get
+            {
+                return this.Character;
+            }
+            set
+            {
+                this.Character = value;
+            }
+        }
+
+        [XmlIgnore]
+        bool? IFontSymbol.Bold
+        {
+            get
+            {
+                return this.BoldSpecified ? new Nullable<bool>(this.Bold) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.Bold = value.Value;
+                    this.BoldSpecified = true;
+                }
+                else
+                {
+                    this.BoldSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        bool? IFontSymbol.Italic
+        {
+            get
+            {
+                return this.ItalicSpecified ? new Nullable<bool>(this.Italic) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.Italic = value.Value;
+                    this.ItalicSpecified = true;
+                }
+                else
+                {
+                    this.ItalicSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        bool? IFontSymbol.Underlined
+        {
+            get
+            {
+                return this.UnderlinedSpecified ? new Nullable<bool>(this.Underlined) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.Underlined = value.Value;
+                    this.UnderlinedSpecified = true;
+                }
+                else
+                {
+                    this.UnderlinedSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        string IFontSymbol.ForegroundColor
+        {
+            get
+            {
+                return this.ForegroundColor;
+            }
+            set
+            {
+                this.ForegroundColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Font; }
+        }
+
+        IFontSymbol ICloneableLayerElement<IFontSymbol>.Clone()
+        {
+            return FontSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class BlockSymbolType : IBlockSymbol
+    {
+        [XmlIgnore]
+        string IBlockSymbol.DrawingName
+        {
+            get
+            {
+                return this.DrawingName;
+            }
+            set
+            {
+                this.DrawingName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IBlockSymbol.BlockName
+        {
+            get
+            {
+                return this.BlockName;
+            }
+            set
+            {
+                this.BlockName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IBlockSymbol.BlockColor
+        {
+            get
+            {
+                return this.BlockColor;
+            }
+            set
+            {
+                this.BlockColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IBlockSymbol.LayerColor
+        {
+            get
+            {
+                return this.LayerColor;
+            }
+            set
+            {
+                this.LayerColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Block; }
+        }
+
+        IBlockSymbol ICloneableLayerElement<IBlockSymbol>.Clone()
+        {
+            return BlockSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class W2DSymbolType : IW2DSymbol
+    {
+        [XmlIgnore]
+        ISymbolReference IW2DSymbol.W2DSymbol
+        {
+            get
+            {
+                return (ISymbolReference)this.W2DSymbol;
+            }
+            set
+            {
+                this.W2DSymbol = (W2DSymbolTypeW2DSymbol)value;
+            }
+        }
+
+        [XmlIgnore]
+        string IW2DSymbol.FillColor
+        {
+            get
+            {
+                return this.FillColor;
+            }
+            set
+            {
+                this.FillColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IW2DSymbol.LineColor
+        {
+            get
+            {
+                return this.LineColor;
+            }
+            set
+            {
+                this.LineColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IW2DSymbol.TextColor
+        {
+            get
+            {
+                return this.TextColor;
+            }
+            set
+            {
+                this.TextColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.W2D; }
+        }
+
+        IW2DSymbol ICloneableLayerElement<IW2DSymbol>.Clone()
+        {
+            return W2DSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class W2DSymbolTypeW2DSymbol : ISymbolReference
+    {
+        [XmlIgnore]
+        ImageSymbolReferenceType IBaseImageSymbol.Type
+        {
+            get { return ImageSymbolReferenceType.SymbolReference; }
+        }
+
+        ISymbolReference ICloneableLayerElement<ISymbolReference>.Clone()
+        {
+            return W2DSymbolTypeW2DSymbol.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class ImageSymbolTypeImage : ISymbolReference
+    {
+        [XmlIgnore]
+        string ISymbolReference.ResourceId
+        {
+            get
+            {
+                return this.ResourceId == null ? string.Empty : this.ResourceId.ToString();
+            }
+            set
+            {
+                this.ResourceId = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ISymbolReference.LibraryItemName
+        {
+            get
+            {
+                return this.LibraryItemName == null ? string.Empty : this.LibraryItemName.ToString();
+            }
+            set
+            {
+                this.LibraryItemName = value;
+            }
+        }
+
+        [XmlIgnore]
+        ImageSymbolReferenceType IBaseImageSymbol.Type
+        {
+            get { return ImageSymbolReferenceType.SymbolReference; }
+        }
+
+        ISymbolReference ICloneableLayerElement<ISymbolReference>.Clone()
+        {
+            return ImageSymbolTypeImage.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class TextSymbolTypeAdvancedPlacement : IAdvancedPlacement
+    {
+    }
+
+    partial class AreaSymbolizationFillType : IAreaSymbolizationFill
+    {
+        [XmlIgnore]
+        IFill IAreaSymbolizationFill.Fill
+        {
+            get
+            {
+                return this.Fill;
+            }
+            set
+            {
+                this.Fill = (FillType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IStroke IAreaSymbolizationFill.Stroke
+        {
+            get
+            {
+                return this.Stroke;
+            }
+            set
+            {
+                this.Stroke = (StrokeType)value;
+            }
+        }
+
+        IAreaSymbolizationFill ICloneableLayerElement<IAreaSymbolizationFill>.Clone()
+        {
+            return AreaSymbolizationFillType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class LayerDefinition : ILayerDefinition
+    {
+        //internal LayerDefinition() { }
+
+#if LDF_110
+        private static readonly Version RES_VERSION = new Version(1, 1, 0);
+#elif LDF_120
+        private static readonly Version RES_VERSION = new Version(1, 2, 0);
+#elif LDF_130
+        private static readonly Version RES_VERSION = new Version(1, 3, 0);
+#elif LDF_230
+        private static readonly Version RES_VERSION = new Version(2, 3, 0);
+#elif LDF_240
+        private static readonly Version RES_VERSION = new Version(2, 4, 0);
+#else
+        private static readonly Version RES_VERSION = new Version(1, 0, 0);
+#endif
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.LayerDefinition.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.LayerDefinition));
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.LayerDefinition.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public virtual Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        object ICloneable.Clone()
+        {
+            return this.Clone();
+        }
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")] //NOXLATE
+        public string ValidatingSchema
+        {
+#if LDF_110
+            get { return "LayerDefinition-1.1.0.xsd"; } //NOXLATE
+#elif LDF_120
+            get { return "LayerDefinition-1.2.0.xsd"; } //NOXLATE
+#elif LDF_130
+            get { return "LayerDefinition-1.3.0.xsd"; } //NOXLATE
+#elif LDF_230
+            get { return "LayerDefinition-2.3.0.xsd"; } //NOXLATE
+#elif LDF_240
+            get { return "LayerDefinition-2.4.0.xsd"; } //NOXLATE
+#else
+            get { return ResourceTypes.LayerDefinition.ToString() + "-" + this.ResourceVersion.ToString() + ".xsd"; } //NOXLATE
+#endif
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        [XmlIgnore]
+        public ISubLayerDefinition SubLayer
+        {
+            get { return this.Item; }
+        }
+
+        public INameStringPair CreatePair(string name, string value)
+        {
+            return new NameStringPairType() { Name = name, Value = value };
+        }
+    }
+
+    partial class DrawingLayerDefinitionType : IDrawingLayerDefinition
+    {
+        [XmlIgnore]
+        public override LayerType LayerType
+        {
+            get { return LayerType.Drawing; }
+        }
+
+        [XmlIgnore]
+        string ISubLayerDefinition.ResourceId
+        {
+            get { return this.ResourceId; }
+            set { this.ResourceId = value; }
+        }
+    }
+
+    partial class VectorLayerDefinitionType : IVectorLayerDefinition
+#if LDF_240
+, IVectorLayerDefinition2
+#endif
+    {
+        [XmlIgnore]
+        public override LayerType LayerType
+        {
+            get { return LayerType.Vector; }
+        }
+
+        [XmlIgnore]
+        string ISubLayerDefinition.ResourceId
+        {
+            get { return this.ResourceId; }
+            set { this.ResourceId = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.FeatureName
+        {
+            get { return this.FeatureName; }
+            set { this.FeatureName = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.Geometry
+        {
+            get { return this.Geometry; }
+            set { this.Geometry = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.Url
+        {
+#if LDF_240
+            get
+            {
+                if (this.urlDataField == null)
+                    return string.Empty;
+                else
+                    return this.urlDataField.Content;
+            }
+            set
+            {
+                if (!string.IsNullOrEmpty(value))
+                {
+                    if (this.urlDataField == null)
+                        this.urlDataField = new URLDataType();
+                    this.urlDataField.Content = value;
+                    OnPropertyChanged("Url"); //NOXLATE
+                }
+                else
+                {
+                    //NOTE: None of the other URLData properties seem to be used atm
+                    //hence why we are nulling this
+                    this.urlDataField = null;
+                    OnPropertyChanged("Url"); //NOXLATE
+                }
+            }
+#else
+            get { return this.Url; }
+            set { this.Url = value; }
+#endif
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.ToolTip
+        {
+            get { return this.ToolTip; }
+            set { this.ToolTip = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.Filter
+        {
+            get { return this.Filter; }
+            set { this.Filter = value; }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IVectorScaleRange> IVectorLayerDefinition.VectorScaleRange
+        {
+            get
+            {
+                foreach (var vsr in this.VectorScaleRange)
+                {
+                    yield return vsr;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<INameStringPair> IVectorLayerDefinition.PropertyMapping
+        {
+            get
+            {
+                foreach (var pair in this.PropertyMapping)
+                {
+                    yield return pair;
+                }
+            }
+        }
+
+        INameStringPair IVectorLayerDefinition.GetPropertyMapping(string name)
+        {
+            foreach (var p in this.PropertyMapping)
+            {
+                if (p.Name == name)
+                    return p;
+            }
+            return null;
+        }
+
+        INameStringPair IVectorLayerDefinition.GetPropertyMappingAt(int index)
+        {
+            if (index < 0 || index >= this.PropertyMapping.Count)
+                throw new ArgumentOutOfRangeException();
+
+            var item = this.PropertyMapping[index];
+            return item;
+        }
+
+        void IVectorLayerDefinition.AddVectorScaleRange(IVectorScaleRange range)
+        {
+            var r = range as VectorScaleRangeType;
+            if (r != null)
+                this.VectorScaleRange.Add(r);
+        }
+
+        void IVectorLayerDefinition.RemoveVectorScaleRange(IVectorScaleRange range)
+        {
+            var r = range as VectorScaleRangeType;
+            if (r != null)
+                this.VectorScaleRange.Remove(r);
+        }
+
+        void IVectorLayerDefinition.AddPropertyMapping(INameStringPair pair)
+        {
+            var p = pair as NameStringPairType;
+            if (p != null)
+                this.PropertyMapping.Add(p);
+        }
+
+        void IVectorLayerDefinition.RemovePropertyMapping(INameStringPair pair)
+        {
+            var p = pair as NameStringPairType;
+            if (p != null)
+                this.PropertyMapping.Remove(p);
+        }
+
+        int IVectorLayerDefinition.GetPosition(INameStringPair pair)
+        {
+            var p = pair as NameStringPairType;
+            if (p != null)
+                return this.PropertyMapping.IndexOf(p);
+
+            return -1;
+        }
+
+        int IVectorLayerDefinition.MoveUp(INameStringPair pair)
+        {
+            int pos = ((IVectorLayerDefinition)this).GetPosition(pair);
+            if (pos > 0)
+            {
+                int dest = pos - 1;
+                var p = this.PropertyMapping[dest];
+                var p2 = (NameStringPairType)pair;
+
+                //Swap
+                this.PropertyMapping[dest] = p2;
+                this.PropertyMapping[pos] = p;
+
+                return dest;
+            }
+            return -1;
+        }
+
+        int IVectorLayerDefinition.MoveDown(INameStringPair pair)
+        {
+            int pos = ((IVectorLayerDefinition)this).GetPosition(pair);
+            if (pos < this.PropertyMapping.Count - 1)
+            {
+                int dest = pos + 1;
+                var p = this.PropertyMapping[dest];
+                var p2 = (NameStringPairType)pair;
+
+                //Swap
+                this.PropertyMapping[dest] = p2;
+                this.PropertyMapping[pos] = p;
+
+                return dest;
+            }
+            return -1;
+        }
+
+        void IVectorLayerDefinition.RemoveAllScaleRanges()
+        {
+            this.VectorScaleRange.Clear();
+        }
+
+        int IVectorLayerDefinition.IndexOfScaleRange(IVectorScaleRange range)
+        {
+            var r = range as VectorScaleRangeType;
+            if (r != null)
+                return this.VectorScaleRange.IndexOf(r);
+
+            return -1;
+        }
+
+        IVectorScaleRange IVectorLayerDefinition.GetScaleRangeAt(int index)
+        {
+            if (index >= this.VectorScaleRange.Count)
+                return null;
+
+            return this.VectorScaleRange[index];
+        }
+
+        [XmlIgnore]
+        Version IVectorLayerDefinition.SymbolDefinitionVersion
+        {
+            get
+            {
+#if LDF_110
+                return new Version(1, 0, 0);
+#elif LDF_120 || LDF_130 || LDF_230
+                return new Version(1, 1, 0);
+#elif LDF_240
+                return new Version(2, 4, 0);
+#else
+                return null;
+#endif
+            }
+        }
+
+#if LDF_240
+
+        [XmlIgnore]
+        IUrlData IVectorLayerDefinition2.UrlData
+        {
+            get
+            {
+                return this.UrlData;
+            }
+            set
+            {
+                this.UrlData = (URLDataType)value;
+            }
+        }
+
+#endif
+
+        void IVectorLayerDefinition.ClearPropertyMappings()
+        {
+            propertyMappingField.Clear();
+        }
+    }
+
+    #region Composite Symbolization
+
+#if !LDF_100
+
+    partial class CompositeRule : ICompositeRule
+    {
+        [XmlIgnore]
+        ICompositeSymbolization ICompositeRule.CompositeSymbolization
+        {
+            get
+            {
+                return this.CompositeSymbolization;
+            }
+            set
+            {
+                this.CompositeSymbolization = (CompositeSymbolization)value;
+            }
+        }
+    }
+
+    partial class CompositeSymbolization : ICompositeSymbolization
+    {
+        [XmlIgnore]
+        IEnumerable<ISymbolInstance> ICompositeSymbolization.SymbolInstance
+        {
+            get
+            {
+                foreach (var sym in this.SymbolInstance)
+                {
+                    yield return sym;
+                }
+            }
+        }
+
+        public string ToXml()
+        {
+            return this.Serialize();
+        }
+
+        public void UpdateFromXml(string xml)
+        {
+            var compsym = CompositeSymbolization.Deserialize(xml);
+            this.SymbolInstance.Clear();
+            foreach (var sym in compsym.SymbolInstance)
+            {
+                this.AddSymbolInstance(sym);
+            }
+        }
+
+        public void AddSymbolInstance(ISymbolInstance inst)
+        {
+            var sym = inst as SymbolInstance;
+            if (sym != null)
+                this.SymbolInstance.Add(sym);
+        }
+
+        public void RemoveSymbolInstance(ISymbolInstance inst)
+        {
+            var sym = inst as SymbolInstance;
+            if (sym != null)
+                this.SymbolInstance.Remove(sym);
+        }
+
+        public void RemoveAllSymbolInstances()
+        {
+            this.SymbolInstance.Clear();
+        }
+
+        public ISymbolInstance CreateSymbolReference(string resourceId)
+        {
+            return new SymbolInstance()
+            {
+                Item = resourceId,
+                ParameterOverrides = new ParameterOverrides()
+                {
+                    Override = new BindingList<Override>()
+                },
+            };
+        }
+
+        public ISymbolInstance CreateInlineSimpleSymbol(ISimpleSymbolDefinition symDef)
+        {
+            return new SymbolInstance()
+            {
+#if LDF_110
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition)symDef,
+#elif LDF_120 || LDF_130 || LDF_230
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.SimpleSymbolDefinition)symDef,
+#else
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_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.v1_0_0.CompoundSymbolDefinition)compDef,
+#elif LDF_120 || LDF_130 || LDF_230
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.CompoundSymbolDefinition)compDef,
+#else
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.CompoundSymbolDefinition)compDef,
+#endif
+                ParameterOverrides = new ParameterOverrides()
+                {
+                    Override = new BindingList<Override>()
+                }
+            };
+        }
+    }
+
+    partial class SymbolInstance : ISymbolInstance
+#if LDF_100 || LDF_110
+#else
+, ISymbolInstance2
+#endif
+    {
+        [XmlIgnore]
+        IParameterOverrideCollection ISymbolInstance.ParameterOverrides
+        {
+            get { return this.ParameterOverrides; }
+        }
+
+        [XmlIgnore]
+        public ISymbolInstanceReference Reference
+        {
+            get
+            {
+                var libId = this.Item as string;
+#if LDF_110
+                var simpSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition;
+                var compSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.CompoundSymbolDefinition;
+#elif LDF_120 || LDF_130 || LDF_230
+                var simpSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.SimpleSymbolDefinition;
+                var compSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.CompoundSymbolDefinition;
+#else
+                var simpSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.SimpleSymbolDefinition;
+                var compSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.CompoundSymbolDefinition;
+#endif
+                if (libId != null)
+                    return new SymbolInstanceLibrary() { ResourceId = libId };
+                else if (simpSym != null)
+                    return new SymbolInstanceInline() { SymbolDefinition = simpSym };
+                else if (compSym != null)
+                    return new SymbolInstanceInline() { SymbolDefinition = compSym };
+                return null;
+            }
+            set
+            {
+                var sr = value as ISymbolInstanceReferenceLibrary;
+                var ir = value as ISymbolInstanceReferenceInline;
+                if (sr != null)
+                {
+                    this.Item = sr.ResourceId;
+                }
+                else if (ir != null)
+                {
+#if LDF_110
+                    if (ir.SymbolDefinition.Type == SymbolDefinitionType.Simple)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition)ir.SymbolDefinition;
+                    else if (ir.SymbolDefinition.Type == SymbolDefinitionType.Compound)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.CompoundSymbolDefinition)ir.SymbolDefinition;
+#elif LDF_120 || LDF_130 || LDF_230
+                    if (ir.SymbolDefinition.Type == SymbolDefinitionType.Simple)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.SimpleSymbolDefinition)ir.SymbolDefinition;
+                    else if (ir.SymbolDefinition.Type == SymbolDefinitionType.Compound)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.CompoundSymbolDefinition)ir.SymbolDefinition;
+#else
+                    if (ir.SymbolDefinition.Type == SymbolDefinitionType.Simple)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.SimpleSymbolDefinition)ir.SymbolDefinition;
+                    else if (ir.SymbolDefinition.Type == SymbolDefinitionType.Compound)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.CompoundSymbolDefinition)ir.SymbolDefinition;
+#endif
+                }
+                this.Item = null;
+            }
+        }
+    }
+
+    partial class SymbolInstanceLibrary : ISymbolInstanceReferenceLibrary
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceId
+        {
+            get { return _resId; }
+            set
+            {
+                if (_resId == value) return;
+                _resId = value;
+                OnPropertyChanged("ResourceId"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public SymbolInstanceType Type
+        {
+            get { return SymbolInstanceType.Reference; }
+        }
+
+        public event PropertyChangedEventHandler PropertyChanged;
+
+        private void OnPropertyChanged(string name)
+        {
+            var handler = this.PropertyChanged;
+            if (handler != null)
+                handler(this, new PropertyChangedEventArgs(name));
+        }
+    }
+
+    partial class SymbolInstanceInline : ISymbolInstanceReferenceInline
+    {
+        [XmlIgnore]
+        public ISymbolDefinitionBase SymbolDefinition
+        {
+            get;
+            set;
+        }
+
+        [XmlIgnore]
+        public SymbolInstanceType Type
+        {
+            get { return SymbolInstanceType.Inline; }
+        }
+    }
+
+    partial class ParameterOverrides : IParameterOverrideCollection
+    {
+        [XmlIgnore]
+        IEnumerable<IParameterOverride> IParameterOverrideCollection.Override
+        {
+            get
+            {
+                foreach (var ov in this.Override)
+                {
+                    yield return ov;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public int Count
+        {
+            get { return this.Override.Count; }
+        }
+
+        [XmlIgnore]
+        public IParameterOverride this[int index]
+        {
+            get
+            {
+                if (index >= this.Override.Count)
+                    throw new ArgumentOutOfRangeException();
+
+                return this.Override[index];
+            }
+        }
+
+        public void AddOverride(IParameterOverride ov)
+        {
+            var o = ov as Override;
+            if (o != null)
+                this.Override.Add(o);
+        }
+
+        public void RemoveOverride(IParameterOverride ov)
+        {
+            var o = ov as Override;
+            if (o != null)
+                this.Override.Remove(o);
+        }
+
+        public IParameterOverride CreateParameterOverride(string symbol, string name)
+        {
+            return new Override()
+            {
+                ParameterIdentifier = name,
+                SymbolName = symbol
+            };
+        }
+    }
+
+    partial class Override : IParameterOverride
+    {
+    }
+
+    partial class CompositeTypeStyle : ICompositeTypeStyle
+#if LDF_130 || LDF_230 || LDF_240
+, ICompositeTypeStyle2
+#endif
+    {
+        [XmlIgnore]
+        string ICompositeTypeStyle.DisplayString
+        {
+            get
+            {
+                return Strings.CompositeStyleDisplayString;
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<ICompositeRule> ICompositeTypeStyle.CompositeRule
+        {
+            get
+            {
+                foreach (var cr in this.CompositeRule)
+                {
+                    yield return cr;
+                }
+            }
+        }
+
+        public void AddCompositeRule(ICompositeRule compRule)
+        {
+            var cr = compRule as CompositeRule;
+            if (cr != null)
+                this.CompositeRule.Add(cr);
+        }
+
+        public void RemoveCompositeRule(ICompositeRule compRule)
+        {
+            var cr = compRule as CompositeRule;
+            if (cr != null)
+                this.CompositeRule.Remove(cr);
+        }
+
+        [XmlIgnore]
+        public StyleType StyleType
+        {
+            get { return StyleType.Composite; }
+        }
+
+        [XmlIgnore]
+        public int RuleCount
+        {
+            get { return this.CompositeRule.Count; }
+        }
+
+    #region IRuleCollection<ICompositeRule> Members
+
+        public int IndexOfRule(ICompositeRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return this.CompositeRule.IndexOf(cr);
+            return -1;
+        }
+
+        public ICompositeRule GetRuleAt(int index)
+        {
+            return this.CompositeRule[index];
+        }
+
+        public bool MoveUp(ICompositeRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveUp(this.CompositeRule, cr);
+            return false;
+        }
+
+        public bool MoveDown(ICompositeRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveDown(this.CompositeRule, cr);
+            return false;
+        }
+
+    #endregion IRuleCollection<ICompositeRule> Members
+
+    #region IRuleCollection Members
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return this.CompositeRule.IndexOf(cr);
+            return -1;
+        }
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.CompositeRule[index];
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveUp(this.CompositeRule, cr);
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveDown(this.CompositeRule, cr);
+            return false;
+        }
+
+    #endregion IRuleCollection Members
+    }
+
+#endif
+
+    #endregion Composite Symbolization
+
+#if LDF_240
+
+    partial class URLDataType : IUrlData
+    {
+    }
+
+#endif
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_3_0/GridLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_3_0/GridLayerDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_3_0/GridLayerDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,737 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LDF_230
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LDF_110
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0
+#elif LDF_120
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0
+#elif LDF_130
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0
+#elif LDF_230
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0
+#elif LDF_240
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0
+#endif
+{
+    using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+    using System.Xml.Serialization;
+
+    partial class GridLayerDefinitionType : IRasterLayerDefinition
+    {
+        [XmlIgnore]
+        public override LayerType LayerType
+        {
+            get { return LayerType.Raster; }
+        }
+
+        [XmlIgnore]
+        string ISubLayerDefinition.ResourceId
+        {
+            get { return this.ResourceId; }
+            set { this.ResourceId = value; }
+        }
+
+        [XmlIgnore]
+        string IRasterLayerDefinition.FeatureName
+        {
+            get
+            {
+                return this.FeatureName;
+            }
+            set
+            {
+                this.FeatureName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IRasterLayerDefinition.Geometry
+        {
+            get
+            {
+                return this.Geometry;
+            }
+            set
+            {
+                this.Geometry = value;
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IGridScaleRange> IRasterLayerDefinition.GridScaleRange
+        {
+            get
+            {
+                foreach (var gsr in this.GridScaleRange)
+                {
+                    yield return gsr;
+                }
+            }
+        }
+
+        public void AddGridScaleRange(IGridScaleRange range)
+        {
+            var gsr = range as GridScaleRangeType;
+            if (gsr != null)
+            {
+                this.GridScaleRange.Add(gsr);
+            }
+        }
+
+        public void RemoveGridScaleRange(IGridScaleRange range)
+        {
+            var gsr = range as GridScaleRangeType;
+            if (gsr != null)
+            {
+                this.GridScaleRange.Remove(gsr);
+            }
+        }
+
+        public int IndexOfScaleRange(IGridScaleRange range)
+        {
+            var gsr = range as GridScaleRangeType;
+            if (gsr != null)
+            {
+                this.GridScaleRange.IndexOf(gsr);
+            }
+            return -1;
+        }
+
+        public IGridScaleRange GetScaleRangeAt(int index)
+        {
+            return this.GridScaleRange[index];
+        }
+
+        [XmlIgnore]
+        public int GridScaleRangeCount { get { return this.GridScaleRange.Count; } }
+    }
+
+    partial class ChannelBandType : IChannelBand
+    {
+        [XmlIgnore]
+        string IChannelBand.Band
+        {
+            get
+            {
+                return this.Band;
+            }
+            set
+            {
+                this.Band = value;
+            }
+        }
+
+        [XmlIgnore]
+        double? IChannelBand.LowBand
+        {
+            get
+            {
+                return this.LowBandSpecified ? new Nullable<double>(this.LowBand) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.LowBand = value.Value;
+                    this.LowBandSpecified = true;
+                }
+                else
+                {
+                    this.LowBandSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        double? IChannelBand.HighBand
+        {
+            get
+            {
+                return this.HighBandSpecified ? new Nullable<double>(this.HighBand) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.HighBand = value.Value;
+                    this.HighBandSpecified = true;
+                }
+                else
+                {
+                    this.HighBandSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        byte IChannelBand.LowChannel
+        {
+            get
+            {
+                return this.LowChannel;
+            }
+            set
+            {
+                this.LowChannel = value;
+            }
+        }
+
+        [XmlIgnore]
+        byte IChannelBand.HighChannel
+        {
+            get
+            {
+                return this.HighChannel;
+            }
+            set
+            {
+                this.HighChannel = value;
+            }
+        }
+    }
+
+    partial class GridColorBandsType : IGridColorBands
+    {
+        [XmlIgnore]
+        IChannelBand IGridColorBands.RedBand
+        {
+            get
+            {
+                return this.RedBand;
+            }
+            set
+            {
+                this.RedBand = (ChannelBandType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IChannelBand IGridColorBands.GreenBand
+        {
+            get
+            {
+                return this.GreenBand;
+            }
+            set
+            {
+                this.GreenBand = (ChannelBandType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IChannelBand IGridColorBands.BlueBand
+        {
+            get
+            {
+                return this.BlueBand;
+            }
+            set
+            {
+                this.BlueBand = (ChannelBandType)value;
+            }
+        }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal abstract class ExplicitColorBase : IExplicitColor
+    {
+        [XmlIgnore]
+        public abstract ItemChoiceType Type { get; }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal class ExplicitColorBand : ExplicitColorBase, IExplicitColorBand
+    {
+        [XmlIgnore]
+        public string Band { get; set; }
+
+        [XmlIgnore]
+        public override ItemChoiceType Type
+        {
+            get { return ItemChoiceType.Band; }
+        }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal class ExplicitColor : ExplicitColorBase, IExplictColorValue
+    {
+        [XmlIgnore]
+        public string Value { get; set; }
+
+        [XmlIgnore]
+        public override ItemChoiceType Type
+        {
+            get { return ItemChoiceType.ExplicitColor; }
+        }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal class ExplicitColorBands : ExplicitColorBase, IExplicitColorBands
+    {
+        [XmlIgnore]
+        public IGridColorBands Bands { get; set; }
+
+        [XmlIgnore]
+        public override ItemChoiceType Type
+        {
+            get { return ItemChoiceType.Bands; }
+        }
+    }
+
+    partial class GridColorType : IGridColor
+    {
+        [XmlIgnore]
+        IExplicitColor IGridColor.ExplicitColor
+        {
+            get
+            {
+                return ParseItem();
+            }
+            set
+            {
+                switch (this.ItemElementName)
+                {
+                    case ItemChoiceType.Band:
+                        this.Item = ((ExplicitColorBand)value).Band;
+                        break;
+
+                    case ItemChoiceType.Bands:
+                        this.Item = ((ExplicitColorBands)value).Bands;
+                        break;
+
+                    case ItemChoiceType.ExplicitColor:
+                        this.Item = ((ExplicitColor)value).Value;
+                        break;
+                }
+            }
+        }
+
+        private IExplicitColor ParseItem()
+        {
+            if (this.Item == null)
+                return null;
+
+            switch (this.ItemElementName)
+            {
+                case ItemChoiceType.Band:
+                    return new ExplicitColorBand() { Band = (string)this.Item };
+
+                case ItemChoiceType.Bands:
+                    return new ExplicitColorBands() { Bands = (IGridColorBands)this.Item };
+
+                case ItemChoiceType.ExplicitColor:
+                    return new ExplicitColor() { Value = (string)this.Item };
+            }
+
+            throw new Exception(); //Should never get here
+        }
+
+        public void SetValue(string htmlColor)
+        {
+            this.ItemElementName = ItemChoiceType.ExplicitColor;
+            this.Item = htmlColor;
+        }
+
+        public string GetValue()
+        {
+            if (this.Item != null && this.ItemElementName == ItemChoiceType.ExplicitColor)
+            {
+                return this.Item.ToString();
+            }
+            return null;
+        }
+    }
+
+    partial class GridColorRuleType : IGridColorRule
+    {
+        [XmlIgnore]
+        string IGridColorRule.LegendLabel
+        {
+            get
+            {
+                return this.LegendLabel;
+            }
+            set
+            {
+                this.LegendLabel = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IGridColorRule.Filter
+        {
+            get
+            {
+                return this.Filter;
+            }
+            set
+            {
+                this.Filter = value;
+            }
+        }
+
+        [XmlIgnore]
+        ITextSymbol IGridColorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IGridColor IGridColorRule.Color
+        {
+            get
+            {
+                return this.Color;
+            }
+            set
+            {
+                this.Color = (GridColorType)value;
+            }
+        }
+    }
+
+    partial class HillShadeType : IHillShade
+    {
+        [XmlIgnore]
+        string IHillShade.Band
+        {
+            get
+            {
+                return this.Band;
+            }
+            set
+            {
+                this.Band = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IHillShade.Azimuth
+        {
+            get
+            {
+                return this.Azimuth;
+            }
+            set
+            {
+                this.Azimuth = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IHillShade.Altitude
+        {
+            get
+            {
+                return this.Altitude;
+            }
+            set
+            {
+                this.Altitude = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IHillShade.ScaleFactor
+        {
+            get
+            {
+                return this.ScaleFactor;
+            }
+            set
+            {
+                this.ScaleFactor = value;
+            }
+        }
+    }
+
+    partial class GridColorStyleType : IGridColorStyle
+    {
+        [XmlIgnore]
+        IHillShade IGridColorStyle.HillShade
+        {
+            get
+            {
+                return this.HillShade;
+            }
+            set
+            {
+                this.HillShade = (HillShadeType)value;
+            }
+        }
+
+        [XmlIgnore]
+        string IGridColorStyle.TransparencyColor
+        {
+            get
+            {
+                return this.TransparencyColor == null ? string.Empty : this.TransparencyColor.ToString();
+            }
+            set
+            {
+                this.TransparencyColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        double? IGridColorStyle.BrightnessFactor
+        {
+            get
+            {
+                return this.BrightnessFactor;
+            }
+            set
+            {
+                this.BrightnessFactor = value.HasValue ? value.Value : default(double);
+            }
+        }
+
+        [XmlIgnore]
+        double? IGridColorStyle.ContrastFactor
+        {
+            get
+            {
+                return this.ContrastFactor;
+            }
+            set
+            {
+                this.ContrastFactor = value.HasValue ? value.Value : default(double);
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IGridColorRule> IGridColorStyle.ColorRule
+        {
+            get
+            {
+                foreach (var cr in this.ColorRule)
+                {
+                    yield return cr;
+                }
+            }
+        }
+
+        void IGridColorStyle.AddColorRule(IGridColorRule rule)
+        {
+            var cr = rule as GridColorRuleType;
+            if (cr != null)
+                this.ColorRule.Add((GridColorRuleType)cr);
+        }
+
+        void IGridColorStyle.RemoveColorRule(IGridColorRule rule)
+        {
+            var cr = rule as GridColorRuleType;
+            if (cr != null)
+                this.ColorRule.Remove((GridColorRuleType)cr);
+        }
+
+        [XmlIgnore]
+        public int ColorRuleCount
+        {
+            get { return this.ColorRule.Count; }
+        }
+
+        public IGridColorRule GetColorRuleAt(int index)
+        {
+            return this.ColorRule[index];
+        }
+
+        public IHillShade CreateHillShade()
+        {
+            return new HillShadeType();
+        }
+    }
+
+    partial class GridSurfaceStyleType : IGridSurfaceStyle
+    {
+        [XmlIgnore]
+        string IGridSurfaceStyle.Band
+        {
+            get
+            {
+                return this.Band;
+            }
+            set
+            {
+                this.Band = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IGridSurfaceStyle.ZeroValue
+        {
+            get
+            {
+                return this.ZeroValue;
+            }
+            set
+            {
+                this.ZeroValue = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IGridSurfaceStyle.ScaleFactor
+        {
+            get
+            {
+                return this.ScaleFactor;
+            }
+            set
+            {
+                this.ScaleFactor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IGridSurfaceStyle.DefaultColor
+        {
+            get
+            {
+                return this.DefaultColor;
+            }
+            set
+            {
+                this.DefaultColor = value;
+            }
+        }
+    }
+
+    partial class GridScaleRangeType : IGridScaleRange
+    {
+        [XmlIgnore]
+        double? IGridScaleRange.MinScale
+        {
+            get
+            {
+                return this.MinScale;
+            }
+            set
+            {
+                if (value.HasValue)
+                    this.MinScale = value.Value;
+            }
+        }
+
+        [XmlIgnore]
+        double? IGridScaleRange.MaxScale
+        {
+            get
+            {
+                return this.MaxScaleSpecified ? new Nullable<double>(this.MaxScale) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.MaxScale = value.Value;
+                    this.MaxScaleSpecified = true;
+                }
+                else
+                {
+                    this.MaxScaleSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        IGridSurfaceStyle IGridScaleRange.SurfaceStyle
+        {
+            get
+            {
+                return this.SurfaceStyle;
+            }
+            set
+            {
+                this.SurfaceStyle = (GridSurfaceStyleType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IGridColorStyle IGridScaleRange.ColorStyle
+        {
+            get
+            {
+                return this.ColorStyle;
+            }
+            set
+            {
+                this.ColorStyle = (GridColorStyleType)value;
+            }
+        }
+
+        [XmlIgnore]
+        double IGridScaleRange.RebuildFactor
+        {
+            get
+            {
+                return this.RebuildFactor;
+            }
+            set
+            {
+                this.RebuildFactor = value;
+            }
+        }
+
+        public IGridColorStyle CreateColorStyle()
+        {
+            return new GridColorStyleType()
+            {
+                ColorRule = new System.ComponentModel.BindingList<GridColorRuleType>(),
+                HillShade = new HillShadeType()
+            };
+        }
+
+        public IGridSurfaceStyle CreateSurfaceStyle()
+        {
+            return new GridSurfaceStyleType();
+        }
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_3_0/LayerElementFactoryImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_3_0/LayerElementFactoryImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_3_0/LayerElementFactoryImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,490 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LDF_230
+using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LDF_110
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0
+#elif LDF_120
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0
+#elif LDF_130
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0
+#elif LDF_230
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0
+#elif LDF_240
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0
+#endif
+{
+    /// <summary>
+    /// A publically accessible entry point primarily used for registration with the <see cref="ObjectFactory"/> and
+    /// <see cref="ResourceTypeRegistry"/> classes
+    /// </summary>
+    public static class LdfEntryPoint
+    {
+        public static ILayerDefinition CreateDefault(LayerType type)
+        {
+            return LayerDefinition.CreateDefault(type);
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            return LayerDefinition.Deserialize(xml);
+        }
+
+        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 ctss = vsr2.CompositeStyle;
+                        if (ctss != null)
+                        {
+                            foreach (var cts in ctss)
+                            {
+                                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();
+        }
+    }
+
+    partial class LayerDefinition : ILayerElementFactory
+    {
+        public static ILayerDefinition CreateDefault(LayerType type)
+        {
+            var lyr = new LayerDefinition();
+            switch (type)
+            {
+                case LayerType.Drawing:
+                    lyr.CreateDrawingLayer();
+                    break;
+
+                case LayerType.Raster:
+                    lyr.CreateRasterLayer();
+                    break;
+
+                case LayerType.Vector:
+                    lyr.CreateVectorLayer();
+                    break;
+            }
+            return lyr;
+        }
+
+        protected virtual VectorLayerDefinitionType CreateVectorLayerInstance()
+        {
+            return new VectorLayerDefinitionType();
+        }
+
+        protected virtual VectorScaleRangeType CreateVectorScaleRangeInstance()
+        {
+            return new VectorScaleRangeType()
+            {
+                Items = new System.ComponentModel.BindingList<object>(),
+                AreaStyle = CreateDefaultAreaStyle(),
+                LineStyle = CreateDefaultLineStyle(),
+                PointStyle = CreateDefaultPointStyle()
+            };
+        }
+
+        public void CreateVectorLayer()
+        {
+            var vl = this.CreateVectorLayerInstance();
+            /*
+            var vl = new VectorLayerDefinitionType()
+            {
+#if LDF_240
+                Watermarks = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_4_0.WatermarkType>()
+#elif LDF_230
+                Watermarks = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_3_0.WatermarkType>()
+#endif
+            };
+             */
+
+            //TODO: Create composite type style if 1.2 or 1.3 schema
+
+            vl.VectorScaleRange = new System.ComponentModel.BindingList<VectorScaleRangeType>();
+            var defaultRange = this.CreateVectorScaleRangeInstance();
+            /*
+            var defaultRange = new VectorScaleRangeType()
+            {
+                Items = new System.ComponentModel.BindingList<object>(),
+                AreaStyle = CreateDefaultAreaStyle(),
+                LineStyle = CreateDefaultLineStyle(),
+                PointStyle = CreateDefaultPointStyle(),
+#if LDF_100 || LDF_110
+#else
+                CompositeStyle = new ICompositeTypeStyle[] { CreateDefaultCompositeStyle() }
+#endif
+            };
+             */
+            vl.VectorScaleRange.Add(defaultRange);
+
+            this.Item = vl;
+        }
+
+        public void CreateRasterLayer()
+        {
+            var gl = new GridLayerDefinitionType()
+            {
+                GridScaleRange = new System.ComponentModel.BindingList<GridScaleRangeType>(),
+            };
+
+            gl.AddGridScaleRange(new GridScaleRangeType()
+            {
+                ColorStyle = new GridColorStyleType()
+                {
+                    ColorRule = new System.ComponentModel.BindingList<GridColorRuleType>()
+                    {
+                        new GridColorRuleType() {
+                            LegendLabel = string.Empty,
+                            Color = new GridColorType()
+                        },
+                        new GridColorRuleType() {
+                            LegendLabel = string.Empty,
+                            Color = new GridColorType()
+                        }
+                    }
+                },
+                RebuildFactor = 1.0
+            });
+
+            gl.GetScaleRangeAt(0).ColorStyle.GetColorRuleAt(0).Color.SetValue("000000"); //NOXLATE
+            gl.GetScaleRangeAt(0).ColorStyle.GetColorRuleAt(1).Color.SetValue("FFFFFF"); //NOXLATE
+
+            this.Item = gl;
+        }
+
+        public void CreateDrawingLayer()
+        {
+            this.Item = new DrawingLayerDefinitionType();
+        }
+
+        /// <summary>
+        /// Creates a fill
+        /// </summary>
+        /// <param name="pattern"></param>
+        /// <param name="background"></param>
+        /// <param name="foreground"></param>
+        /// <returns></returns>
+        public IFill CreateFill(string pattern, System.Drawing.Color background, System.Drawing.Color foreground)
+        {
+            return new FillType()
+            {
+                BackgroundColor = Utility.SerializeHTMLColor(background, true),
+                FillPattern = pattern,
+                ForegroundColor = Utility.SerializeHTMLColor(foreground, true)
+            };
+        }
+
+        /// <summary>
+        /// Creates a line stroke with default settings
+        /// </summary>
+        /// <param name="color"></param>
+        /// <returns></returns>
+        public IStroke CreateStroke(System.Drawing.Color color)
+        {
+            return new StrokeType()
+            {
+                Color = Utility.SerializeHTMLColor(color, true),
+                LineStyle = "Solid", //NOXLATE
+                Thickness = "1", //NOXLATE
+                Unit = LengthUnitType.Points
+            };
+        }
+
+        public IStroke CreateDefaultStroke()
+        {
+            return CreateStroke(Color.Black);
+        }
+
+        public IPointVectorStyle CreateDefaultPointStyle()
+        {
+            IPointVectorStyle pts = new PointTypeStyleType()
+            {
+                PointRule = new System.ComponentModel.BindingList<PointRuleType>()
+            };
+            pts.AddRule(CreateDefaultPointRule());
+            return pts;
+        }
+
+        public ILineVectorStyle CreateDefaultLineStyle()
+        {
+            ILineVectorStyle lts = new LineTypeStyleType()
+            {
+                LineRule = new System.ComponentModel.BindingList<LineRuleType>()
+            };
+            lts.AddRule(CreateDefaultLineRule());
+            return lts;
+        }
+
+        public IAreaVectorStyle CreateDefaultAreaStyle()
+        {
+            IAreaVectorStyle ats = new AreaTypeStyleType()
+            {
+                AreaRule = new System.ComponentModel.BindingList<AreaRuleType>()
+            };
+            ats.AddRule(CreateDefaultAreaRule());
+            return ats;
+        }
+
+        public IVectorScaleRange CreateVectorScaleRange()
+        {
+            return new VectorScaleRangeType()
+            {
+                Items = new System.ComponentModel.BindingList<object>(),
+                AreaStyle = CreateDefaultAreaStyle(),
+                LineStyle = CreateDefaultLineStyle(),
+                PointStyle = CreateDefaultPointStyle()
+            };
+        }
+
+        public IFill CreateDefaultFill()
+        {
+            return CreateFill("Solid", Color.White, Color.White); //NOXLATE
+        }
+
+        public IMarkSymbol CreateDefaultMarkSymbol()
+        {
+            IMarkSymbol sym = new MarkSymbolType()
+            {
+                SizeContext = SizeContextType.DeviceUnits,
+                MaintainAspect = true,
+                Shape = ShapeType.Square,
+                Rotation = "0", //NOXLATE
+                SizeX = "10", //NOXLATE
+                SizeY = "10", //NOXLATE
+                Unit = LengthUnitType.Points
+            };
+            sym.Edge = CreateDefaultStroke();
+            sym.Fill = CreateDefaultFill();
+            return sym;
+        }
+
+        public IFontSymbol CreateDefaultFontSymbol()
+        {
+            IFontSymbol sym = new FontSymbolType()
+            {
+                SizeContext = SizeContextType.DeviceUnits,
+                MaintainAspect = true,
+                FontName = "Arial", //NOXLATE
+                Rotation = "0", //NOXLATE
+                SizeX = "10", //NOXLATE
+                SizeY = "10", //NOXLATE
+                Unit = LengthUnitType.Points
+            };
+            sym.SetForegroundColor(Color.Black);
+            return sym;
+        }
+
+        public IPointSymbolization2D CreateDefaultPointSymbolization2D()
+        {
+            IPointSymbolization2D sym = new PointSymbolization2DType();
+            sym.Symbol = CreateDefaultMarkSymbol();
+            return sym;
+        }
+
+        public IPointRule CreateDefaultPointRule()
+        {
+            IPointRule pr = new PointRuleType()
+            {
+                LegendLabel = string.Empty
+            };
+            pr.PointSymbolization2D = CreateDefaultPointSymbolization2D();
+            return pr;
+        }
+
+        public IAreaRule CreateDefaultAreaRule()
+        {
+            IAreaRule ar = new AreaRuleType()
+            {
+                LegendLabel = string.Empty
+            };
+            ar.AreaSymbolization2D = CreateDefaultAreaSymbolizationFill();
+            return ar;
+        }
+
+        public IAreaSymbolizationFill CreateDefaultAreaSymbolizationFill()
+        {
+            IAreaSymbolizationFill fill = new AreaSymbolizationFillType();
+            fill.Fill = CreateDefaultFill();
+            fill.Stroke = CreateDefaultStroke();
+
+            return fill;
+        }
+
+        public ILineRule CreateDefaultLineRule()
+        {
+            ILineRule lr = new LineRuleType()
+            {
+                LegendLabel = "",
+                Items = new System.ComponentModel.BindingList<StrokeType>()
+            };
+            lr.AddStroke(CreateDefaultStroke());
+            return lr;
+        }
+
+        public IAdvancedPlacement CreateDefaultAdvancedPlacement(double scaleLimit)
+        {
+            return new TextSymbolTypeAdvancedPlacement() { ScaleLimit = scaleLimit };
+        }
+
+        public ITextSymbol CreateDefaultTextSymbol()
+        {
+            return new TextSymbolType()
+            {
+                AdvancedPlacement = null,
+                BackgroundColor = Utility.SerializeHTMLColor(Color.White, true),
+                BackgroundStyle = BackgroundStyleType.Transparent,
+                Bold = "false", //NOXLATE
+                FontName = "Arial", //NOXLATE
+                ForegroundColor = Utility.SerializeHTMLColor(Color.Black, true),
+                HorizontalAlignment = "'Center'", //NOXLATE
+                Italic = "false", //NOXLATE
+                Rotation = "0", //NOXLATE
+                SizeContext = SizeContextType.DeviceUnits,
+                SizeX = "10", //NOXLATE
+                SizeY = "10", //NOXLATE
+                Text = string.Empty,
+                Underlined = "false", //NOXLATE
+                Unit = LengthUnitType.Points,
+                VerticalAlignment = "'Baseline'" //NOXLATE
+            };
+        }
+
+        public IW2DSymbol CreateDefaultW2DSymbol(string symbolLibrary, string symbolName)
+        {
+            return new W2DSymbolType()
+            {
+                W2DSymbol = new W2DSymbolTypeW2DSymbol()
+                {
+                    ResourceId = symbolLibrary,
+                    LibraryItemName = symbolName
+                },
+            };
+        }
+
+        public virtual ICompositeRule CreateDefaultCompositeRule()
+        {
+#if LDF_100
+            throw new NotImplementedException();
+#else
+            return new CompositeRule()
+            {
+                LegendLabel = string.Empty,
+                CompositeSymbolization = new CompositeSymbolization()
+                {
+                    SymbolInstance = new System.ComponentModel.BindingList<SymbolInstance>()
+                }
+            };
+#endif
+        }
+
+        public virtual ICompositeTypeStyle CreateDefaultCompositeStyle()
+        {
+#if LDF_100
+            throw new NotImplementedException();
+#else
+            var cts = new CompositeTypeStyle()
+            {
+                CompositeRule = new System.ComponentModel.BindingList<CompositeRule>(),
+#if LDF_110 || LDF_120
+#else
+                ShowInLegend = true,
+#endif
+            };
+            cts.AddCompositeRule(CreateDefaultCompositeRule());
+            return cts;
+#endif
+        }
+
+        public virtual IUrlData CreateUrlData()
+        {
+#if LDF_240
+            return new URLDataType();
+#else
+            throw new NotImplementedException();
+#endif
+        }
+
+        public virtual ICompositeSymbolization CloneCompositeSymbolization(ICompositeSymbolization sym)
+        {
+#if LDF_100
+            throw new NotImplementedException();
+#else
+            var csym = (CompositeSymbolization)sym;
+            //Use quick and dirty XML in'n'out cloning to ensure no existing child references are
+            //carried over
+            var clone = CompositeSymbolization.Deserialize(csym.Serialize());
+            /*
+            foreach (var oldInst in csym.SymbolInstance)
+            {
+                System.Diagnostics.Debug.WriteLine("old symbol instance: {0}", oldInst.GetHashCode());
+            }
+            foreach (var newInst in clone.SymbolInstance)
+            {
+                System.Diagnostics.Debug.WriteLine("new symbol instance: {0}", newInst.GetHashCode());
+            }*/
+            return clone;
+#endif
+        }
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_3_0/VectorLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_3_0/VectorLayerDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_3_0/VectorLayerDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,2471 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LDF_230
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LDF_110
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0
+#elif LDF_120
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0
+#elif LDF_130
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0
+#elif LDF_230
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0
+#elif LDF_240
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0
+#endif
+{
+    using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+    using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
+    using OSGeo.MapGuide.ObjectModels.WatermarkDefinition;
+    using System.Xml.Serialization;
+
+    abstract partial class BaseLayerDefinitionType : ISubLayerDefinition
+#if LDF_230 || LDF_240
+, ISubLayerDefinition2
+#endif
+    {
+        [XmlIgnore]
+        public abstract LayerType LayerType { get; }
+
+#if LDF_230 || LDF_240
+
+        [XmlIgnore]
+        IEnumerable<IWatermark> IWatermarkCollection.Watermarks
+        {
+            get
+            {
+                foreach (var wm in this.Watermarks)
+                    yield return wm;
+            }
+        }
+
+        IWatermark IWatermarkCollection.AddWatermark(IWatermarkDefinition watermark)
+        {
+            return WatermarkCollectionUtil.AddWatermark(this.Watermarks, watermark);
+        }
+
+        void IWatermarkCollection.RemoveWatermark(IWatermark watermark)
+        {
+            WatermarkCollectionUtil.RemoveWatermark(this.Watermarks, watermark);
+        }
+
+        [XmlIgnore]
+        int IWatermarkCollection.WatermarkCount
+        {
+            get { return this.Watermarks.Count; }
+        }
+
+#endif
+    }
+
+    partial class NameStringPairType : INameStringPair
+    {
+        [XmlIgnore]
+        string INameStringPair.Name
+        {
+            get
+            {
+                return this.Name;
+            }
+            set
+            {
+                this.Name = value;
+            }
+        }
+
+        [XmlIgnore]
+        string INameStringPair.Value
+        {
+            get
+            {
+                return this.Value;
+            }
+            set
+            {
+                this.Value = value;
+            }
+        }
+    }
+
+    partial class VectorScaleRangeType : IVectorScaleRange
+#if !LDF_100
+, IVectorScaleRange2
+#endif
+    {
+        #region Missing generated stuff
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private bool minScaleFieldSpecified;
+
+        [System.Xml.Serialization.XmlIgnoreAttribute()]
+        public bool MinScaleSpecified
+        {
+            get
+            {
+                return this.minScaleFieldSpecified;
+            }
+            set
+            {
+                if ((minScaleFieldSpecified.Equals(value) != true))
+                {
+                    this.minScaleFieldSpecified = value;
+                    this.OnPropertyChanged("MinScaleSpecified"); //NOXLATE
+                }
+            }
+        }
+
+        #endregion Missing generated stuff
+
+        [XmlIgnore]
+        public IAreaVectorStyle AreaStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(IAreaVectorStyle).IsAssignableFrom(item.GetType()))
+                        return (IAreaVectorStyle)item;
+                }
+
+                return null;
+            }
+            set
+            {
+                //Remove old one if it exists
+                var item = this.AreaStyle;
+                if (item != null)
+                {
+                    this.itemsField.Remove(item);
+                }
+                //Put the new one in if it is not null
+                if (value != null)
+                {
+                    this.itemsField.Add(value);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public ILineVectorStyle LineStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ILineVectorStyle).IsAssignableFrom(item.GetType()))
+                        return (ILineVectorStyle)item;
+                }
+
+                return null;
+            }
+            set
+            {
+                //Remove old one if it exists
+                var item = this.LineStyle;
+                if (item != null)
+                {
+                    this.itemsField.Remove(item);
+                }
+                //Put the new one in if it is not null
+                if (value != null)
+                {
+                    this.itemsField.Add(value);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public IPointVectorStyle PointStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(IPointVectorStyle).IsAssignableFrom(item.GetType()))
+                        return (IPointVectorStyle)item;
+                }
+
+                return null;
+            }
+            set
+            {
+                //Remove old one if it exists
+                var item = this.PointStyle;
+                if (item != null)
+                {
+                    this.itemsField.Remove(item);
+                }
+                //Put the new one in if it is not null
+                if (value != null)
+                {
+                    this.itemsField.Add(value);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        double? IVectorScaleRange.MinScale
+        {
+            get
+            {
+                return this.MinScaleSpecified ? new Nullable<double>(this.MinScale) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.MinScaleSpecified = true;
+                    this.MinScale = value.Value;
+                }
+                else
+                {
+                    this.MinScaleSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        double? IVectorScaleRange.MaxScale
+        {
+            get
+            {
+                return this.MaxScaleSpecified ? new Nullable<double>(this.MaxScale) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.MaxScaleSpecified = true;
+                    this.MaxScale = value.Value;
+                }
+                else
+                {
+                    this.MaxScaleSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public IList<IVectorStyle> AllStyles
+        {
+            get { return (IList<IVectorStyle>)this.Items; }
+        }
+
+        IVectorScaleRange IVectorScaleRange.Clone()
+        {
+            return VectorScaleRangeType.Deserialize(this.Serialize());
+        }
+
+#if LDF_110 || LDF_120
+
+        [XmlIgnore]
+        public IEnumerable<ICompositeTypeStyle> CompositeStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                        yield return (ICompositeTypeStyle)item;
+                }
+            }
+            set
+            {
+                //Clear old ones
+                var remove = new List<object>();
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                        remove.Add(item);
+                }
+
+                foreach (var obj in remove)
+                {
+                    this.itemsField.Remove(obj);
+                }
+
+                //Put the new ones in if it is not null
+                if (value != null)
+                {
+                    foreach (var item in value)
+                    {
+                        if (!typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                            throw new InvalidOperationException(Strings.ErrorObjectNotICompositeTypeStyle);
+
+                        this.itemsField.Add(item);
+                    }
+                }
+            }
+        }
+
+#elif LDF_130 || LDF_230 || LDF_240
+
+        [XmlIgnore]
+        public IEnumerable<ICompositeTypeStyle> CompositeStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+                        yield return (ICompositeTypeStyle2)item;
+                }
+            }
+            set
+            {
+                //Clear old ones
+                var remove = new List<object>();
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+                        remove.Add(item);
+                }
+
+                foreach (var obj in remove)
+                {
+                    this.itemsField.Remove(obj);
+                }
+
+                //Put the new ones in if it is not null
+                if (value != null)
+                {
+                    foreach (var item in value)
+                    {
+                        if (!typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+                            throw new InvalidOperationException(Strings.ErrorObjectNotICompositeTypeStyle);
+
+                        this.itemsField.Add(item);
+                    }
+                }
+            }
+        }
+
+#endif
+
+#if LDF_100
+#else
+
+        IElevationSettings IVectorScaleRange2.ElevationSettings
+        {
+            get { return this.ElevationSettings; }
+            set { this.ElevationSettings = (ElevationSettingsType)value; }
+        }
+
+        IElevationSettings IVectorScaleRange2.Create(string zOffset, string zExtrusion, ElevationTypeType zOffsetType, LengthUnitType unit)
+        {
+            return new ElevationSettingsType()
+            {
+                ZOffset = zOffset,
+                ZOffsetType = zOffsetType,
+                ZExtrusion = zExtrusion,
+                Unit = unit
+            };
+        }
+
+        [XmlIgnore]
+        int IVectorScaleRange2.CompositeStyleCount
+        {
+            get
+            {
+                int count = 0;
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                        count++;
+                }
+                return count;
+            }
+        }
+
+#endif
+    }
+
+#if LDF_100
+#else
+
+    partial class ElevationSettingsType : IElevationSettings { }
+
+#endif
+
+#if LDF_100
+
+    partial class StrokeType : IStroke
+#else
+
+    partial class StrokeType : IStroke, IStroke2
+#endif
+    {
+        internal StrokeType()
+        {
+        }
+
+        IStroke ICloneableLayerElement<IStroke>.Clone()
+        {
+            return StrokeType.Deserialize(this.Serialize());
+        }
+
+#if LDF_100
+#else
+
+        IStroke2 ICloneableLayerElement<IStroke2>.Clone()
+        {
+            return StrokeType.Deserialize(this.Serialize());
+        }
+
+#endif
+    }
+
+    partial class FillType : IFill
+    {
+        internal FillType()
+        {
+        }
+
+        IFill ICloneableLayerElement<IFill>.Clone()
+        {
+            return FillType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class AreaTypeStyleType : IAreaVectorStyle
+#if LDF_130 || LDF_230 || LDF_240
+, IAreaVectorStyle2
+#endif
+    {
+        [XmlIgnore]
+        IEnumerable<IAreaRule> IAreaVectorStyle.Rules
+        {
+            get
+            {
+                foreach (var ar in this.AreaRule)
+                {
+                    yield return ar;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int IVectorStyle.RuleCount
+        {
+            get
+            {
+                if (this.AreaRule != null)
+                    return this.AreaRule.Count;
+                return 0;
+            }
+        }
+
+        void IAreaVectorStyle.RemoveAllRules()
+        {
+            this.AreaRule.Clear();
+        }
+
+        void IAreaVectorStyle.AddRule(IAreaRule rule)
+        {
+            var ar = rule as AreaRuleType;
+            if (ar != null)
+                this.AreaRule.Add(ar);
+        }
+
+        void IAreaVectorStyle.RemoveRule(IAreaRule rule)
+        {
+            var ar = rule as AreaRuleType;
+            if (ar != null)
+                this.AreaRule.Remove(ar);
+        }
+
+        [XmlIgnore]
+        StyleType IVectorStyle.StyleType
+        {
+            get { return StyleType.Area; }
+        }
+
+        #region IRuleCollection<IAreaRule> Members
+
+        public int IndexOfRule(IAreaRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+                return this.AreaRule.IndexOf(r);
+            return -1;
+        }
+
+        public IAreaRule GetRuleAt(int index)
+        {
+            return this.AreaRule[index];
+        }
+
+        public bool MoveUp(IAreaRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveUp(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        public bool MoveDown(IAreaRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveDown(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        #endregion IRuleCollection<IAreaRule> Members
+
+        #region IRuleCollection Members
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.AreaRule[index];
+        }
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+                return this.AreaRule.IndexOf(r);
+            return -1;
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveUp(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveDown(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        #endregion IRuleCollection Members
+    }
+
+    internal static class CollectionUtil
+    {
+        public static bool MoveUp<T>(IList<T> list, T obj)
+        {
+            var idx = list.IndexOf(obj);
+            if (idx == 0) //Already at top
+                return false;
+
+            var newIdx = idx - 1;
+            //Get object at index
+            var obj2 = list[newIdx];
+            //Swap them
+            list[idx] = obj2;
+            list[newIdx] = obj;
+
+            return true;
+        }
+
+        public static bool MoveDown<T>(IList<T> list, T obj)
+        {
+            var idx = list.IndexOf(obj);
+            if (idx == list.Count - 1) //Already at bottom
+                return false;
+
+            var newIdx = idx + 1;
+            //Get object at index
+            var obj2 = list[newIdx];
+            //Swap them
+            list[idx] = obj2;
+            list[newIdx] = obj;
+
+            return true;
+        }
+    }
+
+    partial class AreaRuleType : IAreaRule
+    {
+        [XmlIgnore]
+        IAreaSymbolizationFill IAreaRule.AreaSymbolization2D
+        {
+            get
+            {
+                return this.Item;
+            }
+            set
+            {
+                this.Item = (AreaSymbolizationFillType)value;
+            }
+        }
+
+        [XmlIgnore]
+        ITextSymbol IBasicVectorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+    }
+
+    partial class PointTypeStyleType : IPointVectorStyle
+#if LDF_130 || LDF_230 || LDF_240
+, IPointVectorStyle2
+#endif
+    {
+        [XmlIgnore]
+        public IEnumerable<IPointRule> Rules
+        {
+            get
+            {
+                foreach (var pr in this.PointRule)
+                {
+                    yield return pr;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int IVectorStyle.RuleCount
+        {
+            get
+            {
+                if (this.PointRule != null)
+                    return this.PointRule.Count;
+                return 0;
+            }
+        }
+
+        public void RemoveAllRules()
+        {
+            this.PointRule.Clear();
+        }
+
+        public void AddRule(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                this.PointRule.Add(pr);
+        }
+
+        public void RemoveRule(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                this.PointRule.Remove(pr);
+        }
+
+        [XmlIgnore]
+        public StyleType StyleType
+        {
+            get { return StyleType.Point; }
+        }
+
+        #region IRuleCollection<IPointRule> Members
+
+        public int IndexOfRule(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return this.PointRule.IndexOf(pr);
+            return -1;
+        }
+
+        public IPointRule GetRuleAt(int index)
+        {
+            return this.PointRule[index];
+        }
+
+        public bool MoveUp(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveUp(this.PointRule, pr);
+            return false;
+        }
+
+        public bool MoveDown(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveDown(this.PointRule, pr);
+            return false;
+        }
+
+        #endregion IRuleCollection<IPointRule> Members
+
+        #region IRuleCollection Members
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.PointRule[index];
+        }
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return this.PointRule.IndexOf(pr);
+            return -1;
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveUp(this.PointRule, pr);
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveDown(this.PointRule, pr);
+            return false;
+        }
+
+        #endregion IRuleCollection Members
+    }
+
+    partial class PointRuleType : IPointRule
+    {
+        [XmlIgnore]
+        ITextSymbol IBasicVectorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IPointSymbolization2D IPointRule.PointSymbolization2D
+        {
+            get { return this.Item; }
+            set { this.Item = (PointSymbolization2DType)value; }
+        }
+    }
+
+    partial class PointSymbolization2DType : IPointSymbolization2D
+    {
+        [XmlIgnore]
+        ISymbol IPointSymbolization2D.Symbol
+        {
+            get { return (ISymbol)this.Item; }
+            set { this.Item = (SymbolType)value; }
+        }
+
+        IPointSymbolization2D ICloneableLayerElement<IPointSymbolization2D>.Clone()
+        {
+            return PointSymbolization2DType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class LineTypeStyleType : ILineVectorStyle
+#if LDF_130 || LDF_230 || LDF_240
+, ILineVectorStyle2
+#endif
+    {
+        [XmlIgnore]
+        public IEnumerable<ILineRule> Rules
+        {
+            get
+            {
+                foreach (var lr in this.LineRule)
+                {
+                    yield return lr;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int IVectorStyle.RuleCount
+        {
+            get
+            {
+                if (this.LineRule != null)
+                    return this.LineRule.Count;
+                return 0;
+            }
+        }
+
+        public ILineRule GetRuleAt(int index)
+        {
+            return this.LineRule[index];
+        }
+
+        public void RemoveAllRules()
+        {
+            this.LineRule.Clear();
+        }
+
+        public void AddRule(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                this.LineRule.Add(lr);
+        }
+
+        public void RemoveRule(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                this.LineRule.Remove(lr);
+        }
+
+        [XmlIgnore]
+        public StyleType StyleType
+        {
+            get { return StyleType.Line; }
+        }
+
+        #region IRuleCollection<ILineRule> Members
+
+        public int IndexOfRule(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return this.LineRule.IndexOf(lr);
+            return -1;
+        }
+
+        public bool MoveUp(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveUp(this.LineRule, lr);
+            return false;
+        }
+
+        public bool MoveDown(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveDown(this.LineRule, lr);
+            return false;
+        }
+
+        #endregion IRuleCollection<ILineRule> Members
+
+        #region IRuleCollection Members
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.LineRule[index];
+        }
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return this.LineRule.IndexOf(lr);
+            return -1;
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveUp(this.LineRule, lr);
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveDown(this.LineRule, lr);
+            return false;
+        }
+
+        #endregion IRuleCollection Members
+    }
+
+    partial class LineRuleType : ILineRule
+    {
+        [XmlIgnore]
+        IEnumerable<IStroke> ILineRule.Strokes
+        {
+            get
+            {
+                foreach (var str in this.Items)
+                {
+                    yield return str;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int ILineRule.StrokeCount
+        {
+            get { return this.Items.Count; }
+        }
+
+        void ILineRule.SetStrokes(IEnumerable<IStroke> strokes)
+        {
+            Check.NotNull(strokes, "strokes"); //NOXLATE
+            this.Items.Clear();
+            foreach (var stroke in strokes)
+            {
+                var st = stroke as StrokeType;
+                if (st != null)
+                    this.Items.Add(st);
+            }
+        }
+
+        void ILineRule.AddStroke(IStroke stroke)
+        {
+            var st = stroke as StrokeType;
+            if (st != null)
+                this.Items.Add(st);
+        }
+
+        void ILineRule.RemoveStroke(IStroke stroke)
+        {
+            var st = stroke as StrokeType;
+            if (st != null)
+                this.Items.Remove(st);
+        }
+
+        [XmlIgnore]
+        ITextSymbol IBasicVectorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+    }
+
+    partial class TextSymbolType : ITextSymbol
+    {
+        [XmlIgnore]
+        IAdvancedPlacement ITextSymbol.AdvancedPlacement
+        {
+            get
+            {
+                return this.AdvancedPlacement;
+            }
+            set
+            {
+                this.AdvancedPlacement = (TextSymbolTypeAdvancedPlacement)value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Text
+        {
+            get
+            {
+                return this.Text;
+            }
+            set
+            {
+                this.Text = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.FontName
+        {
+            get
+            {
+                return this.FontName;
+            }
+            set
+            {
+                this.FontName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.ForegroundColor
+        {
+            get
+            {
+                return this.ForegroundColor;
+            }
+            set
+            {
+                this.ForegroundColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.BackgroundColor
+        {
+            get
+            {
+                return this.BackgroundColor;
+            }
+            set
+            {
+                this.BackgroundColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        BackgroundStyleType ITextSymbol.BackgroundStyle
+        {
+            get
+            {
+                return this.BackgroundStyle;
+            }
+            set
+            {
+                this.BackgroundStyle = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.HorizontalAlignment
+        {
+            get
+            {
+                return this.HorizontalAlignment;
+            }
+            set
+            {
+                this.HorizontalAlignment = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.VerticalAlignment
+        {
+            get
+            {
+                return this.VerticalAlignment;
+            }
+            set
+            {
+                this.VerticalAlignment = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Bold
+        {
+            get
+            {
+                return this.Bold;
+            }
+            set
+            {
+                this.Bold = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Italic
+        {
+            get
+            {
+                return this.Italic;
+            }
+            set
+            {
+                this.Italic = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Underlined
+        {
+            get
+            {
+                return this.Underlined;
+            }
+            set
+            {
+                this.Underlined = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Font; }
+        }
+
+        ITextSymbol ICloneableLayerElement<ITextSymbol>.Clone()
+        {
+            return TextSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class MarkSymbolType : IMarkSymbol
+    {
+        [XmlIgnore]
+        ShapeType IMarkSymbol.Shape
+        {
+            get
+            {
+                return this.Shape;
+            }
+            set
+            {
+                this.Shape = value;
+            }
+        }
+
+        [XmlIgnore]
+        IFill IMarkSymbol.Fill
+        {
+            get
+            {
+                return (IFill)this.Fill;
+            }
+            set
+            {
+                this.Fill = (FillType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IStroke IMarkSymbol.Edge
+        {
+            get
+            {
+                return (IStroke)this.Edge;
+            }
+            set
+            {
+                this.Edge = (StrokeType)value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Mark; }
+        }
+
+        IMarkSymbol ICloneableLayerElement<IMarkSymbol>.Clone()
+        {
+            return MarkSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    internal class ImageBinaryContainer : IInlineImageSymbol
+    {
+        [XmlIgnore]
+        public byte[] Content
+        {
+            get;
+            set;
+        }
+
+        [XmlIgnore]
+        public ImageSymbolReferenceType Type
+        {
+            get { return ImageSymbolReferenceType.Inline; }
+        }
+
+        IInlineImageSymbol ICloneableLayerElement<IInlineImageSymbol>.Clone()
+        {
+            byte[] array = null;
+            if (this.Content != null)
+            {
+                array = new byte[this.Content.Length];
+                Array.Copy(this.Content, array, this.Content.Length);
+            }
+            return new ImageBinaryContainer()
+            {
+                Content = array
+            };
+        }
+    }
+
+    partial class ImageSymbolType : IImageSymbol
+    {
+        [XmlIgnore]
+        IBaseImageSymbol IImageSymbol.Image
+        {
+            get
+            {
+                IBaseImageSymbol img = null;
+                if (this.Item == null)
+                    return null;
+
+                if (typeof(byte[]).IsAssignableFrom(this.Item.GetType()))
+                    img = new ImageBinaryContainer() { Content = (byte[])this.Item };
+                else
+                    img = (ISymbolReference)this.Item;
+                return img;
+            }
+            set
+            {
+                if (typeof(IInlineImageSymbol).IsAssignableFrom(value.GetType()))
+                    this.Item = ((IInlineImageSymbol)value).Content;
+                else
+                    this.Item = (ImageSymbolTypeImage)value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Image; }
+        }
+
+        IImageSymbol ICloneableLayerElement<IImageSymbol>.Clone()
+        {
+            return ImageSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    abstract partial class SymbolType : ISymbol
+    {
+        [XmlIgnore]
+        LengthUnitType ISymbol.Unit
+        {
+            get
+            {
+                return this.Unit;
+            }
+            set
+            {
+                this.Unit = value;
+            }
+        }
+
+        [XmlIgnore]
+        SizeContextType ISymbol.SizeContext
+        {
+            get
+            {
+                return this.SizeContext;
+            }
+            set
+            {
+                this.SizeContext = value;
+            }
+        }
+
+        [XmlIgnore]
+        bool ISymbol.MaintainAspect
+        {
+            get
+            {
+                return this.MaintainAspect;
+            }
+            set
+            {
+                this.MaintainAspect = true;
+            }
+        }
+
+        [XmlIgnore]
+        public abstract PointSymbolType Type { get; }
+
+        [XmlIgnore]
+        string ISymbol.InsertionPointY
+        {
+            get
+            {
+                return this.InsertionPointY.ToString();
+            }
+            set
+            {
+                this.InsertionPointY = Convert.ToDouble(value);
+            }
+        }
+    }
+
+    partial class FontSymbolType : IFontSymbol
+    {
+        [XmlIgnore]
+        string IFontSymbol.FontName
+        {
+            get
+            {
+                return this.FontName;
+            }
+            set
+            {
+                this.FontName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IFontSymbol.Character
+        {
+            get
+            {
+                return this.Character;
+            }
+            set
+            {
+                this.Character = value;
+            }
+        }
+
+        [XmlIgnore]
+        bool? IFontSymbol.Bold
+        {
+            get
+            {
+                return this.BoldSpecified ? new Nullable<bool>(this.Bold) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.Bold = value.Value;
+                    this.BoldSpecified = true;
+                }
+                else
+                {
+                    this.BoldSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        bool? IFontSymbol.Italic
+        {
+            get
+            {
+                return this.ItalicSpecified ? new Nullable<bool>(this.Italic) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.Italic = value.Value;
+                    this.ItalicSpecified = true;
+                }
+                else
+                {
+                    this.ItalicSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        bool? IFontSymbol.Underlined
+        {
+            get
+            {
+                return this.UnderlinedSpecified ? new Nullable<bool>(this.Underlined) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.Underlined = value.Value;
+                    this.UnderlinedSpecified = true;
+                }
+                else
+                {
+                    this.UnderlinedSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        string IFontSymbol.ForegroundColor
+        {
+            get
+            {
+                return this.ForegroundColor;
+            }
+            set
+            {
+                this.ForegroundColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Font; }
+        }
+
+        IFontSymbol ICloneableLayerElement<IFontSymbol>.Clone()
+        {
+            return FontSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class BlockSymbolType : IBlockSymbol
+    {
+        [XmlIgnore]
+        string IBlockSymbol.DrawingName
+        {
+            get
+            {
+                return this.DrawingName;
+            }
+            set
+            {
+                this.DrawingName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IBlockSymbol.BlockName
+        {
+            get
+            {
+                return this.BlockName;
+            }
+            set
+            {
+                this.BlockName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IBlockSymbol.BlockColor
+        {
+            get
+            {
+                return this.BlockColor;
+            }
+            set
+            {
+                this.BlockColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IBlockSymbol.LayerColor
+        {
+            get
+            {
+                return this.LayerColor;
+            }
+            set
+            {
+                this.LayerColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Block; }
+        }
+
+        IBlockSymbol ICloneableLayerElement<IBlockSymbol>.Clone()
+        {
+            return BlockSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class W2DSymbolType : IW2DSymbol
+    {
+        [XmlIgnore]
+        ISymbolReference IW2DSymbol.W2DSymbol
+        {
+            get
+            {
+                return (ISymbolReference)this.W2DSymbol;
+            }
+            set
+            {
+                this.W2DSymbol = (W2DSymbolTypeW2DSymbol)value;
+            }
+        }
+
+        [XmlIgnore]
+        string IW2DSymbol.FillColor
+        {
+            get
+            {
+                return this.FillColor;
+            }
+            set
+            {
+                this.FillColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IW2DSymbol.LineColor
+        {
+            get
+            {
+                return this.LineColor;
+            }
+            set
+            {
+                this.LineColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IW2DSymbol.TextColor
+        {
+            get
+            {
+                return this.TextColor;
+            }
+            set
+            {
+                this.TextColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.W2D; }
+        }
+
+        IW2DSymbol ICloneableLayerElement<IW2DSymbol>.Clone()
+        {
+            return W2DSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class W2DSymbolTypeW2DSymbol : ISymbolReference
+    {
+        [XmlIgnore]
+        ImageSymbolReferenceType IBaseImageSymbol.Type
+        {
+            get { return ImageSymbolReferenceType.SymbolReference; }
+        }
+
+        ISymbolReference ICloneableLayerElement<ISymbolReference>.Clone()
+        {
+            return W2DSymbolTypeW2DSymbol.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class ImageSymbolTypeImage : ISymbolReference
+    {
+        [XmlIgnore]
+        string ISymbolReference.ResourceId
+        {
+            get
+            {
+                return this.ResourceId == null ? string.Empty : this.ResourceId.ToString();
+            }
+            set
+            {
+                this.ResourceId = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ISymbolReference.LibraryItemName
+        {
+            get
+            {
+                return this.LibraryItemName == null ? string.Empty : this.LibraryItemName.ToString();
+            }
+            set
+            {
+                this.LibraryItemName = value;
+            }
+        }
+
+        [XmlIgnore]
+        ImageSymbolReferenceType IBaseImageSymbol.Type
+        {
+            get { return ImageSymbolReferenceType.SymbolReference; }
+        }
+
+        ISymbolReference ICloneableLayerElement<ISymbolReference>.Clone()
+        {
+            return ImageSymbolTypeImage.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class TextSymbolTypeAdvancedPlacement : IAdvancedPlacement
+    {
+    }
+
+    partial class AreaSymbolizationFillType : IAreaSymbolizationFill
+    {
+        [XmlIgnore]
+        IFill IAreaSymbolizationFill.Fill
+        {
+            get
+            {
+                return this.Fill;
+            }
+            set
+            {
+                this.Fill = (FillType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IStroke IAreaSymbolizationFill.Stroke
+        {
+            get
+            {
+                return this.Stroke;
+            }
+            set
+            {
+                this.Stroke = (StrokeType)value;
+            }
+        }
+
+        IAreaSymbolizationFill ICloneableLayerElement<IAreaSymbolizationFill>.Clone()
+        {
+            return AreaSymbolizationFillType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class LayerDefinition : ILayerDefinition
+    {
+        //internal LayerDefinition() { }
+
+#if LDF_110
+        private static readonly Version RES_VERSION = new Version(1, 1, 0);
+#elif LDF_120
+        private static readonly Version RES_VERSION = new Version(1, 2, 0);
+#elif LDF_130
+        private static readonly Version RES_VERSION = new Version(1, 3, 0);
+#elif LDF_230
+        private static readonly Version RES_VERSION = new Version(2, 3, 0);
+#elif LDF_240
+        private static readonly Version RES_VERSION = new Version(2, 4, 0);
+#else
+        private static readonly Version RES_VERSION = new Version(1, 0, 0);
+#endif
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.LayerDefinition.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.LayerDefinition));
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.LayerDefinition.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public virtual Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        object ICloneable.Clone()
+        {
+            return this.Clone();
+        }
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")] //NOXLATE
+        public string ValidatingSchema
+        {
+#if LDF_110
+            get { return "LayerDefinition-1.1.0.xsd"; } //NOXLATE
+#elif LDF_120
+            get { return "LayerDefinition-1.2.0.xsd"; } //NOXLATE
+#elif LDF_130
+            get { return "LayerDefinition-1.3.0.xsd"; } //NOXLATE
+#elif LDF_230
+            get { return "LayerDefinition-2.3.0.xsd"; } //NOXLATE
+#elif LDF_240
+            get { return "LayerDefinition-2.4.0.xsd"; } //NOXLATE
+#else
+            get { return ResourceTypes.LayerDefinition.ToString() + "-" + this.ResourceVersion.ToString() + ".xsd"; } //NOXLATE
+#endif
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        [XmlIgnore]
+        public ISubLayerDefinition SubLayer
+        {
+            get { return this.Item; }
+        }
+
+        public INameStringPair CreatePair(string name, string value)
+        {
+            return new NameStringPairType() { Name = name, Value = value };
+        }
+    }
+
+    partial class DrawingLayerDefinitionType : IDrawingLayerDefinition
+    {
+        [XmlIgnore]
+        public override LayerType LayerType
+        {
+            get { return LayerType.Drawing; }
+        }
+
+        [XmlIgnore]
+        string ISubLayerDefinition.ResourceId
+        {
+            get { return this.ResourceId; }
+            set { this.ResourceId = value; }
+        }
+    }
+
+    partial class VectorLayerDefinitionType : IVectorLayerDefinition
+#if LDF_240
+, IVectorLayerDefinition2
+#endif
+    {
+        [XmlIgnore]
+        public override LayerType LayerType
+        {
+            get { return LayerType.Vector; }
+        }
+
+        [XmlIgnore]
+        string ISubLayerDefinition.ResourceId
+        {
+            get { return this.ResourceId; }
+            set { this.ResourceId = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.FeatureName
+        {
+            get { return this.FeatureName; }
+            set { this.FeatureName = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.Geometry
+        {
+            get { return this.Geometry; }
+            set { this.Geometry = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.Url
+        {
+#if LDF_240
+            get
+            {
+                if (this.urlDataField == null)
+                    return string.Empty;
+                else
+                    return this.urlDataField.Content;
+            }
+            set
+            {
+                if (!string.IsNullOrEmpty(value))
+                {
+                    if (this.urlDataField == null)
+                        this.urlDataField = new URLDataType();
+                    this.urlDataField.Content = value;
+                    OnPropertyChanged("Url"); //NOXLATE
+                }
+                else
+                {
+                    //NOTE: None of the other URLData properties seem to be used atm
+                    //hence why we are nulling this
+                    this.urlDataField = null;
+                    OnPropertyChanged("Url"); //NOXLATE
+                }
+            }
+#else
+            get { return this.Url; }
+            set { this.Url = value; }
+#endif
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.ToolTip
+        {
+            get { return this.ToolTip; }
+            set { this.ToolTip = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.Filter
+        {
+            get { return this.Filter; }
+            set { this.Filter = value; }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IVectorScaleRange> IVectorLayerDefinition.VectorScaleRange
+        {
+            get
+            {
+                foreach (var vsr in this.VectorScaleRange)
+                {
+                    yield return vsr;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<INameStringPair> IVectorLayerDefinition.PropertyMapping
+        {
+            get
+            {
+                foreach (var pair in this.PropertyMapping)
+                {
+                    yield return pair;
+                }
+            }
+        }
+
+        INameStringPair IVectorLayerDefinition.GetPropertyMapping(string name)
+        {
+            foreach (var p in this.PropertyMapping)
+            {
+                if (p.Name == name)
+                    return p;
+            }
+            return null;
+        }
+
+        INameStringPair IVectorLayerDefinition.GetPropertyMappingAt(int index)
+        {
+            if (index < 0 || index >= this.PropertyMapping.Count)
+                throw new ArgumentOutOfRangeException();
+
+            var item = this.PropertyMapping[index];
+            return item;
+        }
+
+        void IVectorLayerDefinition.AddVectorScaleRange(IVectorScaleRange range)
+        {
+            var r = range as VectorScaleRangeType;
+            if (r != null)
+                this.VectorScaleRange.Add(r);
+        }
+
+        void IVectorLayerDefinition.RemoveVectorScaleRange(IVectorScaleRange range)
+        {
+            var r = range as VectorScaleRangeType;
+            if (r != null)
+                this.VectorScaleRange.Remove(r);
+        }
+
+        void IVectorLayerDefinition.AddPropertyMapping(INameStringPair pair)
+        {
+            var p = pair as NameStringPairType;
+            if (p != null)
+                this.PropertyMapping.Add(p);
+        }
+
+        void IVectorLayerDefinition.RemovePropertyMapping(INameStringPair pair)
+        {
+            var p = pair as NameStringPairType;
+            if (p != null)
+                this.PropertyMapping.Remove(p);
+        }
+
+        int IVectorLayerDefinition.GetPosition(INameStringPair pair)
+        {
+            var p = pair as NameStringPairType;
+            if (p != null)
+                return this.PropertyMapping.IndexOf(p);
+
+            return -1;
+        }
+
+        int IVectorLayerDefinition.MoveUp(INameStringPair pair)
+        {
+            int pos = ((IVectorLayerDefinition)this).GetPosition(pair);
+            if (pos > 0)
+            {
+                int dest = pos - 1;
+                var p = this.PropertyMapping[dest];
+                var p2 = (NameStringPairType)pair;
+
+                //Swap
+                this.PropertyMapping[dest] = p2;
+                this.PropertyMapping[pos] = p;
+
+                return dest;
+            }
+            return -1;
+        }
+
+        int IVectorLayerDefinition.MoveDown(INameStringPair pair)
+        {
+            int pos = ((IVectorLayerDefinition)this).GetPosition(pair);
+            if (pos < this.PropertyMapping.Count - 1)
+            {
+                int dest = pos + 1;
+                var p = this.PropertyMapping[dest];
+                var p2 = (NameStringPairType)pair;
+
+                //Swap
+                this.PropertyMapping[dest] = p2;
+                this.PropertyMapping[pos] = p;
+
+                return dest;
+            }
+            return -1;
+        }
+
+        void IVectorLayerDefinition.RemoveAllScaleRanges()
+        {
+            this.VectorScaleRange.Clear();
+        }
+
+        int IVectorLayerDefinition.IndexOfScaleRange(IVectorScaleRange range)
+        {
+            var r = range as VectorScaleRangeType;
+            if (r != null)
+                return this.VectorScaleRange.IndexOf(r);
+
+            return -1;
+        }
+
+        IVectorScaleRange IVectorLayerDefinition.GetScaleRangeAt(int index)
+        {
+            if (index >= this.VectorScaleRange.Count)
+                return null;
+
+            return this.VectorScaleRange[index];
+        }
+
+        [XmlIgnore]
+        Version IVectorLayerDefinition.SymbolDefinitionVersion
+        {
+            get
+            {
+#if LDF_110
+                return new Version(1, 0, 0);
+#elif LDF_120 || LDF_130 || LDF_230
+                return new Version(1, 1, 0);
+#elif LDF_240
+                return new Version(2, 4, 0);
+#else
+                return null;
+#endif
+            }
+        }
+
+#if LDF_240
+
+        [XmlIgnore]
+        IUrlData IVectorLayerDefinition2.UrlData
+        {
+            get
+            {
+                return this.UrlData;
+            }
+            set
+            {
+                this.UrlData = (URLDataType)value;
+            }
+        }
+
+#endif
+
+        void IVectorLayerDefinition.ClearPropertyMappings()
+        {
+            propertyMappingField.Clear();
+        }
+    }
+
+    #region Composite Symbolization
+
+#if !LDF_100
+
+    partial class CompositeRule : ICompositeRule
+    {
+        [XmlIgnore]
+        ICompositeSymbolization ICompositeRule.CompositeSymbolization
+        {
+            get
+            {
+                return this.CompositeSymbolization;
+            }
+            set
+            {
+                this.CompositeSymbolization = (CompositeSymbolization)value;
+            }
+        }
+    }
+
+    partial class CompositeSymbolization : ICompositeSymbolization
+    {
+        [XmlIgnore]
+        IEnumerable<ISymbolInstance> ICompositeSymbolization.SymbolInstance
+        {
+            get
+            {
+                foreach (var sym in this.SymbolInstance)
+                {
+                    yield return sym;
+                }
+            }
+        }
+
+        public string ToXml()
+        {
+            return this.Serialize();
+        }
+
+        public void UpdateFromXml(string xml)
+        {
+            var compsym = CompositeSymbolization.Deserialize(xml);
+            this.SymbolInstance.Clear();
+            foreach (var sym in compsym.SymbolInstance)
+            {
+                this.AddSymbolInstance(sym);
+            }
+        }
+
+        public void AddSymbolInstance(ISymbolInstance inst)
+        {
+            var sym = inst as SymbolInstance;
+            if (sym != null)
+                this.SymbolInstance.Add(sym);
+        }
+
+        public void RemoveSymbolInstance(ISymbolInstance inst)
+        {
+            var sym = inst as SymbolInstance;
+            if (sym != null)
+                this.SymbolInstance.Remove(sym);
+        }
+
+        public void RemoveAllSymbolInstances()
+        {
+            this.SymbolInstance.Clear();
+        }
+
+        public ISymbolInstance CreateSymbolReference(string resourceId)
+        {
+            return new SymbolInstance()
+            {
+                Item = resourceId,
+                ParameterOverrides = new ParameterOverrides()
+                {
+                    Override = new BindingList<Override>()
+                },
+            };
+        }
+
+        public ISymbolInstance CreateInlineSimpleSymbol(ISimpleSymbolDefinition symDef)
+        {
+            return new SymbolInstance()
+            {
+#if LDF_110
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition)symDef,
+#elif LDF_120 || LDF_130 || LDF_230
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.SimpleSymbolDefinition)symDef,
+#else
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_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.v1_0_0.CompoundSymbolDefinition)compDef,
+#elif LDF_120 || LDF_130 || LDF_230
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.CompoundSymbolDefinition)compDef,
+#else
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.CompoundSymbolDefinition)compDef,
+#endif
+                ParameterOverrides = new ParameterOverrides()
+                {
+                    Override = new BindingList<Override>()
+                }
+            };
+        }
+    }
+
+    partial class SymbolInstance : ISymbolInstance
+#if LDF_100 || LDF_110
+#else
+, ISymbolInstance2
+#endif
+    {
+        [XmlIgnore]
+        IParameterOverrideCollection ISymbolInstance.ParameterOverrides
+        {
+            get { return this.ParameterOverrides; }
+        }
+
+        [XmlIgnore]
+        public ISymbolInstanceReference Reference
+        {
+            get
+            {
+                var libId = this.Item as string;
+#if LDF_110
+                var simpSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition;
+                var compSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.CompoundSymbolDefinition;
+#elif LDF_120 || LDF_130 || LDF_230
+                var simpSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.SimpleSymbolDefinition;
+                var compSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.CompoundSymbolDefinition;
+#else
+                var simpSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.SimpleSymbolDefinition;
+                var compSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.CompoundSymbolDefinition;
+#endif
+                if (libId != null)
+                    return new SymbolInstanceLibrary() { ResourceId = libId };
+                else if (simpSym != null)
+                    return new SymbolInstanceInline() { SymbolDefinition = simpSym };
+                else if (compSym != null)
+                    return new SymbolInstanceInline() { SymbolDefinition = compSym };
+                return null;
+            }
+            set
+            {
+                var sr = value as ISymbolInstanceReferenceLibrary;
+                var ir = value as ISymbolInstanceReferenceInline;
+                if (sr != null)
+                {
+                    this.Item = sr.ResourceId;
+                }
+                else if (ir != null)
+                {
+#if LDF_110
+                    if (ir.SymbolDefinition.Type == SymbolDefinitionType.Simple)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition)ir.SymbolDefinition;
+                    else if (ir.SymbolDefinition.Type == SymbolDefinitionType.Compound)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.CompoundSymbolDefinition)ir.SymbolDefinition;
+#elif LDF_120 || LDF_130 || LDF_230
+                    if (ir.SymbolDefinition.Type == SymbolDefinitionType.Simple)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.SimpleSymbolDefinition)ir.SymbolDefinition;
+                    else if (ir.SymbolDefinition.Type == SymbolDefinitionType.Compound)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.CompoundSymbolDefinition)ir.SymbolDefinition;
+#else
+                    if (ir.SymbolDefinition.Type == SymbolDefinitionType.Simple)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.SimpleSymbolDefinition)ir.SymbolDefinition;
+                    else if (ir.SymbolDefinition.Type == SymbolDefinitionType.Compound)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.CompoundSymbolDefinition)ir.SymbolDefinition;
+#endif
+                }
+                this.Item = null;
+            }
+        }
+    }
+
+    partial class SymbolInstanceLibrary : ISymbolInstanceReferenceLibrary
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceId
+        {
+            get { return _resId; }
+            set
+            {
+                if (_resId == value) return;
+                _resId = value;
+                OnPropertyChanged("ResourceId"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public SymbolInstanceType Type
+        {
+            get { return SymbolInstanceType.Reference; }
+        }
+
+        public event PropertyChangedEventHandler PropertyChanged;
+
+        private void OnPropertyChanged(string name)
+        {
+            var handler = this.PropertyChanged;
+            if (handler != null)
+                handler(this, new PropertyChangedEventArgs(name));
+        }
+    }
+
+    partial class SymbolInstanceInline : ISymbolInstanceReferenceInline
+    {
+        [XmlIgnore]
+        public ISymbolDefinitionBase SymbolDefinition
+        {
+            get;
+            set;
+        }
+
+        [XmlIgnore]
+        public SymbolInstanceType Type
+        {
+            get { return SymbolInstanceType.Inline; }
+        }
+    }
+
+    partial class ParameterOverrides : IParameterOverrideCollection
+    {
+        [XmlIgnore]
+        IEnumerable<IParameterOverride> IParameterOverrideCollection.Override
+        {
+            get
+            {
+                foreach (var ov in this.Override)
+                {
+                    yield return ov;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public int Count
+        {
+            get { return this.Override.Count; }
+        }
+
+        [XmlIgnore]
+        public IParameterOverride this[int index]
+        {
+            get
+            {
+                if (index >= this.Override.Count)
+                    throw new ArgumentOutOfRangeException();
+
+                return this.Override[index];
+            }
+        }
+
+        public void AddOverride(IParameterOverride ov)
+        {
+            var o = ov as Override;
+            if (o != null)
+                this.Override.Add(o);
+        }
+
+        public void RemoveOverride(IParameterOverride ov)
+        {
+            var o = ov as Override;
+            if (o != null)
+                this.Override.Remove(o);
+        }
+
+        public IParameterOverride CreateParameterOverride(string symbol, string name)
+        {
+            return new Override()
+            {
+                ParameterIdentifier = name,
+                SymbolName = symbol
+            };
+        }
+    }
+
+    partial class Override : IParameterOverride
+    {
+    }
+
+    partial class CompositeTypeStyle : ICompositeTypeStyle
+#if LDF_130 || LDF_230 || LDF_240
+, ICompositeTypeStyle2
+#endif
+    {
+        [XmlIgnore]
+        string ICompositeTypeStyle.DisplayString
+        {
+            get
+            {
+                return Strings.CompositeStyleDisplayString;
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<ICompositeRule> ICompositeTypeStyle.CompositeRule
+        {
+            get
+            {
+                foreach (var cr in this.CompositeRule)
+                {
+                    yield return cr;
+                }
+            }
+        }
+
+        public void AddCompositeRule(ICompositeRule compRule)
+        {
+            var cr = compRule as CompositeRule;
+            if (cr != null)
+                this.CompositeRule.Add(cr);
+        }
+
+        public void RemoveCompositeRule(ICompositeRule compRule)
+        {
+            var cr = compRule as CompositeRule;
+            if (cr != null)
+                this.CompositeRule.Remove(cr);
+        }
+
+        [XmlIgnore]
+        public StyleType StyleType
+        {
+            get { return StyleType.Composite; }
+        }
+
+        [XmlIgnore]
+        public int RuleCount
+        {
+            get { return this.CompositeRule.Count; }
+        }
+
+    #region IRuleCollection<ICompositeRule> Members
+
+        public int IndexOfRule(ICompositeRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return this.CompositeRule.IndexOf(cr);
+            return -1;
+        }
+
+        public ICompositeRule GetRuleAt(int index)
+        {
+            return this.CompositeRule[index];
+        }
+
+        public bool MoveUp(ICompositeRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveUp(this.CompositeRule, cr);
+            return false;
+        }
+
+        public bool MoveDown(ICompositeRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveDown(this.CompositeRule, cr);
+            return false;
+        }
+
+    #endregion IRuleCollection<ICompositeRule> Members
+
+    #region IRuleCollection Members
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return this.CompositeRule.IndexOf(cr);
+            return -1;
+        }
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.CompositeRule[index];
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveUp(this.CompositeRule, cr);
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveDown(this.CompositeRule, cr);
+            return false;
+        }
+
+    #endregion IRuleCollection Members
+    }
+
+#endif
+
+    #endregion Composite Symbolization
+
+#if LDF_240
+
+    partial class URLDataType : IUrlData
+    {
+    }
+
+#endif
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_4_0/GridLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_4_0/GridLayerDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_4_0/GridLayerDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,738 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LDF_240
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LDF_110
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0
+#elif LDF_120
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0
+#elif LDF_130
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0
+#elif LDF_230
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0
+#elif LDF_240
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0
+#endif
+{
+    using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+    using System.Xml.Serialization;
+
+    partial class GridLayerDefinitionType : IRasterLayerDefinition
+    {
+        [XmlIgnore]
+        public override LayerType LayerType
+        {
+            get { return LayerType.Raster; }
+        }
+
+        [XmlIgnore]
+        string ISubLayerDefinition.ResourceId
+        {
+            get { return this.ResourceId; }
+            set { this.ResourceId = value; }
+        }
+
+        [XmlIgnore]
+        string IRasterLayerDefinition.FeatureName
+        {
+            get
+            {
+                return this.FeatureName;
+            }
+            set
+            {
+                this.FeatureName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IRasterLayerDefinition.Geometry
+        {
+            get
+            {
+                return this.Geometry;
+            }
+            set
+            {
+                this.Geometry = value;
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IGridScaleRange> IRasterLayerDefinition.GridScaleRange
+        {
+            get
+            {
+                foreach (var gsr in this.GridScaleRange)
+                {
+                    yield return gsr;
+                }
+            }
+        }
+
+        public void AddGridScaleRange(IGridScaleRange range)
+        {
+            var gsr = range as GridScaleRangeType;
+            if (gsr != null)
+            {
+                this.GridScaleRange.Add(gsr);
+            }
+        }
+
+        public void RemoveGridScaleRange(IGridScaleRange range)
+        {
+            var gsr = range as GridScaleRangeType;
+            if (gsr != null)
+            {
+                this.GridScaleRange.Remove(gsr);
+            }
+        }
+
+        public int IndexOfScaleRange(IGridScaleRange range)
+        {
+            var gsr = range as GridScaleRangeType;
+            if (gsr != null)
+            {
+                this.GridScaleRange.IndexOf(gsr);
+            }
+            return -1;
+        }
+
+        public IGridScaleRange GetScaleRangeAt(int index)
+        {
+            return this.GridScaleRange[index];
+        }
+
+        [XmlIgnore]
+        public int GridScaleRangeCount { get { return this.GridScaleRange.Count; } }
+    }
+
+    partial class ChannelBandType : IChannelBand
+    {
+        [XmlIgnore]
+        string IChannelBand.Band
+        {
+            get
+            {
+                return this.Band;
+            }
+            set
+            {
+                this.Band = value;
+            }
+        }
+
+        [XmlIgnore]
+        double? IChannelBand.LowBand
+        {
+            get
+            {
+                return this.LowBandSpecified ? new Nullable<double>(this.LowBand) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.LowBand = value.Value;
+                    this.LowBandSpecified = true;
+                }
+                else
+                {
+                    this.LowBandSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        double? IChannelBand.HighBand
+        {
+            get
+            {
+                return this.HighBandSpecified ? new Nullable<double>(this.HighBand) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.HighBand = value.Value;
+                    this.HighBandSpecified = true;
+                }
+                else
+                {
+                    this.HighBandSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        byte IChannelBand.LowChannel
+        {
+            get
+            {
+                return this.LowChannel;
+            }
+            set
+            {
+                this.LowChannel = value;
+            }
+        }
+
+        [XmlIgnore]
+        byte IChannelBand.HighChannel
+        {
+            get
+            {
+                return this.HighChannel;
+            }
+            set
+            {
+                this.HighChannel = value;
+            }
+        }
+    }
+
+    partial class GridColorBandsType : IGridColorBands
+    {
+        [XmlIgnore]
+        IChannelBand IGridColorBands.RedBand
+        {
+            get
+            {
+                return this.RedBand;
+            }
+            set
+            {
+                this.RedBand = (ChannelBandType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IChannelBand IGridColorBands.GreenBand
+        {
+            get
+            {
+                return this.GreenBand;
+            }
+            set
+            {
+                this.GreenBand = (ChannelBandType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IChannelBand IGridColorBands.BlueBand
+        {
+            get
+            {
+                return this.BlueBand;
+            }
+            set
+            {
+                this.BlueBand = (ChannelBandType)value;
+            }
+        }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal abstract class ExplicitColorBase : IExplicitColor
+    {
+        [XmlIgnore]
+        public abstract ItemChoiceType Type { get; }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal class ExplicitColorBand : ExplicitColorBase, IExplicitColorBand
+    {
+        [XmlIgnore]
+        public string Band { get; set; }
+
+        [XmlIgnore]
+        public override ItemChoiceType Type
+        {
+            get { return ItemChoiceType.Band; }
+        }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal class ExplicitColor : ExplicitColorBase, IExplictColorValue
+    {
+        [XmlIgnore]
+        public string Value { get; set; }
+
+        [XmlIgnore]
+        public override ItemChoiceType Type
+        {
+            get { return ItemChoiceType.ExplicitColor; }
+        }
+    }
+
+    //Class that addresses the shoddy impedence mismatch between the xsd
+    //and the generated code
+    internal class ExplicitColorBands : ExplicitColorBase, IExplicitColorBands
+    {
+        [XmlIgnore]
+        public IGridColorBands Bands { get; set; }
+
+        [XmlIgnore]
+        public override ItemChoiceType Type
+        {
+            get { return ItemChoiceType.Bands; }
+        }
+    }
+
+    partial class GridColorType : IGridColor
+    {
+        [XmlIgnore]
+        IExplicitColor IGridColor.ExplicitColor
+        {
+            get
+            {
+                return ParseItem();
+            }
+            set
+            {
+                switch (this.ItemElementName)
+                {
+                    case ItemChoiceType.Band:
+                        this.Item = ((ExplicitColorBand)value).Band;
+                        break;
+
+                    case ItemChoiceType.Bands:
+                        this.Item = ((ExplicitColorBands)value).Bands;
+                        break;
+
+                    case ItemChoiceType.ExplicitColor:
+                        this.Item = ((ExplicitColor)value).Value;
+                        break;
+                }
+            }
+        }
+
+        private IExplicitColor ParseItem()
+        {
+            if (this.Item == null)
+                return null;
+
+            switch (this.ItemElementName)
+            {
+                case ItemChoiceType.Band:
+                    return new ExplicitColorBand() { Band = (string)this.Item };
+
+                case ItemChoiceType.Bands:
+                    return new ExplicitColorBands() { Bands = (IGridColorBands)this.Item };
+
+                case ItemChoiceType.ExplicitColor:
+                    return new ExplicitColor() { Value = (string)this.Item };
+            }
+
+            throw new Exception(); //Should never get here
+        }
+
+        public void SetValue(string htmlColor)
+        {
+            this.ItemElementName = ItemChoiceType.ExplicitColor;
+            this.Item = htmlColor;
+        }
+
+        public string GetValue()
+        {
+            if (this.Item != null && this.ItemElementName == ItemChoiceType.ExplicitColor)
+            {
+                return this.Item.ToString();
+            }
+            return null;
+        }
+    }
+
+    partial class GridColorRuleType : IGridColorRule
+    {
+        [XmlIgnore]
+        string IGridColorRule.LegendLabel
+        {
+            get
+            {
+                return this.LegendLabel;
+            }
+            set
+            {
+                this.LegendLabel = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IGridColorRule.Filter
+        {
+            get
+            {
+                return this.Filter;
+            }
+            set
+            {
+                this.Filter = value;
+            }
+        }
+
+        [XmlIgnore]
+        ITextSymbol IGridColorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IGridColor IGridColorRule.Color
+        {
+            get
+            {
+                return this.Color;
+            }
+            set
+            {
+                this.Color = (GridColorType)value;
+            }
+        }
+    }
+
+    partial class HillShadeType : IHillShade
+    {
+        [XmlIgnore]
+        string IHillShade.Band
+        {
+            get
+            {
+                return this.Band;
+            }
+            set
+            {
+                this.Band = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IHillShade.Azimuth
+        {
+            get
+            {
+                return this.Azimuth;
+            }
+            set
+            {
+                this.Azimuth = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IHillShade.Altitude
+        {
+            get
+            {
+                return this.Altitude;
+            }
+            set
+            {
+                this.Altitude = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IHillShade.ScaleFactor
+        {
+            get
+            {
+                return this.ScaleFactor;
+            }
+            set
+            {
+                this.ScaleFactor = value;
+            }
+        }
+    }
+
+    partial class GridColorStyleType : IGridColorStyle
+    {
+        [XmlIgnore]
+        IHillShade IGridColorStyle.HillShade
+        {
+            get
+            {
+                return this.HillShade;
+            }
+            set
+            {
+                this.HillShade = (HillShadeType)value;
+            }
+        }
+
+        [XmlIgnore]
+        string IGridColorStyle.TransparencyColor
+        {
+            get
+            {
+                return this.TransparencyColor == null ? string.Empty : this.TransparencyColor.ToString();
+            }
+            set
+            {
+                this.TransparencyColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        double? IGridColorStyle.BrightnessFactor
+        {
+            get
+            {
+                return this.BrightnessFactor;
+            }
+            set
+            {
+                this.BrightnessFactor = value.HasValue ? value.Value : default(double);
+            }
+        }
+
+        [XmlIgnore]
+        double? IGridColorStyle.ContrastFactor
+        {
+            get
+            {
+                return this.ContrastFactor;
+            }
+            set
+            {
+                this.ContrastFactor = value.HasValue ? value.Value : default(double);
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IGridColorRule> IGridColorStyle.ColorRule
+        {
+            get
+            {
+                foreach (var cr in this.ColorRule)
+                {
+                    yield return cr;
+                }
+            }
+        }
+
+        void IGridColorStyle.AddColorRule(IGridColorRule rule)
+        {
+            var cr = rule as GridColorRuleType;
+            if (cr != null)
+                this.ColorRule.Add((GridColorRuleType)cr);
+        }
+
+        void IGridColorStyle.RemoveColorRule(IGridColorRule rule)
+        {
+            var cr = rule as GridColorRuleType;
+            if (cr != null)
+                this.ColorRule.Remove((GridColorRuleType)cr);
+        }
+
+        [XmlIgnore]
+        public int ColorRuleCount
+        {
+            get { return this.ColorRule.Count; }
+        }
+
+        public IGridColorRule GetColorRuleAt(int index)
+        {
+            return this.ColorRule[index];
+        }
+
+        public IHillShade CreateHillShade()
+        {
+            return new HillShadeType();
+        }
+    }
+
+    partial class GridSurfaceStyleType : IGridSurfaceStyle
+    {
+        [XmlIgnore]
+        string IGridSurfaceStyle.Band
+        {
+            get
+            {
+                return this.Band;
+            }
+            set
+            {
+                this.Band = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IGridSurfaceStyle.ZeroValue
+        {
+            get
+            {
+                return this.ZeroValue;
+            }
+            set
+            {
+                this.ZeroValue = value;
+            }
+        }
+
+        [XmlIgnore]
+        double IGridSurfaceStyle.ScaleFactor
+        {
+            get
+            {
+                return this.ScaleFactor;
+            }
+            set
+            {
+                this.ScaleFactor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IGridSurfaceStyle.DefaultColor
+        {
+            get
+            {
+                return this.DefaultColor;
+            }
+            set
+            {
+                this.DefaultColor = value;
+            }
+        }
+    }
+
+    partial class GridScaleRangeType : IGridScaleRange
+    {
+        [XmlIgnore]
+        double? IGridScaleRange.MinScale
+        {
+            get
+            {
+                return this.MinScale;
+            }
+            set
+            {
+                if (value.HasValue)
+                    this.MinScale = value.Value;
+            }
+        }
+
+        [XmlIgnore]
+        double? IGridScaleRange.MaxScale
+        {
+            get
+            {
+                return this.MaxScaleSpecified ? new Nullable<double>(this.MaxScale) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.MaxScale = value.Value;
+                    this.MaxScaleSpecified = true;
+                }
+                else
+                {
+                    this.MaxScaleSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        IGridSurfaceStyle IGridScaleRange.SurfaceStyle
+        {
+            get
+            {
+                return this.SurfaceStyle;
+            }
+            set
+            {
+                this.SurfaceStyle = (GridSurfaceStyleType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IGridColorStyle IGridScaleRange.ColorStyle
+        {
+            get
+            {
+                return this.ColorStyle;
+            }
+            set
+            {
+                this.ColorStyle = (GridColorStyleType)value;
+            }
+        }
+
+        [XmlIgnore]
+        double IGridScaleRange.RebuildFactor
+        {
+            get
+            {
+                return this.RebuildFactor;
+            }
+            set
+            {
+                this.RebuildFactor = value;
+            }
+        }
+
+        public IGridColorStyle CreateColorStyle()
+        {
+            return new GridColorStyleType()
+            {
+                ColorRule = new System.ComponentModel.BindingList<GridColorRuleType>(),
+                HillShade = new HillShadeType()
+            };
+        }
+
+        public IGridSurfaceStyle CreateSurfaceStyle()
+        {
+            return new GridSurfaceStyleType();
+        }
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_4_0/LayerElementFactoryImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_4_0/LayerElementFactoryImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_4_0/LayerElementFactoryImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,491 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LDF_240
+using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LDF_110
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0
+#elif LDF_120
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0
+#elif LDF_130
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0
+#elif LDF_230
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0
+#elif LDF_240
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0
+#endif
+{
+    /// <summary>
+    /// A publically accessible entry point primarily used for registration with the <see cref="ObjectFactory"/> and
+    /// <see cref="ResourceTypeRegistry"/> classes
+    /// </summary>
+    public static class LdfEntryPoint
+    {
+        public static ILayerDefinition CreateDefault(LayerType type)
+        {
+            return LayerDefinition.CreateDefault(type);
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            return LayerDefinition.Deserialize(xml);
+        }
+
+        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 ctss = vsr2.CompositeStyle;
+                        if (ctss != null)
+                        {
+                            foreach (var cts in ctss)
+                            {
+                                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();
+        }
+    }
+
+    partial class LayerDefinition : ILayerElementFactory
+    {
+        public static ILayerDefinition CreateDefault(LayerType type)
+        {
+            var lyr = new LayerDefinition();
+            switch (type)
+            {
+                case LayerType.Drawing:
+                    lyr.CreateDrawingLayer();
+                    break;
+
+                case LayerType.Raster:
+                    lyr.CreateRasterLayer();
+                    break;
+
+                case LayerType.Vector:
+                    lyr.CreateVectorLayer();
+                    break;
+            }
+            return lyr;
+        }
+
+        protected virtual VectorLayerDefinitionType CreateVectorLayerInstance()
+        {
+            return new VectorLayerDefinitionType();
+        }
+
+        protected virtual VectorScaleRangeType CreateVectorScaleRangeInstance()
+        {
+            return new VectorScaleRangeType()
+            {
+                Items = new System.ComponentModel.BindingList<object>(),
+                AreaStyle = CreateDefaultAreaStyle(),
+                LineStyle = CreateDefaultLineStyle(),
+                PointStyle = CreateDefaultPointStyle()
+            };
+        }
+
+        public void CreateVectorLayer()
+        {
+            var vl = this.CreateVectorLayerInstance();
+            /*
+            var vl = new VectorLayerDefinitionType()
+            {
+#if LDF_240
+                Watermarks = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_4_0.WatermarkType>()
+#elif LDF_230
+                Watermarks = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_3_0.WatermarkType>()
+#endif
+            };
+             */
+
+            //TODO: Create composite type style if 1.2 or 1.3 schema
+
+            vl.VectorScaleRange = new System.ComponentModel.BindingList<VectorScaleRangeType>();
+            var defaultRange = this.CreateVectorScaleRangeInstance();
+            /*
+            var defaultRange = new VectorScaleRangeType()
+            {
+                Items = new System.ComponentModel.BindingList<object>(),
+                AreaStyle = CreateDefaultAreaStyle(),
+                LineStyle = CreateDefaultLineStyle(),
+                PointStyle = CreateDefaultPointStyle(),
+#if LDF_100 || LDF_110
+#else
+                CompositeStyle = new ICompositeTypeStyle[] { CreateDefaultCompositeStyle() }
+#endif
+            };
+             */
+            vl.VectorScaleRange.Add(defaultRange);
+
+            this.Item = vl;
+        }
+
+        public void CreateRasterLayer()
+        {
+            var gl = new GridLayerDefinitionType()
+            {
+                GridScaleRange = new System.ComponentModel.BindingList<GridScaleRangeType>(),
+            };
+
+            gl.AddGridScaleRange(new GridScaleRangeType()
+            {
+                ColorStyle = new GridColorStyleType()
+                {
+                    ColorRule = new System.ComponentModel.BindingList<GridColorRuleType>()
+                    {
+                        new GridColorRuleType() {
+                            LegendLabel = string.Empty,
+                            Color = new GridColorType()
+                        },
+                        new GridColorRuleType() {
+                            LegendLabel = string.Empty,
+                            Color = new GridColorType()
+                        }
+                    }
+                },
+                RebuildFactor = 1.0
+            });
+
+            gl.GetScaleRangeAt(0).ColorStyle.GetColorRuleAt(0).Color.SetValue("000000"); //NOXLATE
+            gl.GetScaleRangeAt(0).ColorStyle.GetColorRuleAt(1).Color.SetValue("FFFFFF"); //NOXLATE
+
+            this.Item = gl;
+        }
+
+        public void CreateDrawingLayer()
+        {
+            this.Item = new DrawingLayerDefinitionType();
+        }
+
+        /// <summary>
+        /// Creates a fill
+        /// </summary>
+        /// <param name="pattern"></param>
+        /// <param name="background"></param>
+        /// <param name="foreground"></param>
+        /// <returns></returns>
+        public IFill CreateFill(string pattern, System.Drawing.Color background, System.Drawing.Color foreground)
+        {
+            return new FillType()
+            {
+                BackgroundColor = Utility.SerializeHTMLColor(background, true),
+                FillPattern = pattern,
+                ForegroundColor = Utility.SerializeHTMLColor(foreground, true)
+            };
+        }
+
+        /// <summary>
+        /// Creates a line stroke with default settings
+        /// </summary>
+        /// <param name="color"></param>
+        /// <returns></returns>
+        public IStroke CreateStroke(System.Drawing.Color color)
+        {
+            return new StrokeType()
+            {
+                Color = Utility.SerializeHTMLColor(color, true),
+                LineStyle = "Solid", //NOXLATE
+                Thickness = "1", //NOXLATE
+                Unit = LengthUnitType.Points
+            };
+        }
+
+        public IStroke CreateDefaultStroke()
+        {
+            return CreateStroke(Color.Black);
+        }
+
+        public IPointVectorStyle CreateDefaultPointStyle()
+        {
+            IPointVectorStyle pts = new PointTypeStyleType()
+            {
+                PointRule = new System.ComponentModel.BindingList<PointRuleType>()
+            };
+            pts.AddRule(CreateDefaultPointRule());
+            return pts;
+        }
+
+        public ILineVectorStyle CreateDefaultLineStyle()
+        {
+            ILineVectorStyle lts = new LineTypeStyleType()
+            {
+                LineRule = new System.ComponentModel.BindingList<LineRuleType>()
+            };
+            lts.AddRule(CreateDefaultLineRule());
+            return lts;
+        }
+
+        public IAreaVectorStyle CreateDefaultAreaStyle()
+        {
+            IAreaVectorStyle ats = new AreaTypeStyleType()
+            {
+                AreaRule = new System.ComponentModel.BindingList<AreaRuleType>()
+            };
+            ats.AddRule(CreateDefaultAreaRule());
+            return ats;
+        }
+
+        public IVectorScaleRange CreateVectorScaleRange()
+        {
+            return new VectorScaleRangeType()
+            {
+                Items = new System.ComponentModel.BindingList<object>(),
+                AreaStyle = CreateDefaultAreaStyle(),
+                LineStyle = CreateDefaultLineStyle(),
+                PointStyle = CreateDefaultPointStyle()
+            };
+        }
+
+        public IFill CreateDefaultFill()
+        {
+            return CreateFill("Solid", Color.White, Color.White); //NOXLATE
+        }
+
+        public IMarkSymbol CreateDefaultMarkSymbol()
+        {
+            IMarkSymbol sym = new MarkSymbolType()
+            {
+                SizeContext = SizeContextType.DeviceUnits,
+                MaintainAspect = true,
+                Shape = ShapeType.Square,
+                Rotation = "0", //NOXLATE
+                SizeX = "10", //NOXLATE
+                SizeY = "10", //NOXLATE
+                Unit = LengthUnitType.Points
+            };
+            sym.Edge = CreateDefaultStroke();
+            sym.Fill = CreateDefaultFill();
+            return sym;
+        }
+
+        public IFontSymbol CreateDefaultFontSymbol()
+        {
+            IFontSymbol sym = new FontSymbolType()
+            {
+                SizeContext = SizeContextType.DeviceUnits,
+                MaintainAspect = true,
+                FontName = "Arial", //NOXLATE
+                Rotation = "0", //NOXLATE
+                SizeX = "10", //NOXLATE
+                SizeY = "10", //NOXLATE
+                Unit = LengthUnitType.Points
+            };
+            sym.SetForegroundColor(Color.Black);
+            return sym;
+        }
+
+        public IPointSymbolization2D CreateDefaultPointSymbolization2D()
+        {
+            IPointSymbolization2D sym = new PointSymbolization2DType();
+            sym.Symbol = CreateDefaultMarkSymbol();
+            return sym;
+        }
+
+        public IPointRule CreateDefaultPointRule()
+        {
+            IPointRule pr = new PointRuleType()
+            {
+                LegendLabel = string.Empty
+            };
+            pr.PointSymbolization2D = CreateDefaultPointSymbolization2D();
+            return pr;
+        }
+
+        public IAreaRule CreateDefaultAreaRule()
+        {
+            IAreaRule ar = new AreaRuleType()
+            {
+                LegendLabel = string.Empty
+            };
+            ar.AreaSymbolization2D = CreateDefaultAreaSymbolizationFill();
+            return ar;
+        }
+
+        public IAreaSymbolizationFill CreateDefaultAreaSymbolizationFill()
+        {
+            IAreaSymbolizationFill fill = new AreaSymbolizationFillType();
+            fill.Fill = CreateDefaultFill();
+            fill.Stroke = CreateDefaultStroke();
+
+            return fill;
+        }
+
+        public ILineRule CreateDefaultLineRule()
+        {
+            ILineRule lr = new LineRuleType()
+            {
+                LegendLabel = "",
+                Items = new System.ComponentModel.BindingList<StrokeType>()
+            };
+            lr.AddStroke(CreateDefaultStroke());
+            return lr;
+        }
+
+        public IAdvancedPlacement CreateDefaultAdvancedPlacement(double scaleLimit)
+        {
+            return new TextSymbolTypeAdvancedPlacement() { ScaleLimit = scaleLimit };
+        }
+
+        public ITextSymbol CreateDefaultTextSymbol()
+        {
+            return new TextSymbolType()
+            {
+                AdvancedPlacement = null,
+                BackgroundColor = Utility.SerializeHTMLColor(Color.White, true),
+                BackgroundStyle = BackgroundStyleType.Transparent,
+                Bold = "false", //NOXLATE
+                FontName = "Arial", //NOXLATE
+                ForegroundColor = Utility.SerializeHTMLColor(Color.Black, true),
+                HorizontalAlignment = "'Center'", //NOXLATE
+                Italic = "false", //NOXLATE
+                Rotation = "0", //NOXLATE
+                SizeContext = SizeContextType.DeviceUnits,
+                SizeX = "10", //NOXLATE
+                SizeY = "10", //NOXLATE
+                Text = string.Empty,
+                Underlined = "false", //NOXLATE
+                Unit = LengthUnitType.Points,
+                VerticalAlignment = "'Baseline'" //NOXLATE
+            };
+        }
+
+        public IW2DSymbol CreateDefaultW2DSymbol(string symbolLibrary, string symbolName)
+        {
+            return new W2DSymbolType()
+            {
+                W2DSymbol = new W2DSymbolTypeW2DSymbol()
+                {
+                    ResourceId = symbolLibrary,
+                    LibraryItemName = symbolName
+                },
+            };
+        }
+
+        public virtual ICompositeRule CreateDefaultCompositeRule()
+        {
+#if LDF_100
+            throw new NotImplementedException();
+#else
+            return new CompositeRule()
+            {
+                LegendLabel = string.Empty,
+                CompositeSymbolization = new CompositeSymbolization()
+                {
+                    SymbolInstance = new System.ComponentModel.BindingList<SymbolInstance>()
+                }
+            };
+#endif
+        }
+
+        public virtual ICompositeTypeStyle CreateDefaultCompositeStyle()
+        {
+#if LDF_100
+            throw new NotImplementedException();
+#else
+            var cts = new CompositeTypeStyle()
+            {
+                CompositeRule = new System.ComponentModel.BindingList<CompositeRule>(),
+#if LDF_110 || LDF_120
+#else
+                ShowInLegend = true,
+#endif
+            };
+            cts.AddCompositeRule(CreateDefaultCompositeRule());
+            return cts;
+#endif
+        }
+
+        public virtual IUrlData CreateUrlData()
+        {
+#if LDF_240
+            return new URLDataType();
+#else
+            throw new NotImplementedException();
+#endif
+        }
+
+        public virtual ICompositeSymbolization CloneCompositeSymbolization(ICompositeSymbolization sym)
+        {
+#if LDF_100
+            throw new NotImplementedException();
+#else
+            var csym = (CompositeSymbolization)sym;
+            //Use quick and dirty XML in'n'out cloning to ensure no existing child references are
+            //carried over
+            var clone = CompositeSymbolization.Deserialize(csym.Serialize());
+            /*
+            foreach (var oldInst in csym.SymbolInstance)
+            {
+                System.Diagnostics.Debug.WriteLine("old symbol instance: {0}", oldInst.GetHashCode());
+            }
+            foreach (var newInst in clone.SymbolInstance)
+            {
+                System.Diagnostics.Debug.WriteLine("new symbol instance: {0}", newInst.GetHashCode());
+            }*/
+            return clone;
+#endif
+        }
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_4_0/VectorLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_4_0/VectorLayerDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LayerDefinition/v2_4_0/VectorLayerDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,2471 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LDF_240
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LDF_110
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0
+#elif LDF_120
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0
+#elif LDF_130
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0
+#elif LDF_230
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0
+#elif LDF_240
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0
+#endif
+{
+    using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+    using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
+    using OSGeo.MapGuide.ObjectModels.WatermarkDefinition;
+    using System.Xml.Serialization;
+
+    abstract partial class BaseLayerDefinitionType : ISubLayerDefinition
+#if LDF_230 || LDF_240
+, ISubLayerDefinition2
+#endif
+    {
+        [XmlIgnore]
+        public abstract LayerType LayerType { get; }
+
+#if LDF_230 || LDF_240
+
+        [XmlIgnore]
+        IEnumerable<IWatermark> IWatermarkCollection.Watermarks
+        {
+            get
+            {
+                foreach (var wm in this.Watermarks)
+                    yield return wm;
+            }
+        }
+
+        IWatermark IWatermarkCollection.AddWatermark(IWatermarkDefinition watermark)
+        {
+            return WatermarkCollectionUtil.AddWatermark(this.Watermarks, watermark);
+        }
+
+        void IWatermarkCollection.RemoveWatermark(IWatermark watermark)
+        {
+            WatermarkCollectionUtil.RemoveWatermark(this.Watermarks, watermark);
+        }
+
+        [XmlIgnore]
+        int IWatermarkCollection.WatermarkCount
+        {
+            get { return this.Watermarks.Count; }
+        }
+
+#endif
+    }
+
+    partial class NameStringPairType : INameStringPair
+    {
+        [XmlIgnore]
+        string INameStringPair.Name
+        {
+            get
+            {
+                return this.Name;
+            }
+            set
+            {
+                this.Name = value;
+            }
+        }
+
+        [XmlIgnore]
+        string INameStringPair.Value
+        {
+            get
+            {
+                return this.Value;
+            }
+            set
+            {
+                this.Value = value;
+            }
+        }
+    }
+
+    partial class VectorScaleRangeType : IVectorScaleRange
+#if !LDF_100
+, IVectorScaleRange2
+#endif
+    {
+        #region Missing generated stuff
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private bool minScaleFieldSpecified;
+
+        [System.Xml.Serialization.XmlIgnoreAttribute()]
+        public bool MinScaleSpecified
+        {
+            get
+            {
+                return this.minScaleFieldSpecified;
+            }
+            set
+            {
+                if ((minScaleFieldSpecified.Equals(value) != true))
+                {
+                    this.minScaleFieldSpecified = value;
+                    this.OnPropertyChanged("MinScaleSpecified"); //NOXLATE
+                }
+            }
+        }
+
+        #endregion Missing generated stuff
+
+        [XmlIgnore]
+        public IAreaVectorStyle AreaStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(IAreaVectorStyle).IsAssignableFrom(item.GetType()))
+                        return (IAreaVectorStyle)item;
+                }
+
+                return null;
+            }
+            set
+            {
+                //Remove old one if it exists
+                var item = this.AreaStyle;
+                if (item != null)
+                {
+                    this.itemsField.Remove(item);
+                }
+                //Put the new one in if it is not null
+                if (value != null)
+                {
+                    this.itemsField.Add(value);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public ILineVectorStyle LineStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ILineVectorStyle).IsAssignableFrom(item.GetType()))
+                        return (ILineVectorStyle)item;
+                }
+
+                return null;
+            }
+            set
+            {
+                //Remove old one if it exists
+                var item = this.LineStyle;
+                if (item != null)
+                {
+                    this.itemsField.Remove(item);
+                }
+                //Put the new one in if it is not null
+                if (value != null)
+                {
+                    this.itemsField.Add(value);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public IPointVectorStyle PointStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(IPointVectorStyle).IsAssignableFrom(item.GetType()))
+                        return (IPointVectorStyle)item;
+                }
+
+                return null;
+            }
+            set
+            {
+                //Remove old one if it exists
+                var item = this.PointStyle;
+                if (item != null)
+                {
+                    this.itemsField.Remove(item);
+                }
+                //Put the new one in if it is not null
+                if (value != null)
+                {
+                    this.itemsField.Add(value);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        double? IVectorScaleRange.MinScale
+        {
+            get
+            {
+                return this.MinScaleSpecified ? new Nullable<double>(this.MinScale) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.MinScaleSpecified = true;
+                    this.MinScale = value.Value;
+                }
+                else
+                {
+                    this.MinScaleSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        double? IVectorScaleRange.MaxScale
+        {
+            get
+            {
+                return this.MaxScaleSpecified ? new Nullable<double>(this.MaxScale) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.MaxScaleSpecified = true;
+                    this.MaxScale = value.Value;
+                }
+                else
+                {
+                    this.MaxScaleSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public IList<IVectorStyle> AllStyles
+        {
+            get { return (IList<IVectorStyle>)this.Items; }
+        }
+
+        IVectorScaleRange IVectorScaleRange.Clone()
+        {
+            return VectorScaleRangeType.Deserialize(this.Serialize());
+        }
+
+#if LDF_110 || LDF_120
+
+        [XmlIgnore]
+        public IEnumerable<ICompositeTypeStyle> CompositeStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                        yield return (ICompositeTypeStyle)item;
+                }
+            }
+            set
+            {
+                //Clear old ones
+                var remove = new List<object>();
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                        remove.Add(item);
+                }
+
+                foreach (var obj in remove)
+                {
+                    this.itemsField.Remove(obj);
+                }
+
+                //Put the new ones in if it is not null
+                if (value != null)
+                {
+                    foreach (var item in value)
+                    {
+                        if (!typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                            throw new InvalidOperationException(Strings.ErrorObjectNotICompositeTypeStyle);
+
+                        this.itemsField.Add(item);
+                    }
+                }
+            }
+        }
+
+#elif LDF_130 || LDF_230 || LDF_240
+
+        [XmlIgnore]
+        public IEnumerable<ICompositeTypeStyle> CompositeStyle
+        {
+            get
+            {
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+                        yield return (ICompositeTypeStyle2)item;
+                }
+            }
+            set
+            {
+                //Clear old ones
+                var remove = new List<object>();
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+                        remove.Add(item);
+                }
+
+                foreach (var obj in remove)
+                {
+                    this.itemsField.Remove(obj);
+                }
+
+                //Put the new ones in if it is not null
+                if (value != null)
+                {
+                    foreach (var item in value)
+                    {
+                        if (!typeof(ICompositeTypeStyle2).IsAssignableFrom(item.GetType()))
+                            throw new InvalidOperationException(Strings.ErrorObjectNotICompositeTypeStyle);
+
+                        this.itemsField.Add(item);
+                    }
+                }
+            }
+        }
+
+#endif
+
+#if LDF_100
+#else
+
+        IElevationSettings IVectorScaleRange2.ElevationSettings
+        {
+            get { return this.ElevationSettings; }
+            set { this.ElevationSettings = (ElevationSettingsType)value; }
+        }
+
+        IElevationSettings IVectorScaleRange2.Create(string zOffset, string zExtrusion, ElevationTypeType zOffsetType, LengthUnitType unit)
+        {
+            return new ElevationSettingsType()
+            {
+                ZOffset = zOffset,
+                ZOffsetType = zOffsetType,
+                ZExtrusion = zExtrusion,
+                Unit = unit
+            };
+        }
+
+        [XmlIgnore]
+        int IVectorScaleRange2.CompositeStyleCount
+        {
+            get
+            {
+                int count = 0;
+                foreach (var item in this.itemsField)
+                {
+                    if (typeof(ICompositeTypeStyle).IsAssignableFrom(item.GetType()))
+                        count++;
+                }
+                return count;
+            }
+        }
+
+#endif
+    }
+
+#if LDF_100
+#else
+
+    partial class ElevationSettingsType : IElevationSettings { }
+
+#endif
+
+#if LDF_100
+
+    partial class StrokeType : IStroke
+#else
+
+    partial class StrokeType : IStroke, IStroke2
+#endif
+    {
+        internal StrokeType()
+        {
+        }
+
+        IStroke ICloneableLayerElement<IStroke>.Clone()
+        {
+            return StrokeType.Deserialize(this.Serialize());
+        }
+
+#if LDF_100
+#else
+
+        IStroke2 ICloneableLayerElement<IStroke2>.Clone()
+        {
+            return StrokeType.Deserialize(this.Serialize());
+        }
+
+#endif
+    }
+
+    partial class FillType : IFill
+    {
+        internal FillType()
+        {
+        }
+
+        IFill ICloneableLayerElement<IFill>.Clone()
+        {
+            return FillType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class AreaTypeStyleType : IAreaVectorStyle
+#if LDF_130 || LDF_230 || LDF_240
+, IAreaVectorStyle2
+#endif
+    {
+        [XmlIgnore]
+        IEnumerable<IAreaRule> IAreaVectorStyle.Rules
+        {
+            get
+            {
+                foreach (var ar in this.AreaRule)
+                {
+                    yield return ar;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int IVectorStyle.RuleCount
+        {
+            get
+            {
+                if (this.AreaRule != null)
+                    return this.AreaRule.Count;
+                return 0;
+            }
+        }
+
+        void IAreaVectorStyle.RemoveAllRules()
+        {
+            this.AreaRule.Clear();
+        }
+
+        void IAreaVectorStyle.AddRule(IAreaRule rule)
+        {
+            var ar = rule as AreaRuleType;
+            if (ar != null)
+                this.AreaRule.Add(ar);
+        }
+
+        void IAreaVectorStyle.RemoveRule(IAreaRule rule)
+        {
+            var ar = rule as AreaRuleType;
+            if (ar != null)
+                this.AreaRule.Remove(ar);
+        }
+
+        [XmlIgnore]
+        StyleType IVectorStyle.StyleType
+        {
+            get { return StyleType.Area; }
+        }
+
+        #region IRuleCollection<IAreaRule> Members
+
+        public int IndexOfRule(IAreaRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+                return this.AreaRule.IndexOf(r);
+            return -1;
+        }
+
+        public IAreaRule GetRuleAt(int index)
+        {
+            return this.AreaRule[index];
+        }
+
+        public bool MoveUp(IAreaRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveUp(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        public bool MoveDown(IAreaRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveDown(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        #endregion IRuleCollection<IAreaRule> Members
+
+        #region IRuleCollection Members
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.AreaRule[index];
+        }
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+                return this.AreaRule.IndexOf(r);
+            return -1;
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveUp(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var r = rule as AreaRuleType;
+            if (r != null)
+            {
+                return CollectionUtil.MoveDown(this.AreaRule, r);
+            }
+            return false;
+        }
+
+        #endregion IRuleCollection Members
+    }
+
+    internal static class CollectionUtil
+    {
+        public static bool MoveUp<T>(IList<T> list, T obj)
+        {
+            var idx = list.IndexOf(obj);
+            if (idx == 0) //Already at top
+                return false;
+
+            var newIdx = idx - 1;
+            //Get object at index
+            var obj2 = list[newIdx];
+            //Swap them
+            list[idx] = obj2;
+            list[newIdx] = obj;
+
+            return true;
+        }
+
+        public static bool MoveDown<T>(IList<T> list, T obj)
+        {
+            var idx = list.IndexOf(obj);
+            if (idx == list.Count - 1) //Already at bottom
+                return false;
+
+            var newIdx = idx + 1;
+            //Get object at index
+            var obj2 = list[newIdx];
+            //Swap them
+            list[idx] = obj2;
+            list[newIdx] = obj;
+
+            return true;
+        }
+    }
+
+    partial class AreaRuleType : IAreaRule
+    {
+        [XmlIgnore]
+        IAreaSymbolizationFill IAreaRule.AreaSymbolization2D
+        {
+            get
+            {
+                return this.Item;
+            }
+            set
+            {
+                this.Item = (AreaSymbolizationFillType)value;
+            }
+        }
+
+        [XmlIgnore]
+        ITextSymbol IBasicVectorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+    }
+
+    partial class PointTypeStyleType : IPointVectorStyle
+#if LDF_130 || LDF_230 || LDF_240
+, IPointVectorStyle2
+#endif
+    {
+        [XmlIgnore]
+        public IEnumerable<IPointRule> Rules
+        {
+            get
+            {
+                foreach (var pr in this.PointRule)
+                {
+                    yield return pr;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int IVectorStyle.RuleCount
+        {
+            get
+            {
+                if (this.PointRule != null)
+                    return this.PointRule.Count;
+                return 0;
+            }
+        }
+
+        public void RemoveAllRules()
+        {
+            this.PointRule.Clear();
+        }
+
+        public void AddRule(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                this.PointRule.Add(pr);
+        }
+
+        public void RemoveRule(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                this.PointRule.Remove(pr);
+        }
+
+        [XmlIgnore]
+        public StyleType StyleType
+        {
+            get { return StyleType.Point; }
+        }
+
+        #region IRuleCollection<IPointRule> Members
+
+        public int IndexOfRule(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return this.PointRule.IndexOf(pr);
+            return -1;
+        }
+
+        public IPointRule GetRuleAt(int index)
+        {
+            return this.PointRule[index];
+        }
+
+        public bool MoveUp(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveUp(this.PointRule, pr);
+            return false;
+        }
+
+        public bool MoveDown(IPointRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveDown(this.PointRule, pr);
+            return false;
+        }
+
+        #endregion IRuleCollection<IPointRule> Members
+
+        #region IRuleCollection Members
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.PointRule[index];
+        }
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return this.PointRule.IndexOf(pr);
+            return -1;
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveUp(this.PointRule, pr);
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var pr = rule as PointRuleType;
+            if (pr != null)
+                return CollectionUtil.MoveDown(this.PointRule, pr);
+            return false;
+        }
+
+        #endregion IRuleCollection Members
+    }
+
+    partial class PointRuleType : IPointRule
+    {
+        [XmlIgnore]
+        ITextSymbol IBasicVectorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IPointSymbolization2D IPointRule.PointSymbolization2D
+        {
+            get { return this.Item; }
+            set { this.Item = (PointSymbolization2DType)value; }
+        }
+    }
+
+    partial class PointSymbolization2DType : IPointSymbolization2D
+    {
+        [XmlIgnore]
+        ISymbol IPointSymbolization2D.Symbol
+        {
+            get { return (ISymbol)this.Item; }
+            set { this.Item = (SymbolType)value; }
+        }
+
+        IPointSymbolization2D ICloneableLayerElement<IPointSymbolization2D>.Clone()
+        {
+            return PointSymbolization2DType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class LineTypeStyleType : ILineVectorStyle
+#if LDF_130 || LDF_230 || LDF_240
+, ILineVectorStyle2
+#endif
+    {
+        [XmlIgnore]
+        public IEnumerable<ILineRule> Rules
+        {
+            get
+            {
+                foreach (var lr in this.LineRule)
+                {
+                    yield return lr;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int IVectorStyle.RuleCount
+        {
+            get
+            {
+                if (this.LineRule != null)
+                    return this.LineRule.Count;
+                return 0;
+            }
+        }
+
+        public ILineRule GetRuleAt(int index)
+        {
+            return this.LineRule[index];
+        }
+
+        public void RemoveAllRules()
+        {
+            this.LineRule.Clear();
+        }
+
+        public void AddRule(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                this.LineRule.Add(lr);
+        }
+
+        public void RemoveRule(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                this.LineRule.Remove(lr);
+        }
+
+        [XmlIgnore]
+        public StyleType StyleType
+        {
+            get { return StyleType.Line; }
+        }
+
+        #region IRuleCollection<ILineRule> Members
+
+        public int IndexOfRule(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return this.LineRule.IndexOf(lr);
+            return -1;
+        }
+
+        public bool MoveUp(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveUp(this.LineRule, lr);
+            return false;
+        }
+
+        public bool MoveDown(ILineRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveDown(this.LineRule, lr);
+            return false;
+        }
+
+        #endregion IRuleCollection<ILineRule> Members
+
+        #region IRuleCollection Members
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.LineRule[index];
+        }
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return this.LineRule.IndexOf(lr);
+            return -1;
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveUp(this.LineRule, lr);
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var lr = rule as LineRuleType;
+            if (lr != null)
+                return CollectionUtil.MoveDown(this.LineRule, lr);
+            return false;
+        }
+
+        #endregion IRuleCollection Members
+    }
+
+    partial class LineRuleType : ILineRule
+    {
+        [XmlIgnore]
+        IEnumerable<IStroke> ILineRule.Strokes
+        {
+            get
+            {
+                foreach (var str in this.Items)
+                {
+                    yield return str;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        int ILineRule.StrokeCount
+        {
+            get { return this.Items.Count; }
+        }
+
+        void ILineRule.SetStrokes(IEnumerable<IStroke> strokes)
+        {
+            Check.NotNull(strokes, "strokes"); //NOXLATE
+            this.Items.Clear();
+            foreach (var stroke in strokes)
+            {
+                var st = stroke as StrokeType;
+                if (st != null)
+                    this.Items.Add(st);
+            }
+        }
+
+        void ILineRule.AddStroke(IStroke stroke)
+        {
+            var st = stroke as StrokeType;
+            if (st != null)
+                this.Items.Add(st);
+        }
+
+        void ILineRule.RemoveStroke(IStroke stroke)
+        {
+            var st = stroke as StrokeType;
+            if (st != null)
+                this.Items.Remove(st);
+        }
+
+        [XmlIgnore]
+        ITextSymbol IBasicVectorRule.Label
+        {
+            get
+            {
+                return this.Label;
+            }
+            set
+            {
+                this.Label = (TextSymbolType)value;
+            }
+        }
+    }
+
+    partial class TextSymbolType : ITextSymbol
+    {
+        [XmlIgnore]
+        IAdvancedPlacement ITextSymbol.AdvancedPlacement
+        {
+            get
+            {
+                return this.AdvancedPlacement;
+            }
+            set
+            {
+                this.AdvancedPlacement = (TextSymbolTypeAdvancedPlacement)value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Text
+        {
+            get
+            {
+                return this.Text;
+            }
+            set
+            {
+                this.Text = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.FontName
+        {
+            get
+            {
+                return this.FontName;
+            }
+            set
+            {
+                this.FontName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.ForegroundColor
+        {
+            get
+            {
+                return this.ForegroundColor;
+            }
+            set
+            {
+                this.ForegroundColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.BackgroundColor
+        {
+            get
+            {
+                return this.BackgroundColor;
+            }
+            set
+            {
+                this.BackgroundColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        BackgroundStyleType ITextSymbol.BackgroundStyle
+        {
+            get
+            {
+                return this.BackgroundStyle;
+            }
+            set
+            {
+                this.BackgroundStyle = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.HorizontalAlignment
+        {
+            get
+            {
+                return this.HorizontalAlignment;
+            }
+            set
+            {
+                this.HorizontalAlignment = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.VerticalAlignment
+        {
+            get
+            {
+                return this.VerticalAlignment;
+            }
+            set
+            {
+                this.VerticalAlignment = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Bold
+        {
+            get
+            {
+                return this.Bold;
+            }
+            set
+            {
+                this.Bold = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Italic
+        {
+            get
+            {
+                return this.Italic;
+            }
+            set
+            {
+                this.Italic = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ITextSymbol.Underlined
+        {
+            get
+            {
+                return this.Underlined;
+            }
+            set
+            {
+                this.Underlined = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Font; }
+        }
+
+        ITextSymbol ICloneableLayerElement<ITextSymbol>.Clone()
+        {
+            return TextSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class MarkSymbolType : IMarkSymbol
+    {
+        [XmlIgnore]
+        ShapeType IMarkSymbol.Shape
+        {
+            get
+            {
+                return this.Shape;
+            }
+            set
+            {
+                this.Shape = value;
+            }
+        }
+
+        [XmlIgnore]
+        IFill IMarkSymbol.Fill
+        {
+            get
+            {
+                return (IFill)this.Fill;
+            }
+            set
+            {
+                this.Fill = (FillType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IStroke IMarkSymbol.Edge
+        {
+            get
+            {
+                return (IStroke)this.Edge;
+            }
+            set
+            {
+                this.Edge = (StrokeType)value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Mark; }
+        }
+
+        IMarkSymbol ICloneableLayerElement<IMarkSymbol>.Clone()
+        {
+            return MarkSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    internal class ImageBinaryContainer : IInlineImageSymbol
+    {
+        [XmlIgnore]
+        public byte[] Content
+        {
+            get;
+            set;
+        }
+
+        [XmlIgnore]
+        public ImageSymbolReferenceType Type
+        {
+            get { return ImageSymbolReferenceType.Inline; }
+        }
+
+        IInlineImageSymbol ICloneableLayerElement<IInlineImageSymbol>.Clone()
+        {
+            byte[] array = null;
+            if (this.Content != null)
+            {
+                array = new byte[this.Content.Length];
+                Array.Copy(this.Content, array, this.Content.Length);
+            }
+            return new ImageBinaryContainer()
+            {
+                Content = array
+            };
+        }
+    }
+
+    partial class ImageSymbolType : IImageSymbol
+    {
+        [XmlIgnore]
+        IBaseImageSymbol IImageSymbol.Image
+        {
+            get
+            {
+                IBaseImageSymbol img = null;
+                if (this.Item == null)
+                    return null;
+
+                if (typeof(byte[]).IsAssignableFrom(this.Item.GetType()))
+                    img = new ImageBinaryContainer() { Content = (byte[])this.Item };
+                else
+                    img = (ISymbolReference)this.Item;
+                return img;
+            }
+            set
+            {
+                if (typeof(IInlineImageSymbol).IsAssignableFrom(value.GetType()))
+                    this.Item = ((IInlineImageSymbol)value).Content;
+                else
+                    this.Item = (ImageSymbolTypeImage)value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Image; }
+        }
+
+        IImageSymbol ICloneableLayerElement<IImageSymbol>.Clone()
+        {
+            return ImageSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    abstract partial class SymbolType : ISymbol
+    {
+        [XmlIgnore]
+        LengthUnitType ISymbol.Unit
+        {
+            get
+            {
+                return this.Unit;
+            }
+            set
+            {
+                this.Unit = value;
+            }
+        }
+
+        [XmlIgnore]
+        SizeContextType ISymbol.SizeContext
+        {
+            get
+            {
+                return this.SizeContext;
+            }
+            set
+            {
+                this.SizeContext = value;
+            }
+        }
+
+        [XmlIgnore]
+        bool ISymbol.MaintainAspect
+        {
+            get
+            {
+                return this.MaintainAspect;
+            }
+            set
+            {
+                this.MaintainAspect = true;
+            }
+        }
+
+        [XmlIgnore]
+        public abstract PointSymbolType Type { get; }
+
+        [XmlIgnore]
+        string ISymbol.InsertionPointY
+        {
+            get
+            {
+                return this.InsertionPointY.ToString();
+            }
+            set
+            {
+                this.InsertionPointY = Convert.ToDouble(value);
+            }
+        }
+    }
+
+    partial class FontSymbolType : IFontSymbol
+    {
+        [XmlIgnore]
+        string IFontSymbol.FontName
+        {
+            get
+            {
+                return this.FontName;
+            }
+            set
+            {
+                this.FontName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IFontSymbol.Character
+        {
+            get
+            {
+                return this.Character;
+            }
+            set
+            {
+                this.Character = value;
+            }
+        }
+
+        [XmlIgnore]
+        bool? IFontSymbol.Bold
+        {
+            get
+            {
+                return this.BoldSpecified ? new Nullable<bool>(this.Bold) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.Bold = value.Value;
+                    this.BoldSpecified = true;
+                }
+                else
+                {
+                    this.BoldSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        bool? IFontSymbol.Italic
+        {
+            get
+            {
+                return this.ItalicSpecified ? new Nullable<bool>(this.Italic) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.Italic = value.Value;
+                    this.ItalicSpecified = true;
+                }
+                else
+                {
+                    this.ItalicSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        bool? IFontSymbol.Underlined
+        {
+            get
+            {
+                return this.UnderlinedSpecified ? new Nullable<bool>(this.Underlined) : null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.Underlined = value.Value;
+                    this.UnderlinedSpecified = true;
+                }
+                else
+                {
+                    this.UnderlinedSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        string IFontSymbol.ForegroundColor
+        {
+            get
+            {
+                return this.ForegroundColor;
+            }
+            set
+            {
+                this.ForegroundColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Font; }
+        }
+
+        IFontSymbol ICloneableLayerElement<IFontSymbol>.Clone()
+        {
+            return FontSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class BlockSymbolType : IBlockSymbol
+    {
+        [XmlIgnore]
+        string IBlockSymbol.DrawingName
+        {
+            get
+            {
+                return this.DrawingName;
+            }
+            set
+            {
+                this.DrawingName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IBlockSymbol.BlockName
+        {
+            get
+            {
+                return this.BlockName;
+            }
+            set
+            {
+                this.BlockName = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IBlockSymbol.BlockColor
+        {
+            get
+            {
+                return this.BlockColor;
+            }
+            set
+            {
+                this.BlockColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IBlockSymbol.LayerColor
+        {
+            get
+            {
+                return this.LayerColor;
+            }
+            set
+            {
+                this.LayerColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.Block; }
+        }
+
+        IBlockSymbol ICloneableLayerElement<IBlockSymbol>.Clone()
+        {
+            return BlockSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class W2DSymbolType : IW2DSymbol
+    {
+        [XmlIgnore]
+        ISymbolReference IW2DSymbol.W2DSymbol
+        {
+            get
+            {
+                return (ISymbolReference)this.W2DSymbol;
+            }
+            set
+            {
+                this.W2DSymbol = (W2DSymbolTypeW2DSymbol)value;
+            }
+        }
+
+        [XmlIgnore]
+        string IW2DSymbol.FillColor
+        {
+            get
+            {
+                return this.FillColor;
+            }
+            set
+            {
+                this.FillColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IW2DSymbol.LineColor
+        {
+            get
+            {
+                return this.LineColor;
+            }
+            set
+            {
+                this.LineColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        string IW2DSymbol.TextColor
+        {
+            get
+            {
+                return this.TextColor;
+            }
+            set
+            {
+                this.TextColor = value;
+            }
+        }
+
+        [XmlIgnore]
+        public override PointSymbolType Type
+        {
+            get { return PointSymbolType.W2D; }
+        }
+
+        IW2DSymbol ICloneableLayerElement<IW2DSymbol>.Clone()
+        {
+            return W2DSymbolType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class W2DSymbolTypeW2DSymbol : ISymbolReference
+    {
+        [XmlIgnore]
+        ImageSymbolReferenceType IBaseImageSymbol.Type
+        {
+            get { return ImageSymbolReferenceType.SymbolReference; }
+        }
+
+        ISymbolReference ICloneableLayerElement<ISymbolReference>.Clone()
+        {
+            return W2DSymbolTypeW2DSymbol.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class ImageSymbolTypeImage : ISymbolReference
+    {
+        [XmlIgnore]
+        string ISymbolReference.ResourceId
+        {
+            get
+            {
+                return this.ResourceId == null ? string.Empty : this.ResourceId.ToString();
+            }
+            set
+            {
+                this.ResourceId = value;
+            }
+        }
+
+        [XmlIgnore]
+        string ISymbolReference.LibraryItemName
+        {
+            get
+            {
+                return this.LibraryItemName == null ? string.Empty : this.LibraryItemName.ToString();
+            }
+            set
+            {
+                this.LibraryItemName = value;
+            }
+        }
+
+        [XmlIgnore]
+        ImageSymbolReferenceType IBaseImageSymbol.Type
+        {
+            get { return ImageSymbolReferenceType.SymbolReference; }
+        }
+
+        ISymbolReference ICloneableLayerElement<ISymbolReference>.Clone()
+        {
+            return ImageSymbolTypeImage.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class TextSymbolTypeAdvancedPlacement : IAdvancedPlacement
+    {
+    }
+
+    partial class AreaSymbolizationFillType : IAreaSymbolizationFill
+    {
+        [XmlIgnore]
+        IFill IAreaSymbolizationFill.Fill
+        {
+            get
+            {
+                return this.Fill;
+            }
+            set
+            {
+                this.Fill = (FillType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IStroke IAreaSymbolizationFill.Stroke
+        {
+            get
+            {
+                return this.Stroke;
+            }
+            set
+            {
+                this.Stroke = (StrokeType)value;
+            }
+        }
+
+        IAreaSymbolizationFill ICloneableLayerElement<IAreaSymbolizationFill>.Clone()
+        {
+            return AreaSymbolizationFillType.Deserialize(this.Serialize());
+        }
+    }
+
+    partial class LayerDefinition : ILayerDefinition
+    {
+        //internal LayerDefinition() { }
+
+#if LDF_110
+        private static readonly Version RES_VERSION = new Version(1, 1, 0);
+#elif LDF_120
+        private static readonly Version RES_VERSION = new Version(1, 2, 0);
+#elif LDF_130
+        private static readonly Version RES_VERSION = new Version(1, 3, 0);
+#elif LDF_230
+        private static readonly Version RES_VERSION = new Version(2, 3, 0);
+#elif LDF_240
+        private static readonly Version RES_VERSION = new Version(2, 4, 0);
+#else
+        private static readonly Version RES_VERSION = new Version(1, 0, 0);
+#endif
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.LayerDefinition.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.LayerDefinition));
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.LayerDefinition.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public virtual Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        object ICloneable.Clone()
+        {
+            return this.Clone();
+        }
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")] //NOXLATE
+        public string ValidatingSchema
+        {
+#if LDF_110
+            get { return "LayerDefinition-1.1.0.xsd"; } //NOXLATE
+#elif LDF_120
+            get { return "LayerDefinition-1.2.0.xsd"; } //NOXLATE
+#elif LDF_130
+            get { return "LayerDefinition-1.3.0.xsd"; } //NOXLATE
+#elif LDF_230
+            get { return "LayerDefinition-2.3.0.xsd"; } //NOXLATE
+#elif LDF_240
+            get { return "LayerDefinition-2.4.0.xsd"; } //NOXLATE
+#else
+            get { return ResourceTypes.LayerDefinition.ToString() + "-" + this.ResourceVersion.ToString() + ".xsd"; } //NOXLATE
+#endif
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        [XmlIgnore]
+        public ISubLayerDefinition SubLayer
+        {
+            get { return this.Item; }
+        }
+
+        public INameStringPair CreatePair(string name, string value)
+        {
+            return new NameStringPairType() { Name = name, Value = value };
+        }
+    }
+
+    partial class DrawingLayerDefinitionType : IDrawingLayerDefinition
+    {
+        [XmlIgnore]
+        public override LayerType LayerType
+        {
+            get { return LayerType.Drawing; }
+        }
+
+        [XmlIgnore]
+        string ISubLayerDefinition.ResourceId
+        {
+            get { return this.ResourceId; }
+            set { this.ResourceId = value; }
+        }
+    }
+
+    partial class VectorLayerDefinitionType : IVectorLayerDefinition
+#if LDF_240
+, IVectorLayerDefinition2
+#endif
+    {
+        [XmlIgnore]
+        public override LayerType LayerType
+        {
+            get { return LayerType.Vector; }
+        }
+
+        [XmlIgnore]
+        string ISubLayerDefinition.ResourceId
+        {
+            get { return this.ResourceId; }
+            set { this.ResourceId = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.FeatureName
+        {
+            get { return this.FeatureName; }
+            set { this.FeatureName = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.Geometry
+        {
+            get { return this.Geometry; }
+            set { this.Geometry = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.Url
+        {
+#if LDF_240
+            get
+            {
+                if (this.urlDataField == null)
+                    return string.Empty;
+                else
+                    return this.urlDataField.Content;
+            }
+            set
+            {
+                if (!string.IsNullOrEmpty(value))
+                {
+                    if (this.urlDataField == null)
+                        this.urlDataField = new URLDataType();
+                    this.urlDataField.Content = value;
+                    OnPropertyChanged("Url"); //NOXLATE
+                }
+                else
+                {
+                    //NOTE: None of the other URLData properties seem to be used atm
+                    //hence why we are nulling this
+                    this.urlDataField = null;
+                    OnPropertyChanged("Url"); //NOXLATE
+                }
+            }
+#else
+            get { return this.Url; }
+            set { this.Url = value; }
+#endif
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.ToolTip
+        {
+            get { return this.ToolTip; }
+            set { this.ToolTip = value; }
+        }
+
+        [XmlIgnore]
+        string IVectorLayerDefinition.Filter
+        {
+            get { return this.Filter; }
+            set { this.Filter = value; }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IVectorScaleRange> IVectorLayerDefinition.VectorScaleRange
+        {
+            get
+            {
+                foreach (var vsr in this.VectorScaleRange)
+                {
+                    yield return vsr;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<INameStringPair> IVectorLayerDefinition.PropertyMapping
+        {
+            get
+            {
+                foreach (var pair in this.PropertyMapping)
+                {
+                    yield return pair;
+                }
+            }
+        }
+
+        INameStringPair IVectorLayerDefinition.GetPropertyMapping(string name)
+        {
+            foreach (var p in this.PropertyMapping)
+            {
+                if (p.Name == name)
+                    return p;
+            }
+            return null;
+        }
+
+        INameStringPair IVectorLayerDefinition.GetPropertyMappingAt(int index)
+        {
+            if (index < 0 || index >= this.PropertyMapping.Count)
+                throw new ArgumentOutOfRangeException();
+
+            var item = this.PropertyMapping[index];
+            return item;
+        }
+
+        void IVectorLayerDefinition.AddVectorScaleRange(IVectorScaleRange range)
+        {
+            var r = range as VectorScaleRangeType;
+            if (r != null)
+                this.VectorScaleRange.Add(r);
+        }
+
+        void IVectorLayerDefinition.RemoveVectorScaleRange(IVectorScaleRange range)
+        {
+            var r = range as VectorScaleRangeType;
+            if (r != null)
+                this.VectorScaleRange.Remove(r);
+        }
+
+        void IVectorLayerDefinition.AddPropertyMapping(INameStringPair pair)
+        {
+            var p = pair as NameStringPairType;
+            if (p != null)
+                this.PropertyMapping.Add(p);
+        }
+
+        void IVectorLayerDefinition.RemovePropertyMapping(INameStringPair pair)
+        {
+            var p = pair as NameStringPairType;
+            if (p != null)
+                this.PropertyMapping.Remove(p);
+        }
+
+        int IVectorLayerDefinition.GetPosition(INameStringPair pair)
+        {
+            var p = pair as NameStringPairType;
+            if (p != null)
+                return this.PropertyMapping.IndexOf(p);
+
+            return -1;
+        }
+
+        int IVectorLayerDefinition.MoveUp(INameStringPair pair)
+        {
+            int pos = ((IVectorLayerDefinition)this).GetPosition(pair);
+            if (pos > 0)
+            {
+                int dest = pos - 1;
+                var p = this.PropertyMapping[dest];
+                var p2 = (NameStringPairType)pair;
+
+                //Swap
+                this.PropertyMapping[dest] = p2;
+                this.PropertyMapping[pos] = p;
+
+                return dest;
+            }
+            return -1;
+        }
+
+        int IVectorLayerDefinition.MoveDown(INameStringPair pair)
+        {
+            int pos = ((IVectorLayerDefinition)this).GetPosition(pair);
+            if (pos < this.PropertyMapping.Count - 1)
+            {
+                int dest = pos + 1;
+                var p = this.PropertyMapping[dest];
+                var p2 = (NameStringPairType)pair;
+
+                //Swap
+                this.PropertyMapping[dest] = p2;
+                this.PropertyMapping[pos] = p;
+
+                return dest;
+            }
+            return -1;
+        }
+
+        void IVectorLayerDefinition.RemoveAllScaleRanges()
+        {
+            this.VectorScaleRange.Clear();
+        }
+
+        int IVectorLayerDefinition.IndexOfScaleRange(IVectorScaleRange range)
+        {
+            var r = range as VectorScaleRangeType;
+            if (r != null)
+                return this.VectorScaleRange.IndexOf(r);
+
+            return -1;
+        }
+
+        IVectorScaleRange IVectorLayerDefinition.GetScaleRangeAt(int index)
+        {
+            if (index >= this.VectorScaleRange.Count)
+                return null;
+
+            return this.VectorScaleRange[index];
+        }
+
+        [XmlIgnore]
+        Version IVectorLayerDefinition.SymbolDefinitionVersion
+        {
+            get
+            {
+#if LDF_110
+                return new Version(1, 0, 0);
+#elif LDF_120 || LDF_130 || LDF_230
+                return new Version(1, 1, 0);
+#elif LDF_240
+                return new Version(2, 4, 0);
+#else
+                return null;
+#endif
+            }
+        }
+
+#if LDF_240
+
+        [XmlIgnore]
+        IUrlData IVectorLayerDefinition2.UrlData
+        {
+            get
+            {
+                return this.UrlData;
+            }
+            set
+            {
+                this.UrlData = (URLDataType)value;
+            }
+        }
+
+#endif
+
+        void IVectorLayerDefinition.ClearPropertyMappings()
+        {
+            propertyMappingField.Clear();
+        }
+    }
+
+    #region Composite Symbolization
+
+#if !LDF_100
+
+    partial class CompositeRule : ICompositeRule
+    {
+        [XmlIgnore]
+        ICompositeSymbolization ICompositeRule.CompositeSymbolization
+        {
+            get
+            {
+                return this.CompositeSymbolization;
+            }
+            set
+            {
+                this.CompositeSymbolization = (CompositeSymbolization)value;
+            }
+        }
+    }
+
+    partial class CompositeSymbolization : ICompositeSymbolization
+    {
+        [XmlIgnore]
+        IEnumerable<ISymbolInstance> ICompositeSymbolization.SymbolInstance
+        {
+            get
+            {
+                foreach (var sym in this.SymbolInstance)
+                {
+                    yield return sym;
+                }
+            }
+        }
+
+        public string ToXml()
+        {
+            return this.Serialize();
+        }
+
+        public void UpdateFromXml(string xml)
+        {
+            var compsym = CompositeSymbolization.Deserialize(xml);
+            this.SymbolInstance.Clear();
+            foreach (var sym in compsym.SymbolInstance)
+            {
+                this.AddSymbolInstance(sym);
+            }
+        }
+
+        public void AddSymbolInstance(ISymbolInstance inst)
+        {
+            var sym = inst as SymbolInstance;
+            if (sym != null)
+                this.SymbolInstance.Add(sym);
+        }
+
+        public void RemoveSymbolInstance(ISymbolInstance inst)
+        {
+            var sym = inst as SymbolInstance;
+            if (sym != null)
+                this.SymbolInstance.Remove(sym);
+        }
+
+        public void RemoveAllSymbolInstances()
+        {
+            this.SymbolInstance.Clear();
+        }
+
+        public ISymbolInstance CreateSymbolReference(string resourceId)
+        {
+            return new SymbolInstance()
+            {
+                Item = resourceId,
+                ParameterOverrides = new ParameterOverrides()
+                {
+                    Override = new BindingList<Override>()
+                },
+            };
+        }
+
+        public ISymbolInstance CreateInlineSimpleSymbol(ISimpleSymbolDefinition symDef)
+        {
+            return new SymbolInstance()
+            {
+#if LDF_110
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition)symDef,
+#elif LDF_120 || LDF_130 || LDF_230
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.SimpleSymbolDefinition)symDef,
+#else
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_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.v1_0_0.CompoundSymbolDefinition)compDef,
+#elif LDF_120 || LDF_130 || LDF_230
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.CompoundSymbolDefinition)compDef,
+#else
+                Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.CompoundSymbolDefinition)compDef,
+#endif
+                ParameterOverrides = new ParameterOverrides()
+                {
+                    Override = new BindingList<Override>()
+                }
+            };
+        }
+    }
+
+    partial class SymbolInstance : ISymbolInstance
+#if LDF_100 || LDF_110
+#else
+, ISymbolInstance2
+#endif
+    {
+        [XmlIgnore]
+        IParameterOverrideCollection ISymbolInstance.ParameterOverrides
+        {
+            get { return this.ParameterOverrides; }
+        }
+
+        [XmlIgnore]
+        public ISymbolInstanceReference Reference
+        {
+            get
+            {
+                var libId = this.Item as string;
+#if LDF_110
+                var simpSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition;
+                var compSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.CompoundSymbolDefinition;
+#elif LDF_120 || LDF_130 || LDF_230
+                var simpSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.SimpleSymbolDefinition;
+                var compSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.CompoundSymbolDefinition;
+#else
+                var simpSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.SimpleSymbolDefinition;
+                var compSym = this.Item as OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.CompoundSymbolDefinition;
+#endif
+                if (libId != null)
+                    return new SymbolInstanceLibrary() { ResourceId = libId };
+                else if (simpSym != null)
+                    return new SymbolInstanceInline() { SymbolDefinition = simpSym };
+                else if (compSym != null)
+                    return new SymbolInstanceInline() { SymbolDefinition = compSym };
+                return null;
+            }
+            set
+            {
+                var sr = value as ISymbolInstanceReferenceLibrary;
+                var ir = value as ISymbolInstanceReferenceInline;
+                if (sr != null)
+                {
+                    this.Item = sr.ResourceId;
+                }
+                else if (ir != null)
+                {
+#if LDF_110
+                    if (ir.SymbolDefinition.Type == SymbolDefinitionType.Simple)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition)ir.SymbolDefinition;
+                    else if (ir.SymbolDefinition.Type == SymbolDefinitionType.Compound)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.CompoundSymbolDefinition)ir.SymbolDefinition;
+#elif LDF_120 || LDF_130 || LDF_230
+                    if (ir.SymbolDefinition.Type == SymbolDefinitionType.Simple)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.SimpleSymbolDefinition)ir.SymbolDefinition;
+                    else if (ir.SymbolDefinition.Type == SymbolDefinitionType.Compound)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0.CompoundSymbolDefinition)ir.SymbolDefinition;
+#else
+                    if (ir.SymbolDefinition.Type == SymbolDefinitionType.Simple)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.SimpleSymbolDefinition)ir.SymbolDefinition;
+                    else if (ir.SymbolDefinition.Type == SymbolDefinitionType.Compound)
+                        this.Item = (OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0.CompoundSymbolDefinition)ir.SymbolDefinition;
+#endif
+                }
+                this.Item = null;
+            }
+        }
+    }
+
+    partial class SymbolInstanceLibrary : ISymbolInstanceReferenceLibrary
+    {
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceId
+        {
+            get { return _resId; }
+            set
+            {
+                if (_resId == value) return;
+                _resId = value;
+                OnPropertyChanged("ResourceId"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public SymbolInstanceType Type
+        {
+            get { return SymbolInstanceType.Reference; }
+        }
+
+        public event PropertyChangedEventHandler PropertyChanged;
+
+        private void OnPropertyChanged(string name)
+        {
+            var handler = this.PropertyChanged;
+            if (handler != null)
+                handler(this, new PropertyChangedEventArgs(name));
+        }
+    }
+
+    partial class SymbolInstanceInline : ISymbolInstanceReferenceInline
+    {
+        [XmlIgnore]
+        public ISymbolDefinitionBase SymbolDefinition
+        {
+            get;
+            set;
+        }
+
+        [XmlIgnore]
+        public SymbolInstanceType Type
+        {
+            get { return SymbolInstanceType.Inline; }
+        }
+    }
+
+    partial class ParameterOverrides : IParameterOverrideCollection
+    {
+        [XmlIgnore]
+        IEnumerable<IParameterOverride> IParameterOverrideCollection.Override
+        {
+            get
+            {
+                foreach (var ov in this.Override)
+                {
+                    yield return ov;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public int Count
+        {
+            get { return this.Override.Count; }
+        }
+
+        [XmlIgnore]
+        public IParameterOverride this[int index]
+        {
+            get
+            {
+                if (index >= this.Override.Count)
+                    throw new ArgumentOutOfRangeException();
+
+                return this.Override[index];
+            }
+        }
+
+        public void AddOverride(IParameterOverride ov)
+        {
+            var o = ov as Override;
+            if (o != null)
+                this.Override.Add(o);
+        }
+
+        public void RemoveOverride(IParameterOverride ov)
+        {
+            var o = ov as Override;
+            if (o != null)
+                this.Override.Remove(o);
+        }
+
+        public IParameterOverride CreateParameterOverride(string symbol, string name)
+        {
+            return new Override()
+            {
+                ParameterIdentifier = name,
+                SymbolName = symbol
+            };
+        }
+    }
+
+    partial class Override : IParameterOverride
+    {
+    }
+
+    partial class CompositeTypeStyle : ICompositeTypeStyle
+#if LDF_130 || LDF_230 || LDF_240
+, ICompositeTypeStyle2
+#endif
+    {
+        [XmlIgnore]
+        string ICompositeTypeStyle.DisplayString
+        {
+            get
+            {
+                return Strings.CompositeStyleDisplayString;
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<ICompositeRule> ICompositeTypeStyle.CompositeRule
+        {
+            get
+            {
+                foreach (var cr in this.CompositeRule)
+                {
+                    yield return cr;
+                }
+            }
+        }
+
+        public void AddCompositeRule(ICompositeRule compRule)
+        {
+            var cr = compRule as CompositeRule;
+            if (cr != null)
+                this.CompositeRule.Add(cr);
+        }
+
+        public void RemoveCompositeRule(ICompositeRule compRule)
+        {
+            var cr = compRule as CompositeRule;
+            if (cr != null)
+                this.CompositeRule.Remove(cr);
+        }
+
+        [XmlIgnore]
+        public StyleType StyleType
+        {
+            get { return StyleType.Composite; }
+        }
+
+        [XmlIgnore]
+        public int RuleCount
+        {
+            get { return this.CompositeRule.Count; }
+        }
+
+    #region IRuleCollection<ICompositeRule> Members
+
+        public int IndexOfRule(ICompositeRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return this.CompositeRule.IndexOf(cr);
+            return -1;
+        }
+
+        public ICompositeRule GetRuleAt(int index)
+        {
+            return this.CompositeRule[index];
+        }
+
+        public bool MoveUp(ICompositeRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveUp(this.CompositeRule, cr);
+            return false;
+        }
+
+        public bool MoveDown(ICompositeRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveDown(this.CompositeRule, cr);
+            return false;
+        }
+
+    #endregion IRuleCollection<ICompositeRule> Members
+
+    #region IRuleCollection Members
+
+        public int IndexOfRule(IVectorRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return this.CompositeRule.IndexOf(cr);
+            return -1;
+        }
+
+        IVectorRule IRuleCollection.GetRuleAt(int index)
+        {
+            return this.CompositeRule[index];
+        }
+
+        public bool MoveUp(IVectorRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveUp(this.CompositeRule, cr);
+            return false;
+        }
+
+        public bool MoveDown(IVectorRule rule)
+        {
+            var cr = rule as CompositeRule;
+            if (cr != null)
+                return CollectionUtil.MoveDown(this.CompositeRule, cr);
+            return false;
+        }
+
+    #endregion IRuleCollection Members
+    }
+
+#endif
+
+    #endregion Composite Symbolization
+
+#if LDF_240
+
+    partial class URLDataType : IUrlData
+    {
+    }
+
+#endif
+}
\ No newline at end of file

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_0_0/LoadProcedureFactoryImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_0_0/LoadProcedureFactoryImpl.cs	2014-12-25 13:55:42 UTC (rev 8462)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_0_0/LoadProcedureFactoryImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -20,6 +20,7 @@
 
 #endregion Disclaimer / License
 
+#define LP100
 using System;
 using System.Collections.Generic;
 using System.IO;

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_0_0/LoadProcedureImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_0_0/LoadProcedureImpl.cs	2014-12-25 13:55:42 UTC (rev 8462)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_0_0/LoadProcedureImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -20,6 +20,7 @@
 
 #endregion Disclaimer / License
 
+#define LP100
 using System;
 using System.Collections.Generic;
 using System.Linq;

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_1_0/LoadProcedureFactoryImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_1_0/LoadProcedureFactoryImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_1_0/LoadProcedureFactoryImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,117 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LP110
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LP110
+
+namespace OSGeo.MapGuide.ObjectModels.LoadProcedure.v1_1_0
+#elif LP220
+namespace OSGeo.MapGuide.ObjectModels.LoadProcedure.v2_2_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LoadProcedure.v1_0_0
+#endif
+{
+    /// <summary>
+    /// Helper class for registration with <see cref="OSGeo.MapGuide.ObjectModels.ObjectFactory"/> and <see cref="OSGeo.MapGuide.MaestroAPI.ResourceTypeRegistry"/> classes
+    /// </summary>
+    public static class LoadProcEntryPoint
+    {
+        private const string ARBITRARY_XYM = "LOCAL_CS[\"Non-Earth (Meter)\", LOCAL_DATUM[\"Local Datum\", 0], UNIT[\"Meter\", 1], AXIS[\"X\", EAST], AXIS[\"Y\", NORTH]]"; //NOXLATE
+
+        private static void ApplyDefaults(LoadProcedureType lt)
+        {
+            lt.RootPath = "Library://"; //NOXLATE
+            lt.CoordinateSystem = ARBITRARY_XYM;
+            lt.SpatialDataSourcesPath = string.Empty;
+            lt.SpatialDataSourcesFolder = "Data"; //NOXLATE
+            lt.LayersPath = string.Empty;
+            lt.LayersFolder = "Layers"; //NOXLATE
+            lt.GenerateMaps = false;
+            lt.GenerateLayers = true;
+            lt.GenerateSpatialDataSources = true;
+            lt.SourceFile = new System.ComponentModel.BindingList<string>();
+        }
+
+        public static ILoadProcedure CreateDefaultSdf()
+        {
+            var proc = new LoadProcedure()
+            {
+                Item = new SdfLoadProcedureType() { Generalization = 100.0 }
+            };
+            ApplyDefaults(proc.Item);
+            return proc;
+        }
+
+        public static ILoadProcedure CreateDefaultShp()
+        {
+            var proc = new LoadProcedure()
+            {
+                Item = new ShpLoadProcedureType() { Generalization = 100.0, ConvertToSdf = false }
+            };
+            ApplyDefaults(proc.Item);
+            return proc;
+        }
+
+        public static ILoadProcedure CreateDefaultDwf()
+        {
+            var proc = new LoadProcedure()
+            {
+                Item = new DwfLoadProcedureType()
+            };
+            ApplyDefaults(proc.Item);
+            return proc;
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            return LoadProcedure.Deserialize(xml);
+        }
+
+        public static Stream Serialize(IResource res)
+        {
+            return res.SerializeToStream();
+        }
+
+#if LP220
+
+        public static ILoadProcedure CreateDefaultSqlite()
+        {
+            var proc = new LoadProcedure()
+            {
+                Item = new SQLiteLoadProcedureType() { Generalization = 100.0 }
+            };
+            ApplyDefaults(proc.Item);
+            return proc;
+        }
+
+#endif
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_1_0/LoadProcedureImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_1_0/LoadProcedureImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v1_1_0/LoadProcedureImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,261 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LP110
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LP110
+
+namespace OSGeo.MapGuide.ObjectModels.LoadProcedure.v1_1_0
+#elif LP220
+namespace OSGeo.MapGuide.ObjectModels.LoadProcedure.v2_2_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LoadProcedure.v1_0_0
+#endif
+{
+    partial class LoadProcedure : ILoadProcedure
+    {
+#if LP110
+        private static readonly Version RES_VERSION = new Version(1, 1, 0);
+#elif LP220
+        private static readonly Version RES_VERSION = new Version(2, 2, 0);
+#else
+        private static readonly Version RES_VERSION = new Version(1, 0, 0);
+#endif
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.LoadProcedure.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.LoadProcedure));
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.LoadProcedure.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        object ICloneable.Clone()
+        {
+            return this.Clone();
+        }
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")] //NOXLATE
+        public string ValidatingSchema
+        {
+#if LP110
+            get { return "LoadProcedure-1.1.0.xsd"; } //NOXLATE
+#elif LP220
+            get { return "LoadProcedure-2.2.0.xsd"; } //NOXLATE
+#else
+            get { return "LoadProcedure-1.0.0.xsd"; } //NOXLATE
+#endif
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        [XmlIgnore]
+        IBaseLoadProcedure ILoadProcedure.SubType
+        {
+            get { return (IBaseLoadProcedure)this.Item; }
+        }
+    }
+
+    abstract partial class LoadProcedureType : IBaseLoadProcedure
+    {
+        public void AddFile(string file)
+        {
+            if (!this.sourceFileField.Contains(file))
+            {
+                this.sourceFileField.Add(file);
+            }
+        }
+
+        public void AddFiles(IEnumerable<string> files)
+        {
+            Check.NotNull(files, "files"); //NOXLATE
+
+            var _files = this.sourceFileField;
+            foreach (var f in files)
+            {
+                if (!_files.Contains(f))
+                    _files.Add(f);
+            }
+        }
+
+        public void RemoveFile(string file)
+        {
+            Check.NotEmpty(file, "file"); //NOXLATE
+
+            if (this.sourceFileField.Contains(file))
+            {
+                this.sourceFileField.Remove(file);
+            }
+        }
+
+        [XmlIgnore]
+        bool? IBaseLoadProcedure.GenerateMaps
+        {
+            get
+            {
+                return this.GenerateMapsSpecified ?
+                    new Nullable<bool>(this.GenerateMaps) :
+                    null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.GenerateMaps = value.Value;
+                    this.GenerateMapsSpecified = true;
+                }
+                else
+                {
+                    this.GenerateMapsSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        bool? IBaseLoadProcedure.GenerateSymbolLibraries
+        {
+            get
+            {
+                return this.GenerateSymbolLibrariesSpecified ?
+                    new Nullable<bool>(this.GenerateSymbolLibraries) :
+                    null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.GenerateSymbolLibraries = value.Value;
+                    this.GenerateSymbolLibrariesSpecified = true;
+                }
+                else
+                {
+                    this.GenerateSymbolLibrariesSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public abstract LoadType Type { get; }
+    }
+
+    partial class SdfLoadProcedureType : ISdfLoadProcedure
+    {
+        [XmlIgnore]
+        public override LoadType Type
+        {
+            get { return LoadType.Sdf; }
+        }
+    }
+
+    partial class ShpLoadProcedureType : IShpLoadProcedure
+    {
+        [XmlIgnore]
+        public override LoadType Type
+        {
+            get { return LoadType.Shp; }
+        }
+    }
+
+    partial class DwfLoadProcedureType : IDwfLoadProcedure
+    {
+        [XmlIgnore]
+        public override LoadType Type
+        {
+            get { return LoadType.Dwf; }
+        }
+    }
+
+    partial class DwgLoadProcedureType : IDwgLoadProcedure
+    {
+        [XmlIgnore]
+        public override LoadType Type
+        {
+            get { return LoadType.Dwg; }
+        }
+    }
+
+    partial class RasterLoadProcedureType : IRasterLoadProcedure
+    {
+        [XmlIgnore]
+        public override LoadType Type
+        {
+            get { return LoadType.Raster; }
+        }
+    }
+
+#if LP220
+    partial class SQLiteLoadProcedureType : ISqliteLoadProcedure
+    {
+        [XmlIgnore]
+        public override LoadType Type
+        {
+            get { return LoadType.Sqlite; }
+        }
+    }
+#endif
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v2_4_0/LoadProcedureFactoryImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v2_4_0/LoadProcedureFactoryImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v2_4_0/LoadProcedureFactoryImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,117 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LP220
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LP110
+namespace OSGeo.MapGuide.ObjectModels.LoadProcedure.v1_1_0
+#elif LP220
+
+namespace OSGeo.MapGuide.ObjectModels.LoadProcedure.v2_2_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LoadProcedure.v1_0_0
+#endif
+{
+    /// <summary>
+    /// Helper class for registration with <see cref="OSGeo.MapGuide.ObjectModels.ObjectFactory"/> and <see cref="OSGeo.MapGuide.MaestroAPI.ResourceTypeRegistry"/> classes
+    /// </summary>
+    public static class LoadProcEntryPoint
+    {
+        private const string ARBITRARY_XYM = "LOCAL_CS[\"Non-Earth (Meter)\", LOCAL_DATUM[\"Local Datum\", 0], UNIT[\"Meter\", 1], AXIS[\"X\", EAST], AXIS[\"Y\", NORTH]]"; //NOXLATE
+
+        private static void ApplyDefaults(LoadProcedureType lt)
+        {
+            lt.RootPath = "Library://"; //NOXLATE
+            lt.CoordinateSystem = ARBITRARY_XYM;
+            lt.SpatialDataSourcesPath = string.Empty;
+            lt.SpatialDataSourcesFolder = "Data"; //NOXLATE
+            lt.LayersPath = string.Empty;
+            lt.LayersFolder = "Layers"; //NOXLATE
+            lt.GenerateMaps = false;
+            lt.GenerateLayers = true;
+            lt.GenerateSpatialDataSources = true;
+            lt.SourceFile = new System.ComponentModel.BindingList<string>();
+        }
+
+        public static ILoadProcedure CreateDefaultSdf()
+        {
+            var proc = new LoadProcedure()
+            {
+                Item = new SdfLoadProcedureType() { Generalization = 100.0 }
+            };
+            ApplyDefaults(proc.Item);
+            return proc;
+        }
+
+        public static ILoadProcedure CreateDefaultShp()
+        {
+            var proc = new LoadProcedure()
+            {
+                Item = new ShpLoadProcedureType() { Generalization = 100.0, ConvertToSdf = false }
+            };
+            ApplyDefaults(proc.Item);
+            return proc;
+        }
+
+        public static ILoadProcedure CreateDefaultDwf()
+        {
+            var proc = new LoadProcedure()
+            {
+                Item = new DwfLoadProcedureType()
+            };
+            ApplyDefaults(proc.Item);
+            return proc;
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            return LoadProcedure.Deserialize(xml);
+        }
+
+        public static Stream Serialize(IResource res)
+        {
+            return res.SerializeToStream();
+        }
+
+#if LP220
+
+        public static ILoadProcedure CreateDefaultSqlite()
+        {
+            var proc = new LoadProcedure()
+            {
+                Item = new SQLiteLoadProcedureType() { Generalization = 100.0 }
+            };
+            ApplyDefaults(proc.Item);
+            return proc;
+        }
+
+#endif
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v2_4_0/LoadProcedureImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v2_4_0/LoadProcedureImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/LoadProcedure/v2_4_0/LoadProcedureImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,263 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define LP220
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if LP110
+namespace OSGeo.MapGuide.ObjectModels.LoadProcedure.v1_1_0
+#elif LP220
+
+namespace OSGeo.MapGuide.ObjectModels.LoadProcedure.v2_2_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.LoadProcedure.v1_0_0
+#endif
+{
+    partial class LoadProcedure : ILoadProcedure
+    {
+#if LP110
+        private static readonly Version RES_VERSION = new Version(1, 1, 0);
+#elif LP220
+        private static readonly Version RES_VERSION = new Version(2, 2, 0);
+#else
+        private static readonly Version RES_VERSION = new Version(1, 0, 0);
+#endif
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.LoadProcedure.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.LoadProcedure));
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.LoadProcedure.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        object ICloneable.Clone()
+        {
+            return this.Clone();
+        }
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")] //NOXLATE
+        public string ValidatingSchema
+        {
+#if LP110
+            get { return "LoadProcedure-1.1.0.xsd"; } //NOXLATE
+#elif LP220
+            get { return "LoadProcedure-2.2.0.xsd"; } //NOXLATE
+#else
+            get { return "LoadProcedure-1.0.0.xsd"; } //NOXLATE
+#endif
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        [XmlIgnore]
+        IBaseLoadProcedure ILoadProcedure.SubType
+        {
+            get { return (IBaseLoadProcedure)this.Item; }
+        }
+    }
+
+    abstract partial class LoadProcedureType : IBaseLoadProcedure
+    {
+        public void AddFile(string file)
+        {
+            if (!this.sourceFileField.Contains(file))
+            {
+                this.sourceFileField.Add(file);
+            }
+        }
+
+        public void AddFiles(IEnumerable<string> files)
+        {
+            Check.NotNull(files, "files"); //NOXLATE
+
+            var _files = this.sourceFileField;
+            foreach (var f in files)
+            {
+                if (!_files.Contains(f))
+                    _files.Add(f);
+            }
+        }
+
+        public void RemoveFile(string file)
+        {
+            Check.NotEmpty(file, "file"); //NOXLATE
+
+            if (this.sourceFileField.Contains(file))
+            {
+                this.sourceFileField.Remove(file);
+            }
+        }
+
+        [XmlIgnore]
+        bool? IBaseLoadProcedure.GenerateMaps
+        {
+            get
+            {
+                return this.GenerateMapsSpecified ?
+                    new Nullable<bool>(this.GenerateMaps) :
+                    null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.GenerateMaps = value.Value;
+                    this.GenerateMapsSpecified = true;
+                }
+                else
+                {
+                    this.GenerateMapsSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        bool? IBaseLoadProcedure.GenerateSymbolLibraries
+        {
+            get
+            {
+                return this.GenerateSymbolLibrariesSpecified ?
+                    new Nullable<bool>(this.GenerateSymbolLibraries) :
+                    null;
+            }
+            set
+            {
+                if (value.HasValue)
+                {
+                    this.GenerateSymbolLibraries = value.Value;
+                    this.GenerateSymbolLibrariesSpecified = true;
+                }
+                else
+                {
+                    this.GenerateSymbolLibrariesSpecified = false;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        public abstract LoadType Type { get; }
+    }
+
+    partial class SdfLoadProcedureType : ISdfLoadProcedure
+    {
+        [XmlIgnore]
+        public override LoadType Type
+        {
+            get { return LoadType.Sdf; }
+        }
+    }
+
+    partial class ShpLoadProcedureType : IShpLoadProcedure
+    {
+        [XmlIgnore]
+        public override LoadType Type
+        {
+            get { return LoadType.Shp; }
+        }
+    }
+
+    partial class DwfLoadProcedureType : IDwfLoadProcedure
+    {
+        [XmlIgnore]
+        public override LoadType Type
+        {
+            get { return LoadType.Dwf; }
+        }
+    }
+
+    partial class DwgLoadProcedureType : IDwgLoadProcedure
+    {
+        [XmlIgnore]
+        public override LoadType Type
+        {
+            get { return LoadType.Dwg; }
+        }
+    }
+
+    partial class RasterLoadProcedureType : IRasterLoadProcedure
+    {
+        [XmlIgnore]
+        public override LoadType Type
+        {
+            get { return LoadType.Raster; }
+        }
+    }
+
+#if LP220
+
+    partial class SQLiteLoadProcedureType : ISqliteLoadProcedure
+    {
+        [XmlIgnore]
+        public override LoadType Type
+        {
+            get { return LoadType.Sqlite; }
+        }
+    }
+
+#endif
+}
\ No newline at end of file

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/MapDefinitionInterfaces.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/MapDefinitionInterfaces.cs	2014-12-25 13:55:42 UTC (rev 8462)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/MapDefinitionInterfaces.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -31,41 +31,16 @@
 
 namespace OSGeo.MapGuide.ObjectModels.MapDefinition
 {
-    public delegate void GetSpatialExtentsEventHandler(object sender, GetSpatialExtentsEventArgs e);
-
-    public class GetSpatialExtentsEventArgs
+    public class LayerExtent
     {
-        public GetSpatialExtentsEventArgs(string mapCoordSys)
-        {
-            this.MapCoordinateSystem = mapCoordSys;
-        }
+        public IEnvelope Extent { get; set; }
 
-        /// <summary>
-        /// Gets the extents of the requested layer in the Map's coordinate system. Handlers of this event should
-        /// set this property
-        /// </summary>
-        public IEnvelope Extents { get; set; }
-
-        /// <summary>
-        /// Gets or sets the coordinate system of the requested layer
-        /// </summary>
         public string LayerCoordinateSystem { get; set; }
+    }
 
-        /// <summary>
-        /// Gets whether a handler has set the requested information
-        /// </summary>
-        public bool IsSet
-        {
-            get
-            {
-                return this.Extents != null && !string.IsNullOrEmpty(this.LayerCoordinateSystem);
-            }
-        }
-
-        /// <summary>
-        /// Gets the Map Definition coordinate system
-        /// </summary>
-        public string MapCoordinateSystem { get; private set; }
+    public interface ILayerExtentCalculator
+    {
+        LayerExtent GetLayerExtent(string resourceID, string mapCoordSys);
     }
 
     /// <summary>
@@ -162,10 +137,7 @@
         /// <value>The map layers.</value>
         IEnumerable<IMapLayer> MapLayer { get; }
 
-        /// <summary>
-        /// Raised when a map layer is added
-        /// </summary>
-        event GetSpatialExtentsEventHandler RequestLayerExtents;
+        ILayerExtentCalculator ExtentCalculator { get; set; }
 
         /// <summary>
         /// Inserts a layer into this map at the specified index in the map's layer collection

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/v1_0_0/MapDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/v1_0_0/MapDefinitionImpl.cs	2014-12-25 13:55:42 UTC (rev 8462)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/v1_0_0/MapDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -20,6 +20,7 @@
 
 #endregion Disclaimer / License
 
+#define MDF_100
 using OSGeo.MapGuide.ObjectModels.Common;
 using OSGeo.MapGuide.ObjectModels.LayerDefinition;
 using System;
@@ -306,10 +307,8 @@
             return layer;
         }
 
-        /// <summary>
-        /// Raised when a layer has been added to this map definition
-        /// </summary>
-        public event GetSpatialExtentsEventHandler RequestLayerExtents;
+        [XmlIgnore]
+        public ILayerExtentCalculator ExtentCalculator { get; set; }
 
         private void OnFirstLayerAdded(MapLayerType layer)
         {
@@ -317,22 +316,21 @@
             if (!this.SetExtentsFromFirstAddedLayer)
                 return;
 
-            var h = this.RequestLayerExtents;
-            if (h != null)
+            var calc = this.ExtentCalculator;
+            if (calc != null)
             {
-                var e = new GetSpatialExtentsEventArgs(this.CoordinateSystem);
-                h(this, e);
-                if (e.IsSet)
+                var res = calc.GetLayerExtent(layer.ResourceId, this.CoordinateSystem);
+                if (res != null)
                 {
                     //Set the coordinate system if empty
                     if (string.IsNullOrEmpty(this.CoordinateSystem))
                     {
-                        this.CoordinateSystem = e.LayerCoordinateSystem;
+                        this.CoordinateSystem = res.LayerCoordinateSystem;
                     }
                     //Set the bounds if empty
                     if (IsEmpty(this.Extents))
                     {
-                        var env = e.Extents;
+                        var env = res.Extent;
                         ((IMapDefinition)this).SetExtents(env.MinX, env.MinY, env.MaxX, env.MaxY);
                     }
                 }

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/v2_3_0/MapDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/v2_3_0/MapDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/v2_3_0/MapDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,986 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define MDF_230
+using OSGeo.MapGuide.ObjectModels.Common;
+using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+using OSGeo.MapGuide.ObjectModels.WatermarkDefinition;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if MDF_240
+namespace OSGeo.MapGuide.ObjectModels.MapDefinition.v2_4_0
+#elif MDF_230
+
+namespace OSGeo.MapGuide.ObjectModels.MapDefinition.v2_3_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.MapDefinition.v1_0_0
+#endif
+{
+    partial class MapDefinitionType
+    {
+        internal MapDefinitionType()
+        {
+        }
+
+        [XmlIgnore]
+        public Color BackgroundColor
+        {
+            get
+            {
+                return this.backgroundColorField;
+            }
+            set
+            {
+                this.backgroundColorField = value;
+                OnPropertyChanged("BackgroundColor"); //NOXLATE
+            }
+        }
+
+        protected void DetachChangeListeners()
+        {
+            var handler = this.PropertyChanged;
+            if (handler != null)
+            {
+                foreach (var h in handler.GetInvocationList())
+                {
+                    this.PropertyChanged -= (PropertyChangedEventHandler)h;
+                }
+                handler = null;
+            }
+        }
+    }
+
+    public static class MdfEntryPoint
+    {
+        internal static MapDefinition CreateDefault()
+        {
+            return new MapDefinition()
+            {
+                Name = string.Empty,
+                CoordinateSystem = string.Empty,
+                Extents = new Box2DType() { MaxX = 0.0, MaxY = 0.0, MinX = 0.0, MinY = 0.0 },
+                BackgroundColor = Color.White,
+                MapLayer = new System.ComponentModel.BindingList<MapLayerType>(),
+                MapLayerGroup = new System.ComponentModel.BindingList<MapLayerGroupType>(),
+#if MDF_240
+                Watermarks = new BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_4_0.WatermarkType>()
+#elif MDF_230
+                Watermarks = new BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_3_0.WatermarkType>()
+#endif
+            };
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            var mdf = MapDefinition.Deserialize(xml);
+            foreach (var group in mdf.MapLayerGroup)
+            {
+                group.Parent = mdf;
+            }
+            return mdf;
+        }
+
+        public static Stream Serialize(IResource res)
+        {
+            return res.SerializeToStream();
+        }
+    }
+
+    partial class MapDefinition : IMapDefinition
+#if MDF_230 || MDF_240
+, IMapDefinition2
+#endif
+    {
+        internal MapDefinition()
+        {
+#if MDF_240
+            this.versionField = "2.4.0"; //NOXLATE
+#elif MDF_230
+            this.versionField = "2.3.0"; //NOXLATE
+#endif
+            this.SetExtentsFromFirstAddedLayer = false;
+        }
+
+#if MDF_240
+        private static readonly Version RES_VERSION = new Version(2, 4, 0);
+#elif MDF_230
+        private static readonly Version RES_VERSION = new Version(2, 3, 0);
+#else
+        private static readonly Version RES_VERSION = new Version(1, 0, 0);
+#endif
+
+        [XmlIgnore]
+        public bool SetExtentsFromFirstAddedLayer { get; set; }
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.MapDefinition.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.MapDefinition));
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public virtual string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.MapDefinition.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        internal void SortGroupList()
+        {
+        }
+
+        object ICloneable.Clone()
+        {
+            var mdf = this.Clone();
+            mdf.DetachChangeListeners();
+            return mdf;
+        }
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")] //NOXLATE
+        public string ValidatingSchema
+        {
+#if MDF_240
+            get { return "MapDefinition-2.4.0.xsd"; } //NOXLATE
+#elif MDF_230
+            get { return "MapDefinition-2.3.0.xsd"; } //NOXLATE
+#else
+            get { return "MapDefinition-1.0.0.xsd"; } //NOXLATE
+#endif
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        /// <summary>
+        /// Inserts the layer at the specified index
+        /// </summary>
+        /// <param name="idx"></param>
+        /// <param name="layer"></param>
+        void IMapDefinition.InsertLayer(int idx, IMapLayer layer)
+        {
+            Check.IntBetween(idx, 0, this.MapLayer.Count, true, "idx (" + idx + ") between [" + 0 + "," + this.MapLayer.Count + "]"); //NOXLATE
+            Check.NotNull(layer, "layer"); //NOXLATE
+            var li = layer as MapLayerType;
+            if (li != null)
+            {
+                this.MapLayer.Insert(idx, li);
+                li.Parent = this;
+            }
+        }
+
+        void IMapDefinition.SetExtents(double minx, double miny, double maxx, double maxy)
+        {
+            if (this.Extents == null)
+            {
+                var ext = new Box2DType()
+                {
+                    MaxX = maxx,
+                    MaxY = maxy,
+                    MinX = minx,
+                    MinY = miny
+                };
+                this.Extents = ext;
+            }
+            else
+            {
+                this.Extents.MaxX = maxx;
+                this.Extents.MaxY = maxy;
+                this.Extents.MinX = minx;
+                this.Extents.MinY = miny;
+                OnPropertyChanged("Extents"); //NOXLATE
+            }
+        }
+
+        public IMapLayerGroup AddGroup(string groupName)
+        {
+            Check.NotEmpty(groupName, "groupName"); //NOXLATE
+            Check.Precondition(this.GetGroupByName(groupName) == null, "<groupName> does not already exist"); //NOXLATE
+            if (this.MapLayerGroup == null)
+                this.MapLayerGroup = new System.ComponentModel.BindingList<MapLayerGroupType>();
+
+            var group = new MapLayerGroupType()
+            {
+                Parent = this,
+                ExpandInLegend = true,
+                LegendLabel = groupName,
+                Name = groupName,
+                ShowInLegend = true,
+                Visible = true,
+                Group = string.Empty
+            };
+            this.MapLayerGroup.Add(group);
+            OnPropertyChanged("MapLayerGroup"); //NOXLATE
+            return group;
+        }
+
+        public IMapLayer AddLayer(string groupName, string layerName, string layerDefinitionId)
+        {
+            Check.NotEmpty(layerName, "layerName"); //NOXLATE
+            Check.NotEmpty(layerDefinitionId, "layerDefinitionId"); //NOXLATE
+            Check.Precondition(ResourceIdentifier.Validate(layerDefinitionId), "ResourceIdentifier.Validate(layerDefinitionId)"); //NOXLATE
+            Check.Precondition(ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString(), "ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString()"); //NOXLATE
+            if (!string.IsNullOrEmpty(groupName))
+            {
+                Check.Precondition(this.GetGroupByName(groupName) != null, "There should be an existing group for <groupName>"); //NOXLATE
+            }
+            var layer = new MapLayerType()
+            {
+                Parent = this,
+                ExpandInLegend = true,
+                LegendLabel = layerName,
+                Name = layerName,
+                ResourceId = layerDefinitionId,
+                ShowInLegend = true,
+                Visible = true,
+                Selectable = true
+            };
+            layer.Group = string.IsNullOrEmpty(groupName) ? string.Empty : groupName;
+
+            this.MapLayer.Insert(0, layer);
+            OnPropertyChanged("MapLayer"); //NOXLATE
+
+            if (this.MapLayer.Count == 1) //First one
+            {
+                OnFirstLayerAdded(layer);
+            }
+
+            return layer;
+        }
+
+        [XmlIgnore]
+        public ILayerExtentCalculator ExtentCalculator { get; set; }
+
+        private void OnFirstLayerAdded(MapLayerType layer)
+        {
+            //Do nothing if this is false
+            if (!this.SetExtentsFromFirstAddedLayer)
+                return;
+
+            var calc = this.ExtentCalculator;
+            if (calc != null)
+            {
+                var res = calc.GetLayerExtent(layer.ResourceId, this.CoordinateSystem);
+                if (res != null)
+                {
+                    //Set the coordinate system if empty
+                    if (string.IsNullOrEmpty(this.CoordinateSystem))
+                    {
+                        this.CoordinateSystem = res.LayerCoordinateSystem;
+                    }
+                    //Set the bounds if empty
+                    if (IsEmpty(this.Extents))
+                    {
+                        var env = res.Extent;
+                        ((IMapDefinition)this).SetExtents(env.MinX, env.MinY, env.MaxX, env.MaxY);
+                    }
+                }
+            }
+        }
+
+        public IMapLayer InsertLayer(int index, string groupName, string layerName, string layerDefinitionId)
+        {
+            Check.IntBetween(index, 0, this.MapLayer.Count, true, "index (" + index + ") between [" + 0 + "," + this.MapLayer.Count + "]");
+            Check.NotEmpty(layerName, "layerName"); //NOXLATE
+            Check.NotEmpty(layerDefinitionId, "layerDefinitionId"); //NOXLATE
+            Check.Precondition(ResourceIdentifier.Validate(layerDefinitionId), "ResourceIdentifier.Validate(layerDefinitionId)"); //NOXLATE
+            Check.Precondition(ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString(), "ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString()"); //NOXLATE
+            if (!string.IsNullOrEmpty(groupName))
+            {
+                Check.NotNull(this.GetGroupByName(groupName), "Group for <groupName>"); //NOXLATE
+            }
+            var layer = new MapLayerType()
+            {
+                Parent = this,
+                ExpandInLegend = true,
+                LegendLabel = layerName,
+                Name = layerName,
+                ResourceId = layerDefinitionId,
+                ShowInLegend = true,
+                Visible = true,
+                Selectable = true
+            };
+            layer.Group = string.IsNullOrEmpty(groupName) ? string.Empty : groupName;
+            this.MapLayer.Insert(index, layer);
+            return layer;
+        }
+
+        public IMapLayer AddLayer(IMapLayer layerToInsertAbove, string groupName, string layerName, string layerDefinitionId)
+        {
+            Check.NotEmpty(layerName, "layerName"); //NOXLATE
+            Check.NotEmpty(layerDefinitionId, "layerDefinitionId"); //NOXLATE
+            Check.Precondition(ResourceIdentifier.Validate(layerDefinitionId), "ResourceIdentifier.Validate(layerDefinitionId)"); //NOXLATE
+            Check.Precondition(ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString(), "ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString()"); //NOXLATE
+            if (!string.IsNullOrEmpty(groupName))
+            {
+                Check.NotNull(this.GetGroupByName(groupName), "Group for <groupName>"); //NOXLATE
+            }
+            var layer = new MapLayerType()
+            {
+                Parent = this,
+                ExpandInLegend = true,
+                LegendLabel = layerName,
+                Name = layerName,
+                ResourceId = layerDefinitionId,
+                ShowInLegend = true,
+                Visible = true,
+                Selectable = true
+            };
+            layer.Group = string.IsNullOrEmpty(groupName) ? string.Empty : groupName;
+
+            if (layerToInsertAbove != null)
+            {
+                var clayerToInsertAbove = layerToInsertAbove as MapLayerType;
+                if (clayerToInsertAbove != null)
+                {
+                    var idx = this.MapLayer.IndexOf(clayerToInsertAbove);
+                    if (idx >= 0)
+                    {
+                        this.MapLayer.Insert(idx, layer);
+                    }
+                    else
+                    {
+                        this.MapLayer.Add(layer);
+                    }
+                }
+                else
+                {
+                    this.MapLayer.Add(layer);
+                }
+            }
+            else
+            {
+                this.MapLayer.Add(layer);
+            }
+            OnPropertyChanged("MapLayer"); //NOXLATE
+
+            if (this.MapLayer.Count == 1) //First one
+            {
+                OnFirstLayerAdded(layer);
+            }
+
+            return layer;
+        }
+
+        private static bool IsEmpty(Box2DType box2DType)
+        {
+            return box2DType == null ||
+                (box2DType.MaxX == 0.0 &&
+                box2DType.MaxY == 0.0 &&
+                box2DType.MinX == 0.0 &&
+                box2DType.MinY == 0.0);
+        }
+
+        [XmlIgnore]
+        OSGeo.MapGuide.ObjectModels.Common.IEnvelope IMapDefinition.Extents
+        {
+            get
+            {
+                return this.Extents;
+            }
+            set
+            {
+                if (value == null)
+                {
+                    this.Extents = null;
+                }
+                else
+                {
+                    if (this.Extents == null)
+                        this.Extents = new Box2DType();
+
+                    this.Extents.MaxX = value.MaxX;
+                    this.Extents.MaxY = value.MaxY;
+                    this.Extents.MinX = value.MinX;
+                    this.Extents.MinY = value.MinY;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        IBaseMapDefinition IMapDefinition.BaseMap
+        {
+            get
+            {
+                return (IBaseMapDefinition)this.BaseMapDefinition;
+            }
+        }
+
+        void IMapDefinition.InitBaseMap()
+        {
+            if (this.BaseMapDefinition == null)
+            {
+                this.BaseMapDefinition = new MapDefinitionTypeBaseMapDefinition()
+                {
+                    Parent = (IMapDefinition)this,
+                    BaseMapLayerGroup = new System.ComponentModel.BindingList<BaseMapLayerGroupCommonType>(),
+                    FiniteDisplayScale = new System.ComponentModel.BindingList<double>()
+                };
+            }
+        }
+
+        void IMapDefinition.RemoveBaseMap()
+        {
+            this.BaseMapDefinition = null;
+        }
+
+        [XmlIgnore]
+        IEnumerable<IMapLayer> IMapDefinition.MapLayer
+        {
+            get
+            {
+                foreach (var layer in this.MapLayer)
+                {
+                    yield return layer;
+                }
+            }
+        }
+
+        void IMapDefinition.RemoveLayer(IMapLayer layer)
+        {
+            var lyr = layer as MapLayerType;
+            if (lyr != null)
+            {
+                this.MapLayer.Remove(lyr);
+                OnPropertyChanged("MapLayer"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IMapLayerGroup> IMapDefinition.MapLayerGroup
+        {
+            get
+            {
+                foreach (var grp in this.MapLayerGroup)
+                {
+                    yield return grp;
+                }
+            }
+        }
+
+        void IMapDefinition.RemoveGroup(IMapLayerGroup group)
+        {
+            Check.NotNull(group, "group"); //NOXLATE
+            var grp = group as MapLayerGroupType;
+            if (grp != null)
+            {
+                this.MapLayerGroup.Remove(grp);
+                OnPropertyChanged("MapLayerGroup"); //NOXLATE
+            }
+        }
+
+        void IMapDefinition.RemoveAllGroups()
+        {
+            this.MapLayerGroup.Clear();
+        }
+
+        void IMapDefinition.RemoveAllLayers()
+        {
+            this.MapLayer.Clear();
+        }
+
+        int IMapDefinition.GetIndex(IMapLayer layer)
+        {
+            Check.NotNull(layer, "layer"); //NOXLATE
+            var lyr = layer as MapLayerType;
+            if (lyr != null)
+                return this.MapLayer.IndexOf(lyr);
+
+            return -1;
+        }
+
+        int IMapDefinition.MoveUp(IMapLayer layer)
+        {
+            Check.NotNull(layer, "layer"); //NOXLATE
+            int isrc = ((IMapDefinition)this).GetIndex(layer);
+            if (isrc > 0)
+            {
+                int idst = isrc - 1;
+
+                var src = this.MapLayer[isrc];
+                var dst = this.MapLayer[idst];
+
+                this.MapLayer[isrc] = dst;
+                this.MapLayer[idst] = src;
+
+                OnPropertyChanged("MapLayer"); //NOXLATE
+
+                return idst;
+            }
+            else if (isrc == 0)
+            {
+                return isrc; //Unchanged
+            }
+
+            return -1;
+        }
+
+        int IMapDefinition.MoveDown(IMapLayer layer)
+        {
+            Check.NotNull(layer, "layer"); //NOXLATE
+            int isrc = ((IMapDefinition)this).GetIndex(layer);
+            if (isrc < this.MapLayer.Count - 1)
+            {
+                int idst = isrc + 1;
+
+                var src = this.MapLayer[isrc];
+                var dst = this.MapLayer[idst];
+
+                this.MapLayer[isrc] = dst;
+                this.MapLayer[idst] = src;
+
+                OnPropertyChanged("MapLayer"); //NOXLATE
+
+                return idst;
+            }
+            else if (isrc == this.MapLayer.Count - 1)
+            {
+                return this.MapLayer.Count - 1; //Unchanged
+            }
+
+            return -1;
+        }
+
+        int IMapDefinition.MoveUpGroup(IMapLayerGroup group)
+        {
+            Check.NotNull(group, "group"); //NOXLATE
+            var grp = group as MapLayerGroupType;
+            if (grp != null)
+            {
+                var idx = this.MapLayerGroup.IndexOf(grp);
+                if (idx > 0)
+                {
+                    int idst = idx - 1;
+
+                    var src = this.MapLayerGroup[idx];
+                    var dst = this.MapLayerGroup[idst];
+
+                    this.MapLayerGroup[idx] = dst;
+                    this.MapLayerGroup[idst] = src;
+
+                    OnPropertyChanged("MapLayerGroup"); //NOXLATE
+
+                    return idst;
+                }
+                else if (idx == 0)
+                {
+                    return idx; //Unchanged
+                }
+            }
+
+            return -1;
+        }
+
+        int IMapDefinition.MoveDownGroup(IMapLayerGroup group)
+        {
+            Check.NotNull(group, "group"); //NOXLATE
+            var grp = group as MapLayerGroupType;
+            if (grp != null)
+            {
+                var idx = this.MapLayerGroup.IndexOf(grp);
+                if (idx < this.MapLayerGroup.Count - 1)
+                {
+                    int idst = idx + 1;
+
+                    var src = this.MapLayerGroup[idx];
+                    var dst = this.MapLayerGroup[idst];
+
+                    this.MapLayerGroup[idx] = dst;
+                    this.MapLayerGroup[idst] = src;
+
+                    OnPropertyChanged("MapLayerGroup"); //NOXLATE
+
+                    return idst;
+                }
+                else if (idx == this.MapLayerGroup.Count - 1)
+                {
+                    return this.MapLayerGroup.Count - 1; //Unchanged
+                }
+            }
+
+            return -1;
+        }
+
+        int IMapDefinition.GetIndex(IMapLayerGroup group)
+        {
+            Check.NotNull(group, "group"); //NOXLATE
+            var grp = group as MapLayerGroupType;
+            if (grp != null)
+                return this.MapLayerGroup.IndexOf(grp);
+
+            return -1;
+        }
+
+        void IMapDefinition.SetTopDrawOrder(IMapLayer layer)
+        {
+            Check.NotNull(layer, "layer"); //NOXLATE
+            int isrc = ((IMapDefinition)this).GetIndex(layer);
+            if (isrc > 0)
+            {
+                var src = this.MapLayer[isrc];
+
+                //take everything before this and shift them up one position
+                for (int i = isrc - 1; i >= 0; i--)
+                {
+                    this.MapLayer[i + 1] = this.MapLayer[i];
+                }
+
+                this.MapLayer[0] = src;
+                OnPropertyChanged("MapLayer"); //NOXLATE
+            }
+        }
+
+        void IMapDefinition.SetBottomDrawOrder(IMapLayer layer)
+        {
+            Check.NotNull(layer, "layer"); //NOXLATE
+            int isrc = ((IMapDefinition)this).GetIndex(layer);
+            if (isrc >= 0 && isrc < this.MapLayer.Count)
+            {
+                var src = this.MapLayer[isrc];
+
+                //take everything after this and shift them down one position
+                for (int i = isrc + 1; i < this.MapLayer.Count; i++)
+                {
+                    this.MapLayer[i - 1] = this.MapLayer[i];
+                }
+
+                this.MapLayer[this.MapLayer.Count - 1] = src;
+                OnPropertyChanged("MapLayer"); //NOXLATE
+            }
+        }
+
+#if MDF_230 || MDF_240
+
+        IEnumerable<IWatermark> IWatermarkCollection.Watermarks
+        {
+            get
+            {
+                foreach (var wm in this.Watermarks)
+                    yield return wm;
+            }
+        }
+
+        IWatermark IWatermarkCollection.AddWatermark(IWatermarkDefinition watermark)
+        {
+            return WatermarkCollectionUtil.AddWatermark(this.Watermarks, watermark);
+        }
+
+        void IWatermarkCollection.RemoveWatermark(IWatermark watermark)
+        {
+            WatermarkCollectionUtil.RemoveWatermark(this.Watermarks, watermark);
+        }
+
+        int IWatermarkCollection.WatermarkCount
+        {
+            get { return this.Watermarks.Count; }
+        }
+
+#endif
+    }
+
+    partial class Box2DType : IEnvelope
+    { }
+
+    partial class MapDefinitionTypeBaseMapDefinition : IBaseMapDefinition
+    {
+        [XmlIgnore]
+        public IMapDefinition Parent
+        {
+            get;
+            set;
+        }
+
+        void IBaseMapDefinition.RemoveScaleAt(int index)
+        {
+            this.FiniteDisplayScale.RemoveAt(index);
+        }
+
+        double IBaseMapDefinition.GetScaleAt(int index)
+        {
+            return this.FiniteDisplayScale[index];
+        }
+
+        [XmlIgnore]
+        int IBaseMapDefinition.GroupCount
+        {
+            get { return this.BaseMapLayerGroup.Count; }
+        }
+
+        IBaseMapGroup IBaseMapDefinition.GetGroupAt(int index)
+        {
+            return this.BaseMapLayerGroup[index];
+        }
+
+        [XmlIgnore]
+        int IBaseMapDefinition.ScaleCount
+        {
+            get { return this.FiniteDisplayScale.Count; }
+        }
+
+        [XmlIgnore]
+        IEnumerable<double> IBaseMapDefinition.FiniteDisplayScale
+        {
+            get
+            {
+                foreach (var scale in this.FiniteDisplayScale)
+                {
+                    yield return scale;
+                }
+            }
+        }
+
+        public void AddFiniteDisplayScale(double value)
+        {
+            this.FiniteDisplayScale.Add(value);
+        }
+
+        public void RemoveFiniteDisplayScale(double value)
+        {
+            this.FiniteDisplayScale.Remove(value);
+        }
+
+        void IBaseMapDefinition.RemoveAllScales()
+        {
+            this.FiniteDisplayScale.Clear();
+            OnPropertyChanged("FiniteDisplayScale"); //NOXLATE
+        }
+
+        [XmlIgnore]
+        IEnumerable<IBaseMapGroup> IBaseMapDefinition.BaseMapLayerGroup
+        {
+            get
+            {
+                foreach (var grp in this.BaseMapLayerGroup)
+                {
+                    yield return grp;
+                }
+            }
+        }
+
+        public IBaseMapGroup AddBaseLayerGroup(string name)
+        {
+            var grp = new BaseMapLayerGroupCommonType()
+            {
+                Parent = this.Parent,
+                Name = name,
+                BaseMapLayer = new System.ComponentModel.BindingList<BaseMapLayerType>(),
+                ExpandInLegend = true,
+                ShowInLegend = true,
+                LegendLabel = name,
+                Visible = true
+            };
+            this.BaseMapLayerGroup.Add(grp);
+
+            return grp;
+        }
+
+        public void RemoveBaseLayerGroup(IBaseMapGroup group)
+        {
+            var grp = group as BaseMapLayerGroupCommonType;
+            if (grp != null)
+                this.BaseMapLayerGroup.Remove(grp);
+        }
+    }
+
+    partial class MapLayerType : IMapLayer
+    {
+    }
+
+    partial class BaseMapLayerType : IBaseMapLayer
+    {
+        [XmlIgnore]
+        public IMapDefinition Parent
+        {
+            get;
+            set;
+        }
+    }
+
+    partial class MapLayerGroupType : IMapLayerGroup
+    {
+        [XmlIgnore]
+        public IMapDefinition Parent
+        {
+            get;
+            set;
+        }
+    }
+
+    partial class BaseMapLayerGroupCommonType : IBaseMapGroup
+    {
+        [XmlIgnore]
+        public IMapDefinition Parent
+        {
+            get;
+            set;
+        }
+
+        [XmlIgnore]
+        IEnumerable<IBaseMapLayer> IBaseMapGroup.BaseMapLayer
+        {
+            get
+            {
+                foreach (var lyr in this.BaseMapLayer)
+                {
+                    yield return lyr;
+                }
+            }
+        }
+
+        public int GetIndex(IBaseMapLayer layer)
+        {
+            var bl = layer as BaseMapLayerType;
+            if (bl != null)
+            {
+                return this.BaseMapLayer.IndexOf(bl);
+            }
+            return -1;
+        }
+
+        public void InsertLayer(int index, IBaseMapLayer layer)
+        {
+            var bl = layer as BaseMapLayerType;
+            if (bl != null)
+            {
+                this.BaseMapLayer.Insert(index, bl);
+            }
+        }
+
+        public IBaseMapLayer AddLayer(string layerName, string resourceId)
+        {
+            BaseMapLayerType layer = new BaseMapLayerType()
+            {
+                Parent = this.Parent,
+                ExpandInLegend = true,
+                LegendLabel = layerName,
+                Name = layerName,
+                ResourceId = resourceId,
+                ShowInLegend = true,
+                Selectable = true
+            };
+            this.BaseMapLayer.Add(layer);
+            OnPropertyChanged("BaseMapLayer"); //NOXLATE
+            return layer;
+        }
+
+        public void RemoveBaseMapLayer(IBaseMapLayer layer)
+        {
+            var lyr = layer as BaseMapLayerType;
+            if (lyr != null)
+            {
+                this.BaseMapLayer.Remove(lyr);
+                OnPropertyChanged("BaseMapLayer"); //NOXLATE
+            }
+        }
+
+        int IBaseMapGroup.MoveUp(IBaseMapLayer layer)
+        {
+            var lyr = layer as BaseMapLayerType;
+            if (lyr != null)
+            {
+                int isrc = this.BaseMapLayer.IndexOf(lyr);
+                if (isrc > 0)
+                {
+                    int idst = isrc - 1;
+                    var src = this.BaseMapLayer[isrc];
+                    var dst = this.BaseMapLayer[idst];
+
+                    //swap
+                    this.BaseMapLayer[isrc] = dst;
+                    this.BaseMapLayer[idst] = src;
+
+                    OnPropertyChanged("BaseMapLayer"); //NOXLATE
+
+                    return idst;
+                }
+            }
+
+            return -1;
+        }
+
+        int IBaseMapGroup.MoveDown(IBaseMapLayer layer)
+        {
+            var lyr = layer as BaseMapLayerType;
+            if (lyr != null)
+            {
+                int isrc = this.BaseMapLayer.IndexOf(lyr);
+                if (isrc < this.BaseMapLayer.Count - 1)
+                {
+                    int idst = isrc + 1;
+                    var src = this.BaseMapLayer[isrc];
+                    var dst = this.BaseMapLayer[idst];
+
+                    //swap
+                    this.BaseMapLayer[isrc] = dst;
+                    this.BaseMapLayer[idst] = src;
+
+                    OnPropertyChanged("BaseMapLayer"); //NOXLATE
+
+                    return idst;
+                }
+            }
+
+            return -1;
+        }
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/v2_4_0/MapDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/v2_4_0/MapDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/MapDefinition/v2_4_0/MapDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,987 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define MDF_240
+using OSGeo.MapGuide.ObjectModels.Common;
+using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+using OSGeo.MapGuide.ObjectModels.WatermarkDefinition;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if MDF_240
+
+namespace OSGeo.MapGuide.ObjectModels.MapDefinition.v2_4_0
+#elif MDF_230
+
+namespace OSGeo.MapGuide.ObjectModels.MapDefinition.v2_3_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.MapDefinition.v1_0_0
+#endif
+{
+    partial class MapDefinitionType
+    {
+        internal MapDefinitionType()
+        {
+        }
+
+        [XmlIgnore]
+        public Color BackgroundColor
+        {
+            get
+            {
+                return this.backgroundColorField;
+            }
+            set
+            {
+                this.backgroundColorField = value;
+                OnPropertyChanged("BackgroundColor"); //NOXLATE
+            }
+        }
+
+        protected void DetachChangeListeners()
+        {
+            var handler = this.PropertyChanged;
+            if (handler != null)
+            {
+                foreach (var h in handler.GetInvocationList())
+                {
+                    this.PropertyChanged -= (PropertyChangedEventHandler)h;
+                }
+                handler = null;
+            }
+        }
+    }
+
+    public static class MdfEntryPoint
+    {
+        internal static MapDefinition CreateDefault()
+        {
+            return new MapDefinition()
+            {
+                Name = string.Empty,
+                CoordinateSystem = string.Empty,
+                Extents = new Box2DType() { MaxX = 0.0, MaxY = 0.0, MinX = 0.0, MinY = 0.0 },
+                BackgroundColor = Color.White,
+                MapLayer = new System.ComponentModel.BindingList<MapLayerType>(),
+                MapLayerGroup = new System.ComponentModel.BindingList<MapLayerGroupType>(),
+#if MDF_240
+                Watermarks = new BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_4_0.WatermarkType>()
+#elif MDF_230
+                Watermarks = new BindingList<OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_3_0.WatermarkType>()
+#endif
+            };
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            var mdf = MapDefinition.Deserialize(xml);
+            foreach (var group in mdf.MapLayerGroup)
+            {
+                group.Parent = mdf;
+            }
+            return mdf;
+        }
+
+        public static Stream Serialize(IResource res)
+        {
+            return res.SerializeToStream();
+        }
+    }
+
+    partial class MapDefinition : IMapDefinition
+#if MDF_230 || MDF_240
+, IMapDefinition2
+#endif
+    {
+        internal MapDefinition()
+        {
+#if MDF_240
+            this.versionField = "2.4.0"; //NOXLATE
+#elif MDF_230
+            this.versionField = "2.3.0"; //NOXLATE
+#endif
+            this.SetExtentsFromFirstAddedLayer = false;
+        }
+
+#if MDF_240
+        private static readonly Version RES_VERSION = new Version(2, 4, 0);
+#elif MDF_230
+        private static readonly Version RES_VERSION = new Version(2, 3, 0);
+#else
+        private static readonly Version RES_VERSION = new Version(1, 0, 0);
+#endif
+
+        [XmlIgnore]
+        public bool SetExtentsFromFirstAddedLayer { get; set; }
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.MapDefinition.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.MapDefinition));
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public virtual string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.MapDefinition.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        internal void SortGroupList()
+        {
+        }
+
+        object ICloneable.Clone()
+        {
+            var mdf = this.Clone();
+            mdf.DetachChangeListeners();
+            return mdf;
+        }
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")] //NOXLATE
+        public string ValidatingSchema
+        {
+#if MDF_240
+            get { return "MapDefinition-2.4.0.xsd"; } //NOXLATE
+#elif MDF_230
+            get { return "MapDefinition-2.3.0.xsd"; } //NOXLATE
+#else
+            get { return "MapDefinition-1.0.0.xsd"; } //NOXLATE
+#endif
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        /// <summary>
+        /// Inserts the layer at the specified index
+        /// </summary>
+        /// <param name="idx"></param>
+        /// <param name="layer"></param>
+        void IMapDefinition.InsertLayer(int idx, IMapLayer layer)
+        {
+            Check.IntBetween(idx, 0, this.MapLayer.Count, true, "idx (" + idx + ") between [" + 0 + "," + this.MapLayer.Count + "]"); //NOXLATE
+            Check.NotNull(layer, "layer"); //NOXLATE
+            var li = layer as MapLayerType;
+            if (li != null)
+            {
+                this.MapLayer.Insert(idx, li);
+                li.Parent = this;
+            }
+        }
+
+        void IMapDefinition.SetExtents(double minx, double miny, double maxx, double maxy)
+        {
+            if (this.Extents == null)
+            {
+                var ext = new Box2DType()
+                {
+                    MaxX = maxx,
+                    MaxY = maxy,
+                    MinX = minx,
+                    MinY = miny
+                };
+                this.Extents = ext;
+            }
+            else
+            {
+                this.Extents.MaxX = maxx;
+                this.Extents.MaxY = maxy;
+                this.Extents.MinX = minx;
+                this.Extents.MinY = miny;
+                OnPropertyChanged("Extents"); //NOXLATE
+            }
+        }
+
+        public IMapLayerGroup AddGroup(string groupName)
+        {
+            Check.NotEmpty(groupName, "groupName"); //NOXLATE
+            Check.Precondition(this.GetGroupByName(groupName) == null, "<groupName> does not already exist"); //NOXLATE
+            if (this.MapLayerGroup == null)
+                this.MapLayerGroup = new System.ComponentModel.BindingList<MapLayerGroupType>();
+
+            var group = new MapLayerGroupType()
+            {
+                Parent = this,
+                ExpandInLegend = true,
+                LegendLabel = groupName,
+                Name = groupName,
+                ShowInLegend = true,
+                Visible = true,
+                Group = string.Empty
+            };
+            this.MapLayerGroup.Add(group);
+            OnPropertyChanged("MapLayerGroup"); //NOXLATE
+            return group;
+        }
+
+        public IMapLayer AddLayer(string groupName, string layerName, string layerDefinitionId)
+        {
+            Check.NotEmpty(layerName, "layerName"); //NOXLATE
+            Check.NotEmpty(layerDefinitionId, "layerDefinitionId"); //NOXLATE
+            Check.Precondition(ResourceIdentifier.Validate(layerDefinitionId), "ResourceIdentifier.Validate(layerDefinitionId)"); //NOXLATE
+            Check.Precondition(ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString(), "ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString()"); //NOXLATE
+            if (!string.IsNullOrEmpty(groupName))
+            {
+                Check.Precondition(this.GetGroupByName(groupName) != null, "There should be an existing group for <groupName>"); //NOXLATE
+            }
+            var layer = new MapLayerType()
+            {
+                Parent = this,
+                ExpandInLegend = true,
+                LegendLabel = layerName,
+                Name = layerName,
+                ResourceId = layerDefinitionId,
+                ShowInLegend = true,
+                Visible = true,
+                Selectable = true
+            };
+            layer.Group = string.IsNullOrEmpty(groupName) ? string.Empty : groupName;
+
+            this.MapLayer.Insert(0, layer);
+            OnPropertyChanged("MapLayer"); //NOXLATE
+
+            if (this.MapLayer.Count == 1) //First one
+            {
+                OnFirstLayerAdded(layer);
+            }
+
+            return layer;
+        }
+
+        [XmlIgnore]
+        public ILayerExtentCalculator ExtentCalculator { get; set; }
+
+        private void OnFirstLayerAdded(MapLayerType layer)
+        {
+            //Do nothing if this is false
+            if (!this.SetExtentsFromFirstAddedLayer)
+                return;
+
+            var calc = this.ExtentCalculator;
+            if (calc != null)
+            {
+                var res = calc.GetLayerExtent(layer.ResourceId, this.CoordinateSystem);
+                if (res != null)
+                {
+                    //Set the coordinate system if empty
+                    if (string.IsNullOrEmpty(this.CoordinateSystem))
+                    {
+                        this.CoordinateSystem = res.LayerCoordinateSystem;
+                    }
+                    //Set the bounds if empty
+                    if (IsEmpty(this.Extents))
+                    {
+                        var env = res.Extent;
+                        ((IMapDefinition)this).SetExtents(env.MinX, env.MinY, env.MaxX, env.MaxY);
+                    }
+                }
+            }
+        }
+
+        public IMapLayer InsertLayer(int index, string groupName, string layerName, string layerDefinitionId)
+        {
+            Check.IntBetween(index, 0, this.MapLayer.Count, true, "index (" + index + ") between [" + 0 + "," + this.MapLayer.Count + "]");
+            Check.NotEmpty(layerName, "layerName"); //NOXLATE
+            Check.NotEmpty(layerDefinitionId, "layerDefinitionId"); //NOXLATE
+            Check.Precondition(ResourceIdentifier.Validate(layerDefinitionId), "ResourceIdentifier.Validate(layerDefinitionId)"); //NOXLATE
+            Check.Precondition(ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString(), "ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString()"); //NOXLATE
+            if (!string.IsNullOrEmpty(groupName))
+            {
+                Check.NotNull(this.GetGroupByName(groupName), "Group for <groupName>"); //NOXLATE
+            }
+            var layer = new MapLayerType()
+            {
+                Parent = this,
+                ExpandInLegend = true,
+                LegendLabel = layerName,
+                Name = layerName,
+                ResourceId = layerDefinitionId,
+                ShowInLegend = true,
+                Visible = true,
+                Selectable = true
+            };
+            layer.Group = string.IsNullOrEmpty(groupName) ? string.Empty : groupName;
+            this.MapLayer.Insert(index, layer);
+            return layer;
+        }
+
+        public IMapLayer AddLayer(IMapLayer layerToInsertAbove, string groupName, string layerName, string layerDefinitionId)
+        {
+            Check.NotEmpty(layerName, "layerName"); //NOXLATE
+            Check.NotEmpty(layerDefinitionId, "layerDefinitionId"); //NOXLATE
+            Check.Precondition(ResourceIdentifier.Validate(layerDefinitionId), "ResourceIdentifier.Validate(layerDefinitionId)"); //NOXLATE
+            Check.Precondition(ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString(), "ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString()"); //NOXLATE
+            if (!string.IsNullOrEmpty(groupName))
+            {
+                Check.NotNull(this.GetGroupByName(groupName), "Group for <groupName>"); //NOXLATE
+            }
+            var layer = new MapLayerType()
+            {
+                Parent = this,
+                ExpandInLegend = true,
+                LegendLabel = layerName,
+                Name = layerName,
+                ResourceId = layerDefinitionId,
+                ShowInLegend = true,
+                Visible = true,
+                Selectable = true
+            };
+            layer.Group = string.IsNullOrEmpty(groupName) ? string.Empty : groupName;
+
+            if (layerToInsertAbove != null)
+            {
+                var clayerToInsertAbove = layerToInsertAbove as MapLayerType;
+                if (clayerToInsertAbove != null)
+                {
+                    var idx = this.MapLayer.IndexOf(clayerToInsertAbove);
+                    if (idx >= 0)
+                    {
+                        this.MapLayer.Insert(idx, layer);
+                    }
+                    else
+                    {
+                        this.MapLayer.Add(layer);
+                    }
+                }
+                else
+                {
+                    this.MapLayer.Add(layer);
+                }
+            }
+            else
+            {
+                this.MapLayer.Add(layer);
+            }
+            OnPropertyChanged("MapLayer"); //NOXLATE
+
+            if (this.MapLayer.Count == 1) //First one
+            {
+                OnFirstLayerAdded(layer);
+            }
+
+            return layer;
+        }
+
+        private static bool IsEmpty(Box2DType box2DType)
+        {
+            return box2DType == null ||
+                (box2DType.MaxX == 0.0 &&
+                box2DType.MaxY == 0.0 &&
+                box2DType.MinX == 0.0 &&
+                box2DType.MinY == 0.0);
+        }
+
+        [XmlIgnore]
+        OSGeo.MapGuide.ObjectModels.Common.IEnvelope IMapDefinition.Extents
+        {
+            get
+            {
+                return this.Extents;
+            }
+            set
+            {
+                if (value == null)
+                {
+                    this.Extents = null;
+                }
+                else
+                {
+                    if (this.Extents == null)
+                        this.Extents = new Box2DType();
+
+                    this.Extents.MaxX = value.MaxX;
+                    this.Extents.MaxY = value.MaxY;
+                    this.Extents.MinX = value.MinX;
+                    this.Extents.MinY = value.MinY;
+                }
+            }
+        }
+
+        [XmlIgnore]
+        IBaseMapDefinition IMapDefinition.BaseMap
+        {
+            get
+            {
+                return (IBaseMapDefinition)this.BaseMapDefinition;
+            }
+        }
+
+        void IMapDefinition.InitBaseMap()
+        {
+            if (this.BaseMapDefinition == null)
+            {
+                this.BaseMapDefinition = new MapDefinitionTypeBaseMapDefinition()
+                {
+                    Parent = (IMapDefinition)this,
+                    BaseMapLayerGroup = new System.ComponentModel.BindingList<BaseMapLayerGroupCommonType>(),
+                    FiniteDisplayScale = new System.ComponentModel.BindingList<double>()
+                };
+            }
+        }
+
+        void IMapDefinition.RemoveBaseMap()
+        {
+            this.BaseMapDefinition = null;
+        }
+
+        [XmlIgnore]
+        IEnumerable<IMapLayer> IMapDefinition.MapLayer
+        {
+            get
+            {
+                foreach (var layer in this.MapLayer)
+                {
+                    yield return layer;
+                }
+            }
+        }
+
+        void IMapDefinition.RemoveLayer(IMapLayer layer)
+        {
+            var lyr = layer as MapLayerType;
+            if (lyr != null)
+            {
+                this.MapLayer.Remove(lyr);
+                OnPropertyChanged("MapLayer"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IMapLayerGroup> IMapDefinition.MapLayerGroup
+        {
+            get
+            {
+                foreach (var grp in this.MapLayerGroup)
+                {
+                    yield return grp;
+                }
+            }
+        }
+
+        void IMapDefinition.RemoveGroup(IMapLayerGroup group)
+        {
+            Check.NotNull(group, "group"); //NOXLATE
+            var grp = group as MapLayerGroupType;
+            if (grp != null)
+            {
+                this.MapLayerGroup.Remove(grp);
+                OnPropertyChanged("MapLayerGroup"); //NOXLATE
+            }
+        }
+
+        void IMapDefinition.RemoveAllGroups()
+        {
+            this.MapLayerGroup.Clear();
+        }
+
+        void IMapDefinition.RemoveAllLayers()
+        {
+            this.MapLayer.Clear();
+        }
+
+        int IMapDefinition.GetIndex(IMapLayer layer)
+        {
+            Check.NotNull(layer, "layer"); //NOXLATE
+            var lyr = layer as MapLayerType;
+            if (lyr != null)
+                return this.MapLayer.IndexOf(lyr);
+
+            return -1;
+        }
+
+        int IMapDefinition.MoveUp(IMapLayer layer)
+        {
+            Check.NotNull(layer, "layer"); //NOXLATE
+            int isrc = ((IMapDefinition)this).GetIndex(layer);
+            if (isrc > 0)
+            {
+                int idst = isrc - 1;
+
+                var src = this.MapLayer[isrc];
+                var dst = this.MapLayer[idst];
+
+                this.MapLayer[isrc] = dst;
+                this.MapLayer[idst] = src;
+
+                OnPropertyChanged("MapLayer"); //NOXLATE
+
+                return idst;
+            }
+            else if (isrc == 0)
+            {
+                return isrc; //Unchanged
+            }
+
+            return -1;
+        }
+
+        int IMapDefinition.MoveDown(IMapLayer layer)
+        {
+            Check.NotNull(layer, "layer"); //NOXLATE
+            int isrc = ((IMapDefinition)this).GetIndex(layer);
+            if (isrc < this.MapLayer.Count - 1)
+            {
+                int idst = isrc + 1;
+
+                var src = this.MapLayer[isrc];
+                var dst = this.MapLayer[idst];
+
+                this.MapLayer[isrc] = dst;
+                this.MapLayer[idst] = src;
+
+                OnPropertyChanged("MapLayer"); //NOXLATE
+
+                return idst;
+            }
+            else if (isrc == this.MapLayer.Count - 1)
+            {
+                return this.MapLayer.Count - 1; //Unchanged
+            }
+
+            return -1;
+        }
+
+        int IMapDefinition.MoveUpGroup(IMapLayerGroup group)
+        {
+            Check.NotNull(group, "group"); //NOXLATE
+            var grp = group as MapLayerGroupType;
+            if (grp != null)
+            {
+                var idx = this.MapLayerGroup.IndexOf(grp);
+                if (idx > 0)
+                {
+                    int idst = idx - 1;
+
+                    var src = this.MapLayerGroup[idx];
+                    var dst = this.MapLayerGroup[idst];
+
+                    this.MapLayerGroup[idx] = dst;
+                    this.MapLayerGroup[idst] = src;
+
+                    OnPropertyChanged("MapLayerGroup"); //NOXLATE
+
+                    return idst;
+                }
+                else if (idx == 0)
+                {
+                    return idx; //Unchanged
+                }
+            }
+
+            return -1;
+        }
+
+        int IMapDefinition.MoveDownGroup(IMapLayerGroup group)
+        {
+            Check.NotNull(group, "group"); //NOXLATE
+            var grp = group as MapLayerGroupType;
+            if (grp != null)
+            {
+                var idx = this.MapLayerGroup.IndexOf(grp);
+                if (idx < this.MapLayerGroup.Count - 1)
+                {
+                    int idst = idx + 1;
+
+                    var src = this.MapLayerGroup[idx];
+                    var dst = this.MapLayerGroup[idst];
+
+                    this.MapLayerGroup[idx] = dst;
+                    this.MapLayerGroup[idst] = src;
+
+                    OnPropertyChanged("MapLayerGroup"); //NOXLATE
+
+                    return idst;
+                }
+                else if (idx == this.MapLayerGroup.Count - 1)
+                {
+                    return this.MapLayerGroup.Count - 1; //Unchanged
+                }
+            }
+
+            return -1;
+        }
+
+        int IMapDefinition.GetIndex(IMapLayerGroup group)
+        {
+            Check.NotNull(group, "group"); //NOXLATE
+            var grp = group as MapLayerGroupType;
+            if (grp != null)
+                return this.MapLayerGroup.IndexOf(grp);
+
+            return -1;
+        }
+
+        void IMapDefinition.SetTopDrawOrder(IMapLayer layer)
+        {
+            Check.NotNull(layer, "layer"); //NOXLATE
+            int isrc = ((IMapDefinition)this).GetIndex(layer);
+            if (isrc > 0)
+            {
+                var src = this.MapLayer[isrc];
+
+                //take everything before this and shift them up one position
+                for (int i = isrc - 1; i >= 0; i--)
+                {
+                    this.MapLayer[i + 1] = this.MapLayer[i];
+                }
+
+                this.MapLayer[0] = src;
+                OnPropertyChanged("MapLayer"); //NOXLATE
+            }
+        }
+
+        void IMapDefinition.SetBottomDrawOrder(IMapLayer layer)
+        {
+            Check.NotNull(layer, "layer"); //NOXLATE
+            int isrc = ((IMapDefinition)this).GetIndex(layer);
+            if (isrc >= 0 && isrc < this.MapLayer.Count)
+            {
+                var src = this.MapLayer[isrc];
+
+                //take everything after this and shift them down one position
+                for (int i = isrc + 1; i < this.MapLayer.Count; i++)
+                {
+                    this.MapLayer[i - 1] = this.MapLayer[i];
+                }
+
+                this.MapLayer[this.MapLayer.Count - 1] = src;
+                OnPropertyChanged("MapLayer"); //NOXLATE
+            }
+        }
+
+#if MDF_230 || MDF_240
+
+        IEnumerable<IWatermark> IWatermarkCollection.Watermarks
+        {
+            get
+            {
+                foreach (var wm in this.Watermarks)
+                    yield return wm;
+            }
+        }
+
+        IWatermark IWatermarkCollection.AddWatermark(IWatermarkDefinition watermark)
+        {
+            return WatermarkCollectionUtil.AddWatermark(this.Watermarks, watermark);
+        }
+
+        void IWatermarkCollection.RemoveWatermark(IWatermark watermark)
+        {
+            WatermarkCollectionUtil.RemoveWatermark(this.Watermarks, watermark);
+        }
+
+        int IWatermarkCollection.WatermarkCount
+        {
+            get { return this.Watermarks.Count; }
+        }
+
+#endif
+    }
+
+    partial class Box2DType : IEnvelope
+    { }
+
+    partial class MapDefinitionTypeBaseMapDefinition : IBaseMapDefinition
+    {
+        [XmlIgnore]
+        public IMapDefinition Parent
+        {
+            get;
+            set;
+        }
+
+        void IBaseMapDefinition.RemoveScaleAt(int index)
+        {
+            this.FiniteDisplayScale.RemoveAt(index);
+        }
+
+        double IBaseMapDefinition.GetScaleAt(int index)
+        {
+            return this.FiniteDisplayScale[index];
+        }
+
+        [XmlIgnore]
+        int IBaseMapDefinition.GroupCount
+        {
+            get { return this.BaseMapLayerGroup.Count; }
+        }
+
+        IBaseMapGroup IBaseMapDefinition.GetGroupAt(int index)
+        {
+            return this.BaseMapLayerGroup[index];
+        }
+
+        [XmlIgnore]
+        int IBaseMapDefinition.ScaleCount
+        {
+            get { return this.FiniteDisplayScale.Count; }
+        }
+
+        [XmlIgnore]
+        IEnumerable<double> IBaseMapDefinition.FiniteDisplayScale
+        {
+            get
+            {
+                foreach (var scale in this.FiniteDisplayScale)
+                {
+                    yield return scale;
+                }
+            }
+        }
+
+        public void AddFiniteDisplayScale(double value)
+        {
+            this.FiniteDisplayScale.Add(value);
+        }
+
+        public void RemoveFiniteDisplayScale(double value)
+        {
+            this.FiniteDisplayScale.Remove(value);
+        }
+
+        void IBaseMapDefinition.RemoveAllScales()
+        {
+            this.FiniteDisplayScale.Clear();
+            OnPropertyChanged("FiniteDisplayScale"); //NOXLATE
+        }
+
+        [XmlIgnore]
+        IEnumerable<IBaseMapGroup> IBaseMapDefinition.BaseMapLayerGroup
+        {
+            get
+            {
+                foreach (var grp in this.BaseMapLayerGroup)
+                {
+                    yield return grp;
+                }
+            }
+        }
+
+        public IBaseMapGroup AddBaseLayerGroup(string name)
+        {
+            var grp = new BaseMapLayerGroupCommonType()
+            {
+                Parent = this.Parent,
+                Name = name,
+                BaseMapLayer = new System.ComponentModel.BindingList<BaseMapLayerType>(),
+                ExpandInLegend = true,
+                ShowInLegend = true,
+                LegendLabel = name,
+                Visible = true
+            };
+            this.BaseMapLayerGroup.Add(grp);
+
+            return grp;
+        }
+
+        public void RemoveBaseLayerGroup(IBaseMapGroup group)
+        {
+            var grp = group as BaseMapLayerGroupCommonType;
+            if (grp != null)
+                this.BaseMapLayerGroup.Remove(grp);
+        }
+    }
+
+    partial class MapLayerType : IMapLayer
+    {
+    }
+
+    partial class BaseMapLayerType : IBaseMapLayer
+    {
+        [XmlIgnore]
+        public IMapDefinition Parent
+        {
+            get;
+            set;
+        }
+    }
+
+    partial class MapLayerGroupType : IMapLayerGroup
+    {
+        [XmlIgnore]
+        public IMapDefinition Parent
+        {
+            get;
+            set;
+        }
+    }
+
+    partial class BaseMapLayerGroupCommonType : IBaseMapGroup
+    {
+        [XmlIgnore]
+        public IMapDefinition Parent
+        {
+            get;
+            set;
+        }
+
+        [XmlIgnore]
+        IEnumerable<IBaseMapLayer> IBaseMapGroup.BaseMapLayer
+        {
+            get
+            {
+                foreach (var lyr in this.BaseMapLayer)
+                {
+                    yield return lyr;
+                }
+            }
+        }
+
+        public int GetIndex(IBaseMapLayer layer)
+        {
+            var bl = layer as BaseMapLayerType;
+            if (bl != null)
+            {
+                return this.BaseMapLayer.IndexOf(bl);
+            }
+            return -1;
+        }
+
+        public void InsertLayer(int index, IBaseMapLayer layer)
+        {
+            var bl = layer as BaseMapLayerType;
+            if (bl != null)
+            {
+                this.BaseMapLayer.Insert(index, bl);
+            }
+        }
+
+        public IBaseMapLayer AddLayer(string layerName, string resourceId)
+        {
+            BaseMapLayerType layer = new BaseMapLayerType()
+            {
+                Parent = this.Parent,
+                ExpandInLegend = true,
+                LegendLabel = layerName,
+                Name = layerName,
+                ResourceId = resourceId,
+                ShowInLegend = true,
+                Selectable = true
+            };
+            this.BaseMapLayer.Add(layer);
+            OnPropertyChanged("BaseMapLayer"); //NOXLATE
+            return layer;
+        }
+
+        public void RemoveBaseMapLayer(IBaseMapLayer layer)
+        {
+            var lyr = layer as BaseMapLayerType;
+            if (lyr != null)
+            {
+                this.BaseMapLayer.Remove(lyr);
+                OnPropertyChanged("BaseMapLayer"); //NOXLATE
+            }
+        }
+
+        int IBaseMapGroup.MoveUp(IBaseMapLayer layer)
+        {
+            var lyr = layer as BaseMapLayerType;
+            if (lyr != null)
+            {
+                int isrc = this.BaseMapLayer.IndexOf(lyr);
+                if (isrc > 0)
+                {
+                    int idst = isrc - 1;
+                    var src = this.BaseMapLayer[isrc];
+                    var dst = this.BaseMapLayer[idst];
+
+                    //swap
+                    this.BaseMapLayer[isrc] = dst;
+                    this.BaseMapLayer[idst] = src;
+
+                    OnPropertyChanged("BaseMapLayer"); //NOXLATE
+
+                    return idst;
+                }
+            }
+
+            return -1;
+        }
+
+        int IBaseMapGroup.MoveDown(IBaseMapLayer layer)
+        {
+            var lyr = layer as BaseMapLayerType;
+            if (lyr != null)
+            {
+                int isrc = this.BaseMapLayer.IndexOf(lyr);
+                if (isrc < this.BaseMapLayer.Count - 1)
+                {
+                    int idst = isrc + 1;
+                    var src = this.BaseMapLayer[isrc];
+                    var dst = this.BaseMapLayer[idst];
+
+                    //swap
+                    this.BaseMapLayer[isrc] = dst;
+                    this.BaseMapLayer[idst] = src;
+
+                    OnPropertyChanged("BaseMapLayer"); //NOXLATE
+
+                    return idst;
+                }
+            }
+
+            return -1;
+        }
+    }
+}
\ No newline at end of file

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/OSGeo.MapGuide.ObjectModels.csproj
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/OSGeo.MapGuide.ObjectModels.csproj	2014-12-25 13:55:42 UTC (rev 8462)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/OSGeo.MapGuide.ObjectModels.csproj	2014-12-25 14:53:57 UTC (rev 8463)
@@ -18,9 +18,10 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;LDF_100</DefineConstants>
+    <DefineConstants>TRACE;DEBUG</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
@@ -29,6 +30,7 @@
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <DocumentationFile>bin\Release\OSGeo.MapGuide.ObjectModels.XML</DocumentationFile>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />
@@ -96,6 +98,12 @@
     <Compile Include="..\Generated\MapDefinition-1.0.0.designer.cs">
       <Link>MapDefinition\v1_0_0\MapDefinition-1.0.0.designer.cs</Link>
     </Compile>
+    <Compile Include="..\Generated\MapDefinition-2.3.0.designer.cs">
+      <Link>MapDefinition\v2_3_0\MapDefinition-2.3.0.designer.cs</Link>
+    </Compile>
+    <Compile Include="..\Generated\MapDefinition-2.4.0.designer.cs">
+      <Link>MapDefinition\v2_4_0\MapDefinition-2.4.0.designer.cs</Link>
+    </Compile>
     <Compile Include="..\Generated\PrintLayout-1.0.0.designer.cs">
       <Link>PrintLayout\v1.0.0\PrintLayout-1.0.0.designer.cs</Link>
     </Compile>
@@ -135,6 +143,15 @@
     <Compile Include="..\Generated\WebLayout-1.0.0.designer.cs">
       <Link>WebLayout\v1_0_0\WebLayout-1.0.0.designer.cs</Link>
     </Compile>
+    <Compile Include="..\Generated\WebLayout-1.1.0.designer.cs">
+      <Link>WebLayout\v1_1_0\WebLayout-1.1.0.designer.cs</Link>
+    </Compile>
+    <Compile Include="..\Generated\WebLayout-2.4.0.designer.cs">
+      <Link>WebLayout\v2_4_0\WebLayout-2.4.0.designer.cs</Link>
+    </Compile>
+    <Compile Include="..\Generated\WebLayout-2.6.0.designer.cs">
+      <Link>WebLayout\v2_6_0\WebLayout-2.6.0.designer.cs</Link>
+    </Compile>
     <Compile Include="ApplicationDefinition\v1_0_0\ApplicationDefinitionImpl.cs" />
     <Compile Include="ApplicationDefinition\v1_0_0\ApplicationDefinitionInfoImpl.cs" />
     <Compile Include="ApplicationDefinition\ApplicationDefinitionInterfaces.cs" />
@@ -164,11 +181,32 @@
     <Compile Include="LayerDefinition\LayerDefinitionInterfaces.cs" />
     <Compile Include="LayerDefinition\v1_0_0\LayerElementFactoryImpl.cs" />
     <Compile Include="LayerDefinition\v1_0_0\VectorLayerDefinitionImpl.cs" />
+    <Compile Include="LayerDefinition\v1_1_0\GridLayerDefinitionImpl.cs" />
+    <Compile Include="LayerDefinition\v1_1_0\LayerElementFactoryImpl.cs" />
+    <Compile Include="LayerDefinition\v1_1_0\VectorLayerDefinitionImpl.cs" />
+    <Compile Include="LayerDefinition\v1_2_0\GridLayerDefinitionImpl.cs" />
+    <Compile Include="LayerDefinition\v1_2_0\LayerElementFactoryImpl.cs" />
+    <Compile Include="LayerDefinition\v1_2_0\VectorLayerDefinitionImpl.cs" />
+    <Compile Include="LayerDefinition\v1_3_0\GridLayerDefinitionImpl.cs" />
+    <Compile Include="LayerDefinition\v1_3_0\LayerElementFactoryImpl.cs" />
+    <Compile Include="LayerDefinition\v1_3_0\VectorLayerDefinitionImpl.cs" />
+    <Compile Include="LayerDefinition\v2_3_0\GridLayerDefinitionImpl.cs" />
+    <Compile Include="LayerDefinition\v2_3_0\LayerElementFactoryImpl.cs" />
+    <Compile Include="LayerDefinition\v2_3_0\VectorLayerDefinitionImpl.cs" />
+    <Compile Include="LayerDefinition\v2_4_0\GridLayerDefinitionImpl.cs" />
+    <Compile Include="LayerDefinition\v2_4_0\LayerElementFactoryImpl.cs" />
+    <Compile Include="LayerDefinition\v2_4_0\VectorLayerDefinitionImpl.cs" />
     <Compile Include="LoadProcedure\v1_0_0\LoadProcedureImpl.cs" />
     <Compile Include="LoadProcedure\v1_0_0\LoadProcedureFactoryImpl.cs" />
     <Compile Include="LoadProcedure\LoadProcedureInterfaces.cs" />
+    <Compile Include="LoadProcedure\v1_1_0\LoadProcedureFactoryImpl.cs" />
+    <Compile Include="LoadProcedure\v1_1_0\LoadProcedureImpl.cs" />
+    <Compile Include="LoadProcedure\v2_4_0\LoadProcedureFactoryImpl.cs" />
+    <Compile Include="LoadProcedure\v2_4_0\LoadProcedureImpl.cs" />
     <Compile Include="MapDefinition\v1_0_0\MapDefinitionImpl.cs" />
     <Compile Include="MapDefinition\MapDefinitionInterfaces.cs" />
+    <Compile Include="MapDefinition\v2_3_0\MapDefinitionImpl.cs" />
+    <Compile Include="MapDefinition\v2_4_0\MapDefinitionImpl.cs" />
     <Compile Include="ObjectFactory.cs" />
     <Compile Include="PrintLayout\v1.0.0\PrintLayoutImpl.cs" />
     <Compile Include="PrintLayout\PrintLayoutInterfaces.cs" />
@@ -185,12 +223,20 @@
     </Compile>
     <Compile Include="SymbolDefinition\v1_0_0\SymbolDefinitionImpl.cs" />
     <Compile Include="SymbolDefinition\SymbolDefinitionInterfaces.cs" />
+    <Compile Include="SymbolDefinition\v1_1_0\SymbolDefinitionImpl.cs" />
+    <Compile Include="SymbolDefinition\v2_4_0\SymbolDefinitionImpl.cs" />
     <Compile Include="SymbolLibrary\v1.0.0\SymbolLibraryImpl.cs" />
     <Compile Include="SymbolLibrary\SymbolLibraryInterfaces.cs" />
     <Compile Include="UntypedResource.cs" />
     <Compile Include="Utility.cs" />
+    <Compile Include="WatermarkDefinition\v2_3_0\WatermarkDefinitionImpl.cs" />
+    <Compile Include="WatermarkDefinition\v2_4_0\WatermarkDefinitionImpl.cs" />
+    <Compile Include="WatermarkDefinition\WatermarkCollectionUtil.cs" />
     <Compile Include="WatermarkDefinition\WatermarkDefinitionInterfaces.cs" />
     <Compile Include="WebLayout\v1_0_0\WebLayoutImpl.cs" />
+    <Compile Include="WebLayout\v1_1_0\WebLayoutImpl.cs" />
+    <Compile Include="WebLayout\v2_4_0\WebLayoutImpl.cs" />
+    <Compile Include="WebLayout\v2_6_0\WebLayoutImpl.cs" />
     <Compile Include="WebLayout\WebLayoutInterfaces.cs" />
     <Compile Include="XmlNamespaces.cs" />
   </ItemGroup>

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/ObjectFactory.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/ObjectFactory.cs	2014-12-25 13:55:42 UTC (rev 8462)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/ObjectFactory.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -20,17 +20,420 @@
 
 #endregion Disclaimer / License
 
+using OSGeo.MapGuide.ObjectModels.ApplicationDefinition;
 using OSGeo.MapGuide.ObjectModels.Common;
+using OSGeo.MapGuide.ObjectModels.DrawingSource;
+using OSGeo.MapGuide.ObjectModels.FeatureSource;
+using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+using OSGeo.MapGuide.ObjectModels.LoadProcedure;
+using OSGeo.MapGuide.ObjectModels.MapDefinition;
+using OSGeo.MapGuide.ObjectModels.PrintLayout;
+using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
+using OSGeo.MapGuide.ObjectModels.WatermarkDefinition;
+using OSGeo.MapGuide.ObjectModels.WebLayout;
 using System;
 using System.Collections.Generic;
+using System.Collections.Specialized;
 using System.Linq;
 using System.Text;
+using Ldf110 = OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_1_0;
+using Ldf120 = OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_2_0;
+using Ldf130 = OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_3_0;
+using Ldf230 = OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_3_0;
+using Ldf240 = OSGeo.MapGuide.ObjectModels.LayerDefinition.v2_4_0;
+using Lp110 = OSGeo.MapGuide.ObjectModels.LoadProcedure.v1_1_0;
+using Lp220 = OSGeo.MapGuide.ObjectModels.LoadProcedure.v2_2_0;
+using Mdf230 = OSGeo.MapGuide.ObjectModels.MapDefinition.v2_3_0;
+using Mdf240 = OSGeo.MapGuide.ObjectModels.MapDefinition.v2_4_0;
+using Sym110 = OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0;
+using Sym240 = OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0;
+using Wdf230 = OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_3_0;
+using Wdf240 = OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_4_0;
+using WL110 = OSGeo.MapGuide.ObjectModels.WebLayout.v1_1_0;
+using WL240 = OSGeo.MapGuide.ObjectModels.WebLayout.v2_4_0;
+using WL260 = OSGeo.MapGuide.ObjectModels.WebLayout.v2_6_0;
 
 namespace OSGeo.MapGuide.ObjectModels
 {
+    /// <summary>
+    /// Factory method signature for creating layer definitions
+    /// </summary>
+    public delegate ILayerDefinition LayerCreatorFunc(LayerType type);
+
+    /// <summary>
+    /// Factory method signature for creating load procedures
+    /// </summary>
+    public delegate ILoadProcedure LoadProcCreatorFunc();
+
+    /// <summary>
+    /// Factory method signature for creating web layouts
+    /// </summary>
+    public delegate IWebLayout WebLayoutCreatorFunc(string mapDefinitionId);
+
+    /// <summary>
+    /// Factory method signature for creating compound symbol definitions
+    /// </summary>
+    public delegate ICompoundSymbolDefinition CompoundSymbolDefCreatorFunc();
+
+    /// <summary>
+    /// Factory method signature for creating simple symbol definitions
+    /// </summary>
+    public delegate ISimpleSymbolDefinition SimpleSymbolDefCreatorFunc();
+
+    /// <summary>
+    /// Factory method signature for creating watermarks
+    /// </summary>
+    /// <returns></returns>
+    public delegate IWatermarkDefinition WatermarkCreatorFunc(SymbolDefinitionType type);
+
+    /// <summary>
+    /// Factory method signature for creating map definitions
+    /// </summary>
+    /// <returns></returns>
+    public delegate IMapDefinition MapDefinitionCreatorFunc();
+
+    /// <summary>
+    /// Factory class to create MapGuide resource objects with either pre-defined or
+    /// sensible default values. This is recommended over creating the objects directly
+    /// as this ensures that there are no null child properties where the XML schema forbids
+    /// it.
+    ///
+    /// By default this class will only create v1.0.0 of any specified top-level resource unless specified. In order to be able to create
+    /// newer versions, you need to register the appropriate methods that can create resources of this version:
+    ///
+    ///  - <see cref="RegisterLayerFactoryMethod"/> for Layer Definitions
+    ///
+    /// This registration needs to be done as part of your application's startup/initialization phase.
+    ///
+    /// In the context of Maestro, this registration is automatically done as part of the addin's startup process
+    /// </summary>
     public class ObjectFactory
     {
+        private static Dictionary<Version, LayerCreatorFunc> _layerFactories;
+        private static Dictionary<LoadType, LoadProcCreatorFunc> _loadProcFactories;
+        private static Dictionary<Version, WebLayoutCreatorFunc> _wlFactories;
+        private static Dictionary<Version, SimpleSymbolDefCreatorFunc> _simpleSymbolFactories;
+        private static Dictionary<Version, CompoundSymbolDefCreatorFunc> _compoundSymbolFactories;
+        private static Dictionary<Version, MapDefinitionCreatorFunc> _mapDefinitionFactories;
+        private static Dictionary<Version, WatermarkCreatorFunc> _watermarkFactories;
+
+        static ObjectFactory()
+        {
+            _layerFactories = new Dictionary<Version, LayerCreatorFunc>();
+            _wlFactories = new Dictionary<Version, WebLayoutCreatorFunc>();
+            _loadProcFactories = new Dictionary<LoadType, LoadProcCreatorFunc>();
+            _simpleSymbolFactories = new Dictionary<Version, SimpleSymbolDefCreatorFunc>();
+            _compoundSymbolFactories = new Dictionary<Version, CompoundSymbolDefCreatorFunc>();
+            _mapDefinitionFactories = new Dictionary<Version, MapDefinitionCreatorFunc>();
+            _watermarkFactories = new Dictionary<Version, WatermarkCreatorFunc>();
+
+            _layerFactories.Add(
+                new Version(1, 0, 0),
+                new LayerCreatorFunc(OSGeo.MapGuide.ObjectModels.LayerDefinition.v1_0_0.LdfEntryPoint.CreateDefault));
+
+            _loadProcFactories.Add(
+                LoadType.Sdf,
+                new LoadProcCreatorFunc(OSGeo.MapGuide.ObjectModels.LoadProcedure.v1_0_0.LoadProcEntryPoint.CreateDefaultSdf));
+            _loadProcFactories.Add(
+                LoadType.Shp,
+                new LoadProcCreatorFunc(OSGeo.MapGuide.ObjectModels.LoadProcedure.v1_0_0.LoadProcEntryPoint.CreateDefaultShp));
+            _loadProcFactories.Add(
+                LoadType.Dwf,
+                new LoadProcCreatorFunc(OSGeo.MapGuide.ObjectModels.LoadProcedure.v1_0_0.LoadProcEntryPoint.CreateDefaultDwf));
+
+            _wlFactories.Add(
+                new Version(1, 0, 0),
+                new WebLayoutCreatorFunc(OSGeo.MapGuide.ObjectModels.WebLayout.v1_0_0.WebLayoutEntryPoint.CreateDefault));
+
+            _compoundSymbolFactories.Add(
+                new Version(1, 0, 0),
+                new CompoundSymbolDefCreatorFunc(OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.CompoundSymbolDefinition.CreateDefault));
+
+            _simpleSymbolFactories.Add(
+                new Version(1, 0, 0),
+                new SimpleSymbolDefCreatorFunc(OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0.SimpleSymbolDefinition.CreateDefault));
+
+            _mapDefinitionFactories.Add(
+                new Version(1, 0, 0),
+                new MapDefinitionCreatorFunc(OSGeo.MapGuide.ObjectModels.MapDefinition.v1_0_0.MdfEntryPoint.CreateDefault));
+
+            //Layer Definition 1.1.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "1.1.0"),
+                new ResourceSerializationCallback(Ldf110.LdfEntryPoint.Serialize),
+                new ResourceDeserializationCallback(Ldf110.LdfEntryPoint.Deserialize));
+            ObjectFactory.RegisterLayerFactoryMethod(new Version(1, 1, 0), new LayerCreatorFunc(Ldf110.LdfEntryPoint.CreateDefault));
+
+            //Layer Definition 1.2.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "1.2.0"),
+                new ResourceSerializationCallback(Ldf120.LdfEntryPoint.Serialize),
+                new ResourceDeserializationCallback(Ldf120.LdfEntryPoint.Deserialize));
+            ObjectFactory.RegisterLayerFactoryMethod(new Version(1, 2, 0), new LayerCreatorFunc(Ldf120.LdfEntryPoint.CreateDefault));
+
+            //Layer Definition 1.3.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "1.3.0"),
+                new ResourceSerializationCallback(Ldf130.LdfEntryPoint.Serialize),
+                new ResourceDeserializationCallback(Ldf130.LdfEntryPoint.Deserialize));
+            ObjectFactory.RegisterLayerFactoryMethod(new Version(1, 3, 0), new LayerCreatorFunc(Ldf130.LdfEntryPoint.CreateDefault));
+
+            //Layer Definition 2.3.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "2.3.0"),
+                new ResourceSerializationCallback(Ldf230.LdfEntryPoint.Serialize),
+                new ResourceDeserializationCallback(Ldf230.LdfEntryPoint.Deserialize));
+            ObjectFactory.RegisterLayerFactoryMethod(new Version(2, 3, 0), new LayerCreatorFunc(Ldf230.LdfEntryPoint.CreateDefault));
+
+            //Layer Definition 2.4.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "2.4.0"),
+                new ResourceSerializationCallback(Ldf240.LdfEntryPoint.Serialize),
+                new ResourceDeserializationCallback(Ldf240.LdfEntryPoint.Deserialize));
+            ObjectFactory.RegisterLayerFactoryMethod(new Version(2, 4, 0), new LayerCreatorFunc(Ldf240.LdfEntryPoint.CreateDefault));
+
+            //Load Procedure 1.1.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.LoadProcedure.ToString(), "1.1.0"),
+                new ResourceSerializationCallback(Lp110.LoadProcEntryPoint.Serialize),
+                new ResourceDeserializationCallback(Lp110.LoadProcEntryPoint.Deserialize));
+
+            //Load Procedure 1.1.0 schema offers nothing new for the ones we want to support, so nothing to register
+            //with the ObjectFactory
+
+            //Load Procedure 2.2.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.LoadProcedure.ToString(), "2.2.0"),
+                new ResourceSerializationCallback(Lp220.LoadProcEntryPoint.Serialize),
+                new ResourceDeserializationCallback(Lp220.LoadProcEntryPoint.Deserialize));
+            ObjectFactory.RegisterLoadProcedureFactoryMethod(LoadType.Sqlite, new LoadProcCreatorFunc(Lp220.LoadProcEntryPoint.CreateDefaultSqlite));
+
+            //Web Layout 1.1.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.WebLayout.ToString(), "1.1.0"),
+                new ResourceSerializationCallback(WL110.WebLayoutEntryPoint.Serialize),
+                new ResourceDeserializationCallback(WL110.WebLayoutEntryPoint.Deserialize));
+            ObjectFactory.RegisterWebLayoutFactoryMethod(new Version(1, 1, 0), new WebLayoutCreatorFunc(WL110.WebLayoutEntryPoint.CreateDefault));
+
+            //Web Layout 2.4.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.WebLayout.ToString(), "2.4.0"),
+                new ResourceSerializationCallback(WL240.WebLayoutEntryPoint.Serialize),
+                new ResourceDeserializationCallback(WL240.WebLayoutEntryPoint.Deserialize));
+            ObjectFactory.RegisterWebLayoutFactoryMethod(new Version(2, 4, 0), new WebLayoutCreatorFunc(WL240.WebLayoutEntryPoint.CreateDefault));
+
+            //Web Layout 2.6.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.WebLayout.ToString(), "2.6.0"),
+                new ResourceSerializationCallback(WL260.WebLayoutEntryPoint.Serialize),
+                new ResourceDeserializationCallback(WL260.WebLayoutEntryPoint.Deserialize));
+            ObjectFactory.RegisterWebLayoutFactoryMethod(new Version(2, 6, 0), new WebLayoutCreatorFunc(WL260.WebLayoutEntryPoint.CreateDefault));
+
+            //Symbol Definition 1.1.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition.ToString(), "1.1.0"),
+                new ResourceSerializationCallback(Sym110.SymbolDefEntryPoint.Serialize),
+                new ResourceDeserializationCallback(Sym110.SymbolDefEntryPoint.Deserialize));
+            ObjectFactory.RegisterCompoundSymbolFactoryMethod(new Version(1, 1, 0), new CompoundSymbolDefCreatorFunc(Sym110.SymbolDefEntryPoint.CreateDefaultCompound));
+            ObjectFactory.RegisterSimpleSymbolFactoryMethod(new Version(1, 1, 0), new SimpleSymbolDefCreatorFunc(Sym110.SymbolDefEntryPoint.CreateDefaultSimple));
+
+            //Symbol Definition 2.4.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition.ToString(), "2.4.0"),
+                new ResourceSerializationCallback(Sym240.SymbolDefEntryPoint.Serialize),
+                new ResourceDeserializationCallback(Sym240.SymbolDefEntryPoint.Deserialize));
+            ObjectFactory.RegisterCompoundSymbolFactoryMethod(new Version(2, 4, 0), new CompoundSymbolDefCreatorFunc(Sym240.SymbolDefEntryPoint.CreateDefaultCompound));
+            ObjectFactory.RegisterSimpleSymbolFactoryMethod(new Version(2, 4, 0), new SimpleSymbolDefCreatorFunc(Sym240.SymbolDefEntryPoint.CreateDefaultSimple));
+
+            //Map Definition 2.3.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.MapDefinition.ToString(), "2.3.0"),
+                new ResourceSerializationCallback(Mdf230.MdfEntryPoint.Serialize),
+                new ResourceDeserializationCallback(Mdf230.MdfEntryPoint.Deserialize));
+            ObjectFactory.RegisterMapDefinitionFactoryMethod(new Version(2, 3, 0), new MapDefinitionCreatorFunc(Mdf230.MdfEntryPoint.CreateDefault));
+
+            //Map Definition 2.4.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.MapDefinition.ToString(), "2.4.0"),
+                new ResourceSerializationCallback(Mdf240.MdfEntryPoint.Serialize),
+                new ResourceDeserializationCallback(Mdf240.MdfEntryPoint.Deserialize));
+            ObjectFactory.RegisterMapDefinitionFactoryMethod(new Version(2, 4, 0), new MapDefinitionCreatorFunc(Mdf240.MdfEntryPoint.CreateDefault));
+
+            //Watermark Definition 2.3.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.WatermarkDefinition.ToString(), "2.3.0"),
+                new ResourceSerializationCallback(Wdf230.WdfEntryPoint.Serialize),
+                new ResourceDeserializationCallback(Wdf230.WdfEntryPoint.Deserialize));
+            ObjectFactory.RegisterWatermarkDefinitionFactoryMethod(new Version(2, 3, 0), new WatermarkCreatorFunc(Wdf230.WdfEntryPoint.CreateDefault));
+
+            //Watermark Definition 2.4.0
+            ResourceTypeRegistry.RegisterResource(
+                new ResourceTypeDescriptor(ResourceTypes.WatermarkDefinition.ToString(), "2.4.0"),
+                new ResourceSerializationCallback(Wdf240.WdfEntryPoint.Serialize),
+                new ResourceDeserializationCallback(Wdf240.WdfEntryPoint.Deserialize));
+            ObjectFactory.RegisterWatermarkDefinitionFactoryMethod(new Version(2, 4, 0), new WatermarkCreatorFunc(Wdf240.WdfEntryPoint.CreateDefault));
+        }
+
+        #region Factory registration
+
         /// <summary>
+        /// Registers the compound symbol factory method
+        /// </summary>
+        /// <param name="ver"></param>
+        /// <param name="func"></param>
+        public static void RegisterCompoundSymbolFactoryMethod(Version ver, CompoundSymbolDefCreatorFunc func)
+        {
+            if (_compoundSymbolFactories.ContainsKey(ver))
+                throw new ArgumentException(Strings.FactoryMethodAlreadyRegistered + ver);
+
+            _compoundSymbolFactories[ver] = func;
+        }
+
+        /// <summary>
+        /// Regsiters the simple symbol factory method
+        /// </summary>
+        /// <param name="ver"></param>
+        /// <param name="func"></param>
+        public static void RegisterSimpleSymbolFactoryMethod(Version ver, SimpleSymbolDefCreatorFunc func)
+        {
+            if (_simpleSymbolFactories.ContainsKey(ver))
+                throw new ArgumentException(Strings.FactoryMethodAlreadyRegistered + ver);
+
+            _simpleSymbolFactories[ver] = func;
+        }
+
+        /// <summary>
+        /// Registers the layer factory method.
+        /// </summary>
+        /// <param name="ver">The ver.</param>
+        /// <param name="method">The method.</param>
+        public static void RegisterLayerFactoryMethod(Version ver, LayerCreatorFunc method)
+        {
+            if (_layerFactories.ContainsKey(ver))
+                throw new ArgumentException(Strings.FactoryMethodAlreadyRegistered + ver);
+
+            _layerFactories[ver] = method;
+        }
+
+        /// <summary>
+        /// Registers the load procedure factory method.
+        /// </summary>
+        /// <param name="type">The type.</param>
+        /// <param name="method">The method.</param>
+        public static void RegisterLoadProcedureFactoryMethod(LoadType type, LoadProcCreatorFunc method)
+        {
+            if (_loadProcFactories.ContainsKey(type))
+                throw new ArgumentException(Strings.LoadProcFactoryMethodAlreadyRegistered + type);
+
+            _loadProcFactories[type] = method;
+        }
+
+        /// <summary>
+        /// Registers the web layout factory method.
+        /// </summary>
+        /// <param name="version">The version.</param>
+        /// <param name="method">The method.</param>
+        public static void RegisterWebLayoutFactoryMethod(Version version, WebLayoutCreatorFunc method)
+        {
+            if (_wlFactories.ContainsKey(version))
+                throw new ArgumentException(Strings.FactoryMethodAlreadyRegistered + version);
+
+            _wlFactories[version] = method;
+        }
+
+        /// <summary>
+        /// Register the map definition factory method
+        /// </summary>
+        /// <param name="version"></param>
+        /// <param name="method"></param>
+        public static void RegisterMapDefinitionFactoryMethod(Version version, MapDefinitionCreatorFunc method)
+        {
+            if (_mapDefinitionFactories.ContainsKey(version))
+                throw new ArgumentException(Strings.FactoryMethodAlreadyRegistered + version);
+
+            _mapDefinitionFactories[version] = method;
+        }
+
+        /// <summary>
+        /// Registers the Watermark Definition factory method
+        /// </summary>
+        /// <param name="version"></param>
+        /// <param name="method"></param>
+        public static void RegisterWatermarkDefinitionFactoryMethod(Version version, WatermarkCreatorFunc method)
+        {
+            if (_watermarkFactories.ContainsKey(version))
+                throw new ArgumentException(Strings.FactoryMethodAlreadyRegistered + version);
+
+            _watermarkFactories[version] = method;
+        }
+
+        #endregion Factory registration
+
+        /// <summary>
+        /// Creates an empty resource document header metadata object
+        /// </summary>
+        /// <returns></returns>
+        public static ResourceDocumentHeaderTypeMetadata CreateMetadata()
+        {
+            return new ResourceDocumentHeaderTypeMetadata()
+            {
+                Simple = new ResourceDocumentHeaderTypeMetadataSimple()
+                {
+                    Property = new System.ComponentModel.BindingList<ResourceDocumentHeaderTypeMetadataSimpleProperty>()
+                }
+            };
+        }
+
+        /// <summary>
+        /// Creates an empty user security object
+        /// </summary>
+        /// <returns></returns>
+        public static ResourceSecurityTypeUsers CreateSecurityUser()
+        {
+            return new ResourceSecurityTypeUsers()
+            {
+                User = new System.ComponentModel.BindingList<ResourceSecurityTypeUsersUser>()
+            };
+        }
+
+        /// <summary>
+        /// Creates the feature source extension.
+        /// </summary>
+        /// <returns></returns>
+        public static IFeatureSourceExtension CreateFeatureSourceExtension()
+        {
+            return new OSGeo.MapGuide.ObjectModels.FeatureSource.v1_0_0.FeatureSourceTypeExtension()
+            {
+                CalculatedProperty = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.FeatureSource.v1_0_0.CalculatedPropertyType>(),
+                AttributeRelate = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.FeatureSource.v1_0_0.AttributeRelateType>()
+            };
+        }
+
+        /// <summary>
+        /// Creates the calculated property.
+        /// </summary>
+        /// <returns></returns>
+        public static ICalculatedProperty CreateCalculatedProperty()
+        {
+            return new OSGeo.MapGuide.ObjectModels.FeatureSource.v1_0_0.CalculatedPropertyType();
+        }
+
+        /// <summary>
+        /// Creates the attribute relation.
+        /// </summary>
+        /// <returns></returns>Properties.Resources.
+        public static IAttributeRelation CreateAttributeRelation()
+        {
+            IAttributeRelation rel = new OSGeo.MapGuide.ObjectModels.FeatureSource.v1_0_0.AttributeRelateType()
+            {
+                RelateProperty = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.FeatureSource.v1_0_0.RelatePropertyType>(),
+            };
+            rel.RelateType = RelateTypeEnum.LeftOuter;
+            rel.ForceOneToOne = false;
+            return rel;
+        }
+
+        /// <summary>
         /// Creates an envelope (bounding box)
         /// </summary>
         /// <param name="minx"></param>
@@ -62,6 +465,451 @@
         }
 
         /// <summary>
+        /// Creates the default layer.
+        /// </summary>
+        /// <param name="type">The type.</param>
+        /// <param name="version">The version.</param>
+        /// <returns></returns>
+        public static ILayerDefinition CreateDefaultLayer(LayerType type, Version version)
+        {
+            if (!_layerFactories.ContainsKey(version))
+                throw new ArgumentException(Strings.UnknownLayerVersion + version.ToString());
+
+            var layer = _layerFactories[version](type);
+
+            return layer;
+        }
+
+        /// <summary>
+        /// Creates the drawing source.
+        /// </summary>
+        /// <returns></returns>
+        public static IDrawingSource CreateDrawingSource()
+        {
+            return new OSGeo.MapGuide.ObjectModels.DrawingSource.v1_0_0.DrawingSource()
+            {
+                SourceName = string.Empty,
+                CoordinateSpace = string.Empty,
+                Sheet = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.DrawingSource.v1_0_0.DrawingSourceSheet>()
+            };
+        }
+
+        /// <summary>
+        /// Creates the feature source.
+        /// </summary>
+        /// <param name="provider">The provider.</param>
+        /// <returns></returns>
+        public static IFeatureSource CreateFeatureSource(string provider)
+        {
+            return new OSGeo.MapGuide.ObjectModels.FeatureSource.v1_0_0.FeatureSourceType()
+            {
+                Provider = provider,
+                Parameter = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.FeatureSource.v1_0_0.NameValuePairType>()
+            };
+        }
+
+        /// <summary>
+        /// Creates the feature source.
+        /// </summary>
+        /// <param name="provider">The provider.</param>
+        /// <param name="values">The connection properties.</param>
+        /// <returns></returns>
+        public static IFeatureSource CreateFeatureSource(string provider, NameValueCollection values)
+        {
+            var fs = CreateFeatureSource(provider);
+            fs.ApplyConnectionProperties(values);
+
+            return fs;
+        }
+
+        /// <summary>
+        /// Creates a Watermark Definition
+        /// </summary>
+        /// <param name="type"></param>
+        /// <param name="version"></param>
+        /// <returns></returns>
+        public static IWatermarkDefinition CreateWatermark(SymbolDefinitionType type, Version version)
+        {
+            if (!_watermarkFactories.ContainsKey(version))
+                throw new ArgumentException(Strings.UnknownWatermarkDefinitionVersion + version.ToString());
+
+            var wdf = _watermarkFactories[version](type);
+            return wdf;
+        }
+
+        /// <summary>
+        /// Creates the load procedure.
+        /// </summary>
+        /// <param name="type">The type.</param>
+        /// <param name="fileNames">The file names.</param>
+        /// <returns></returns>
+        public static ILoadProcedure CreateLoadProcedure(LoadType type, IEnumerable<string> fileNames)
+        {
+            var proc = CreateLoadProcedure(type);
+            var fproc = proc.SubType as IBaseLoadProcedure;
+            if (fproc != null)
+            {
+                if (fileNames != null)
+                {
+                    foreach (var f in fileNames)
+                    {
+                        fproc.SourceFile.Add(f);
+                    }
+                }
+            }
+            return proc;
+        }
+
+        /// <summary>
+        /// Creates the load procedure.
+        /// </summary>
+        /// <param name="type">The type.</param>
+        /// <returns></returns>
+        public static ILoadProcedure CreateLoadProcedure(LoadType type)
+        {
+            if (type == LoadType.Dwg || type == LoadType.Raster)
+                throw new NotSupportedException(Strings.UnsupportedLoadProcedureType);
+
+            if (_loadProcFactories.ContainsKey(type))
+            {
+                var proc = _loadProcFactories[type]();
+                return proc;
+            }
+
+            throw new InvalidOperationException(Strings.CannotCreateLoadProcedureSubType + type);
+        }
+
+        /// <summary>
+        /// Creates the map definition.
+        /// </summary>
+        /// <param name="version"></param>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        public static IMapDefinition CreateMapDefinition(Version version, string name)
+        {
+            if (!_mapDefinitionFactories.ContainsKey(version))
+                throw new ArgumentException(Strings.UnknownMapDefinitionVersion + version.ToString());
+
+            var mdf = _mapDefinitionFactories[version]();
+            return mdf;
+        }
+
+        /// <summary>
+        /// Creates the map definition.
+        /// </summary>
+        /// <param name="ver"></param>
+        /// <param name="name"></param>
+        /// <param name="coordinateSystemWkt"></param>
+        /// <returns></returns>
+        public static IMapDefinition CreateMapDefinition(Version ver, string name, string coordinateSystemWkt)
+        {
+            var map = CreateMapDefinition(ver, name);
+            map.CoordinateSystem = coordinateSystemWkt;
+
+            return map;
+        }
+
+        /// <summary>
+        /// Creates the map definition.
+        /// </summary>
+        /// <param name="ver"></param>
+        /// <param name="name"></param>
+        /// <param name="coordinateSystemWkt"></param>
+        /// <param name="env"></param>
+        /// <returns></returns>
+        public static IMapDefinition CreateMapDefinition(Version ver, string name, string coordinateSystemWkt, IEnvelope env)
+        {
+            var map = CreateMapDefinition(ver, name, coordinateSystemWkt);
+            map.Extents = env;
+
+            return map;
+        }
+
+        /// <summary>
+        /// Creates a simple label symbol
+        /// </summary>
+        /// <param name="version"></param>
+        /// <param name="type"></param>
+        /// <returns></returns>
+        public static ISimpleSymbolDefinition CreateSimpleLabel(Version version, GeometryContextType type)
+        {
+            var sym = CreateSimpleSymbol(version, "MTEXT", "Default MTEXT Symbol");
+            var text = sym.CreateTextGraphics();
+            text.Content = "%CONTENT%";
+            text.FontName = "%FONTNAME%";
+            text.Bold = "%BOLD%";
+            text.Italic = "%ITALIC%";
+            text.Underlined = "%UNDERLINED%";
+            var text2 = text as ITextGraphic2;
+            if (text2 != null)
+            {
+                text2.Overlined = "%OVERLINED%";
+            }
+            text.Height = "%FONTHEIGHT%";
+            text.PositionX = "%StyleEditorGenerated_TextPositionX_0%";
+            text.PositionY = "%StyleEditorGenerated_TextPositionY_0%";
+            text.HorizontalAlignment = "%HORIZONTALALIGNMENT%";
+            text.VerticalAlignment = "%VERTICALALIGNMENT%";
+            text.Justification = "%JUSTIFICATION%";
+            text.LineSpacing = "%LINESPACING%";
+            text.TextColor = "%TEXTCOLOR%";
+            text.GhostColor = "%GHOSTCOLOR%";
+            var frame = sym.CreateFrame();
+            frame.LineColor = "%FRAMELINECOLOR%";
+            frame.FillColor = "%FRAMEFILLCOLOR%";
+            frame.OffsetX = 0.0;
+            frame.OffsetY = 0.0;
+            text.Frame = frame;
+            if (text2 != null)
+            {
+                text2.Markup = "'MTEXT'";
+            }
+
+            sym.AddGraphics(text);
+            switch (type)
+            {
+                case GeometryContextType.LineString:
+                    {
+                        var usage = sym.CreateLineUsage();
+                        usage.AngleControl = "'FromAngle'";
+                        usage.Angle = "%ROTATION%";
+                        usage.Repeat = "1.0";
+                        sym.LineUsage = usage;
+                    }
+                    break;
+
+                case GeometryContextType.Polygon:
+                    {
+                        var usage = sym.CreateAreaUsage();
+                        usage.Angle = "%ROTATION%";
+                        usage.RepeatX = "100.0";
+                        usage.RepeatY = "100.0";
+                        sym.AreaUsage = usage;
+                    }
+                    break;
+
+                case GeometryContextType.Point:
+                    {
+                        var usage = sym.CreatePointUsage();
+                        usage.Angle = "%ANGLE%";
+                        sym.PointUsage = usage;
+                    }
+                    break;
+            }
+
+            sym.DefineParameter("CONTENT", "'text'", "T&ext", "Text", "Content");
+            sym.DefineParameter("FONTNAME", "'Arial'", "&Font Name", "Font Name", "FontName");
+            sym.DefineParameter("FONTHEIGHT", "4.0", "Font &Size", "Font Size", "FontHeight");
+            sym.DefineParameter("BOLD", "false", "Bold", "Bold", "Bold");
+            sym.DefineParameter("ITALIC", "false", "Italic", "Italic", "Italic");
+            sym.DefineParameter("UNDERLINED", "false", "Underlined", "Underlined", "Underlined");
+            if (text2 != null)
+            {
+                sym.DefineParameter("OVERLINED", "false", "Overlined", "Overlined", "Overlined");
+            }
+            sym.DefineParameter("JUSTIFICATION", "'FromAlignment'", "Justification", "Justification", "Justification");
+            sym.DefineParameter("LINESPACING", "1.05", "Line Spacing", "Line Spacing", "LineSpacing");
+            sym.DefineParameter("GHOSTCOLOR", "", "Ghost Color", "Ghost Color", "GhostColor");
+            sym.DefineParameter("FRAMELINECOLOR", "", "Frame Line Color", "Frame Line Color", "FrameLineColor");
+            sym.DefineParameter("FRAMEFILLCOLOR", "", "Frame Fill Color", "Frame Fill Color", "FrameFillColor");
+            sym.DefineParameter("TEXTCOLOR", "0xff000000", "Text Color", "Text Color", "TextColor");
+            sym.DefineParameter("VERTICALALIGNMENT", "'Halfline'", "&Vertical Alignment", "Vertical Alignment", "VerticalAlignment");
+            sym.DefineParameter("ROTATION", "0.0", "&Rotation", "Rotation", "Angle");
+            sym.DefineParameter("HORIZONTALALIGNMENT", "'Center'", "Hori&zontal Alignment", "Horizontal Alignment", "HorizontalAlignment");
+            sym.DefineParameter("StyleEditorGenerated_TextPositionX_0", "0.0", "PositionX", "PositionX", "Real");
+            sym.DefineParameter("StyleEditorGenerated_TextPositionY_0", "0.0", "PositionY", "PositionY", "Real");
+
+            return sym;
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="version"></param>
+        /// <returns></returns>
+        public static ISimpleSymbolDefinition CreateSimplePoint(Version version)
+        {
+            var sym = CreateSimpleSymbol(version, "Square", "Default Point Symbol");
+            var path = sym.CreatePathGraphics();
+            path.Geometry = "M -1.0,-1.0 L 1.0,-1.0 L 1.0,1.0 L -1.0,1.0 L -1.0,-1.0";
+            IPathGraphic2 path2 = path as IPathGraphic2;
+            if (path2 != null)
+            {
+                path2.ScaleX = "%StyleEditorGenerated_ScaleX_0%";
+                path2.ScaleY = "%StyleEditorGenerated_ScaleY_0%";
+            }
+            path.FillColor = "%FILLCOLOR%";
+            path.LineColor = "%LINECOLOR%";
+            path.LineWeight = "%LINEWEIGHT%";
+            path.LineCap = "%StyleEditorGenerated_LineCap_0%";
+            path.LineJoin = "%StyleEditorGenerated_LineJoin_0%";
+
+            var usage = sym.CreatePointUsage();
+            usage.Angle = "%ROTATION%";
+            sym.PointUsage = usage;
+
+            sym.DefineParameter("FILLCOLOR", "0xffffffff", "&Fill Color", "Fill Color", "FillColor");
+            sym.DefineParameter("LINECOLOR", "0xff000000", "Line &Color", "Line Color", "LineColor");
+            sym.DefineParameter("LINEWEIGHT", "0.0", "Line &Thickness", "Line Thickness", "LineWeight");
+            sym.DefineParameter("ROTATION", "0.0", "&Rotation", "Rotation", "Angle");
+            if (path2 != null)
+            {
+                sym.DefineParameter("StyleEditorGenerated_ScaleX_0", "1.0", "Path ScaleX", "Path ScaleX", "Real");
+                sym.DefineParameter("StyleEditorGenerated_ScaleY_0", "1.0", "Path ScaleY", "Path ScaleY", "Real");
+            }
+            sym.DefineParameter("StyleEditorGenerated_LineCap_0", "'Round'", "Line Cap", "The cap type to use at the ends of each segment in the path outline.  This must evaluate to one of: None, Round (default), Triangle, or Square.", "String");
+            sym.DefineParameter("StyleEditorGenerated_LineJoin_0", "'Round'", "Line Join", "The join type to use at each vertex in the path outline.  This must evaluate to one of: None, Bevel, Round (default), or Miter.", "String");
+            return sym;
+        }
+
+        /// <summary>
+        /// Creates a simple solid line symbol
+        /// </summary>
+        /// <param name="version"></param>
+        /// <returns></returns>
+        public static ISimpleSymbolDefinition CreateSimpleSolidLine(Version version)
+        {
+            var sym = CreateSimpleSymbol(version, "Solid Line", "Default Line Symbol");
+            var path = sym.CreatePathGraphics();
+            path.Geometry = "M 0.0,0.0 L 1.0,0.0";
+            path.LineColor = "%LINECOLOR%";
+            path.LineWeight = "%LINEWEIGHT%";
+            path.LineCap = "%StyleEditorGenerated_LineCap_0%";
+            path.LineJoin = "%StyleEditorGenerated_LineJoin_0%";
+            IPathGraphic2 path2 = path as IPathGraphic2;
+            if (path2 != null)
+            {
+                path2.ScaleX = "%StyleEditorGenerated_ScaleX_0%";
+                path2.ScaleY = "%StyleEditorGenerated_ScaleY_0%";
+            }
+            sym.AddGraphics(path);
+            var lineUsage = sym.CreateLineUsage();
+            lineUsage.Repeat = "1.0";
+            sym.LineUsage = lineUsage;
+
+            sym.DefineParameter("LINECOLOR", "0xff000000", "Line &Color", "Line Color", "LineColor");
+            sym.DefineParameter("LINEWEIGHT", "0.0", "Line &Thickness", "Line Thickness", "LineWeight");
+            if (path2 != null)
+            {
+                sym.DefineParameter("StyleEditorGenerated_ScaleX_0", "1.0", "Path ScaleX", "Path ScaleX", "Real");
+                sym.DefineParameter("StyleEditorGenerated_ScaleY_0", "1.0", "Path ScaleY", "Path ScaleY", "Real");
+            }
+            sym.DefineParameter("StyleEditorGenerated_LineCap_0", "'Round'", "Line Cap", "The cap type to use at the ends of each segment in the path outline.  This must evaluate to one of: None, Round (default), Triangle, or Square.", "String");
+            sym.DefineParameter("StyleEditorGenerated_LineJoin_0", "'Round'", "Line Join", "The join type to use at each vertex in the path outline.  This must evaluate to one of: None, Bevel, Round (default), or Miter.", "String");
+            return sym;
+        }
+
+        /// <summary>
+        /// Creates a simple solid fill symbol
+        /// </summary>
+        /// <param name="version"></param>
+        /// <returns></returns>
+        public static ISimpleSymbolDefinition CreateSimpleSolidFill(Version version)
+        {
+            var sym = CreateSimpleSymbol(version, "Solid Fill", "Default Area Symbol");
+            var path = sym.CreatePathGraphics();
+            path.Geometry = "M 0.0,0.0 h 100.0 v 100.0 h -100.0 z";
+            path.FillColor = "%FILLCOLOR%";
+            path.LineCap = "%StyleEditorGenerated_LineCap_0%";
+            path.LineJoin = "%StyleEditorGenerated_LineJoin_0%";
+            IPathGraphic2 path2 = path as IPathGraphic2;
+            if (path2 != null)
+            {
+                path2.ScaleX = "%StyleEditorGenerated_ScaleX_0%";
+                path2.ScaleY = "%StyleEditorGenerated_ScaleY_0%";
+            }
+            sym.AddGraphics(path);
+            var areaUsage = sym.CreateAreaUsage();
+            areaUsage.RepeatX = "100.0";
+            areaUsage.RepeatY = "100.0";
+            sym.AreaUsage = areaUsage;
+
+            sym.DefineParameter("FILLCOLOR", "0xffbfbfbf", "&Fill Color", "Fill Color", "FillColor");
+            if (path2 != null)
+            {
+                sym.DefineParameter("StyleEditorGenerated_ScaleX_0", "1.0", "Path ScaleX", "Path ScaleX", "Real");
+                sym.DefineParameter("StyleEditorGenerated_ScaleY_0", "1.0", "Path ScaleY", "Path ScaleY", "Real");
+            }
+            sym.DefineParameter("StyleEditorGenerated_LineCap_0", "'Round'", "Line Cap", "The cap type to use at the ends of each segment in the path outline.  This must evaluate to one of: None, Round (default), Triangle, or Square.", "String");
+            sym.DefineParameter("StyleEditorGenerated_LineJoin_0", "'Round'", "Line Join", "The join type to use at each vertex in the path outline.  This must evaluate to one of: None, Bevel, Round (default), or Miter.", "String");
+            return sym;
+        }
+
+        /// <summary>
+        /// Creates a simple symbol definition.
+        /// </summary>
+        /// <param name="version">The version.</param>
+        /// <param name="name">The name.</param>
+        /// <param name="description">The description.</param>
+        /// <returns></returns>
+        public static ISimpleSymbolDefinition CreateSimpleSymbol(Version version, string name, string description)
+        {
+            if (!_simpleSymbolFactories.ContainsKey(version))
+                throw new ArgumentException(Strings.UnknownSymbolDefVersion + version.ToString());
+
+            var simp = _simpleSymbolFactories[version]();
+            simp.Name = name;
+            simp.Description = description;
+            return simp;
+        }
+
+        /// <summary>
+        /// Creates the compound symbol.
+        /// </summary>
+        /// <param name="version">The version.</param>
+        /// <param name="name">The name.</param>
+        /// <param name="description">The description.</param>
+        /// <returns></returns>
+        public static ICompoundSymbolDefinition CreateCompoundSymbol(Version version, string name, string description)
+        {
+            if (!_compoundSymbolFactories.ContainsKey(version))
+                throw new ArgumentException(Strings.UnknownSymbolDefVersion + version.ToString());
+
+            var comp = _compoundSymbolFactories[version]();
+            comp.Name = name;
+            comp.Description = description;
+            return comp;
+        }
+
+        /// <summary>
+        /// Creates the print layout.
+        /// </summary>
+        /// <returns></returns>
+        public static IPrintLayout CreatePrintLayout()
+        {
+            return new OSGeo.MapGuide.ObjectModels.PrintLayout.v1_0_0.PrintLayout()
+            {
+                CustomLogos = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.PrintLayout.v1_0_0.PrintLayoutLogo>(),
+                CustomText = new System.ComponentModel.BindingList<OSGeo.MapGuide.ObjectModels.PrintLayout.v1_0_0.PrintLayoutText>(),
+                LayoutProperties = new OSGeo.MapGuide.ObjectModels.PrintLayout.v1_0_0.PrintLayoutLayoutProperties()
+                {
+                    ShowCustomLogos = false,
+                    ShowCustomLogosSpecified = true,
+                    ShowCustomText = false,
+                    ShowCustomTextSpecified = true,
+                    ShowDateTime = false,
+                    ShowDateTimeSpecified = true,
+                    ShowLegend = false,
+                    ShowLegendSpecified = true,
+                    ShowNorthArrow = false,
+                    ShowNorthArrowSpecified = true,
+                    ShowScaleBar = false,
+                    ShowScaleBarSpecified = true,
+                    ShowTitle = false,
+                    ShowTitleSpecified = true,
+                    ShowURL = false,
+                    ShowURLSpecified = true
+                },
+                PageProperties = new OSGeo.MapGuide.ObjectModels.PrintLayout.v1_0_0.PrintLayoutPageProperties()
+                {
+                    BackgroundColor = new OSGeo.MapGuide.ObjectModels.PrintLayout.v1_0_0.PrintLayoutPagePropertiesBackgroundColor()
+                    {
+                    }
+                },
+            };
+        }
+
+        /// <summary>
         /// Creates a 2d point
         /// </summary>
         /// <param name="x"></param>

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/Strings.Designer.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/Strings.Designer.cs	2014-12-25 13:55:42 UTC (rev 8462)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/Strings.Designer.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -61,6 +61,24 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Could not create load procedure of type: .
+        /// </summary>
+        internal static string CannotCreateLoadProcedureSubType {
+            get {
+                return ResourceManager.GetString("CannotCreateLoadProcedureSubType", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to [Composite Style].
+        /// </summary>
+        internal static string CompositeStyleDisplayString {
+            get {
+                return ResourceManager.GetString("CompositeStyleDisplayString", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to This feature source does not connect an externally aliased file.
         /// </summary>
         internal static string ERR_FS_NO_ALIAS {
@@ -178,6 +196,15 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Value does not implement ICompositeTypeStyle.
+        /// </summary>
+        internal static string ErrorObjectNotICompositeTypeStyle {
+            get {
+                return ResourceManager.GetString("ErrorObjectNotICompositeTypeStyle", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to Overlay options are only applicable to MapGuide maps.
         /// </summary>
         internal static string ErrorOverlayOptionsOnNonMapGuideMap {
@@ -241,6 +268,24 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Factory method already registered for version: .
+        /// </summary>
+        internal static string FactoryMethodAlreadyRegistered {
+            get {
+                return ResourceManager.GetString("FactoryMethodAlreadyRegistered", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Factory method already registered for load procedure type: .
+        /// </summary>
+        internal static string LoadProcFactoryMethodAlreadyRegistered {
+            get {
+                return ResourceManager.GetString("LoadProcFactoryMethodAlreadyRegistered", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to Not a folder resource id: {0}.
         /// </summary>
         internal static string NotAFolder {
@@ -277,6 +322,60 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Unknown layer version: .
+        /// </summary>
+        internal static string UnknownLayerVersion {
+            get {
+                return ResourceManager.GetString("UnknownLayerVersion", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Unknown Map Definition version: .
+        /// </summary>
+        internal static string UnknownMapDefinitionVersion {
+            get {
+                return ResourceManager.GetString("UnknownMapDefinitionVersion", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Unknown Symbol Definition version: .
+        /// </summary>
+        internal static string UnknownSymbolDefVersion {
+            get {
+                return ResourceManager.GetString("UnknownSymbolDefVersion", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Unknown Watermark Definition version: .
+        /// </summary>
+        internal static string UnknownWatermarkDefinitionVersion {
+            get {
+                return ResourceManager.GetString("UnknownWatermarkDefinitionVersion", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Unknown Web Layout version: .
+        /// </summary>
+        internal static string UnknownWebLayoutVersion {
+            get {
+                return ResourceManager.GetString("UnknownWebLayoutVersion", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Unsupported Load Procedure Type.
+        /// </summary>
+        internal static string UnsupportedLoadProcedureType {
+            get {
+                return ResourceManager.GetString("UnsupportedLoadProcedureType", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to Display information about this application.
         /// </summary>
         internal static string WL_Desc_About {

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/Strings.resx
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/Strings.resx	2014-12-25 13:55:42 UTC (rev 8462)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/Strings.resx	2014-12-25 14:53:57 UTC (rev 8463)
@@ -390,4 +390,37 @@
   <data name="WL_Label_ZoomSelection" xml:space="preserve">
     <value>Zoom Selection</value>
   </data>
+  <data name="ErrorObjectNotICompositeTypeStyle" xml:space="preserve">
+    <value>Value does not implement ICompositeTypeStyle</value>
+  </data>
+  <data name="CompositeStyleDisplayString" xml:space="preserve">
+    <value>[Composite Style]</value>
+  </data>
+  <data name="FactoryMethodAlreadyRegistered" xml:space="preserve">
+    <value>Factory method already registered for version: </value>
+  </data>
+  <data name="LoadProcFactoryMethodAlreadyRegistered" xml:space="preserve">
+    <value>Factory method already registered for load procedure type: </value>
+  </data>
+  <data name="CannotCreateLoadProcedureSubType" xml:space="preserve">
+    <value>Could not create load procedure of type: </value>
+  </data>
+  <data name="UnknownLayerVersion" xml:space="preserve">
+    <value>Unknown layer version: </value>
+  </data>
+  <data name="UnknownMapDefinitionVersion" xml:space="preserve">
+    <value>Unknown Map Definition version: </value>
+  </data>
+  <data name="UnknownSymbolDefVersion" xml:space="preserve">
+    <value>Unknown Symbol Definition version: </value>
+  </data>
+  <data name="UnknownWatermarkDefinitionVersion" xml:space="preserve">
+    <value>Unknown Watermark Definition version: </value>
+  </data>
+  <data name="UnknownWebLayoutVersion" xml:space="preserve">
+    <value>Unknown Web Layout version: </value>
+  </data>
+  <data name="UnsupportedLoadProcedureType" xml:space="preserve">
+    <value>Unsupported Load Procedure Type</value>
+  </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/SymbolDefinition/v1_0_0/SymbolDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/SymbolDefinition/v1_0_0/SymbolDefinitionImpl.cs	2014-12-25 13:55:42 UTC (rev 8462)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/SymbolDefinition/v1_0_0/SymbolDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -24,8 +24,11 @@
 using System;
 using System.Collections.Generic;
 using System.Globalization;
+using System.IO;
 using System.Linq;
+using System.Runtime.Serialization;
 using System.Text;
+using System.Xml;
 using System.Xml.Serialization;
 
 #pragma warning disable 1591, 0114, 0108
@@ -921,4 +924,40 @@
             get { return ImageType.Reference; }
         }
     }
+
+    public static class SymbolDefEntryPoint
+    {
+        public static ICompoundSymbolDefinition CreateDefaultCompound()
+        {
+            return CompoundSymbolDefinition.CreateDefault();
+        }
+
+        public static ISimpleSymbolDefinition CreateDefaultSimple()
+        {
+            return SimpleSymbolDefinition.CreateDefault();
+        }
+
+        public static Stream Serialize(IResource res)
+        {
+            return res.SerializeToStream();
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            //HACK: We have to peek at the XML to determine if this is simple or compound.
+            var doc = new XmlDocument();
+            doc.LoadXml(xml);
+            if (doc.DocumentElement.Name == "SimpleSymbolDefinition") //NOXLATE
+            {
+                return SimpleSymbolDefinition.Deserialize(xml);
+            }
+            else
+            {
+                if (doc.DocumentElement.Name == "CompoundSymbolDefinition") //NOXLATE
+                    return CompoundSymbolDefinition.Deserialize(xml);
+                else //WTF?
+                    throw new SerializationException();
+            }
+        }
+    }
 }
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/SymbolDefinition/v1_1_0/SymbolDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/SymbolDefinition/v1_1_0/SymbolDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/SymbolDefinition/v1_1_0/SymbolDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,968 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define SYM_DEF_110
+using OSGeo.MapGuide.ObjectModels.Common;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Xml;
+using System.Xml.Serialization;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if SYM_DEF_240
+namespace OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0
+#elif SYM_DEF_110
+
+namespace OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0
+#endif
+{
+    abstract partial class SymbolDefinitionBase : ISymbolDefinitionBase
+    {
+        public abstract void RemoveSchemaAttributes();
+
+        public abstract void SetSchemaAttributes();
+
+#if SYM_DEF_240
+        protected static readonly Version RES_VERSION = new Version(2, 4, 0);
+#elif SYM_DEF_110
+        protected static readonly Version RES_VERSION = new Version(1, 1, 0);
+#else
+        protected static readonly Version RES_VERSION = new Version(1, 0, 0);
+#endif
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.SymbolDefinition.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.SymbolDefinition));
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.SymbolDefinition.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        object ICloneable.Clone()
+        {
+            return this.Clone();
+        }
+
+#if SYM_DEF_240
+        protected string _vschema = "SymbolDefinition-2.4.0.xsd"; //NOXLATE
+        public const string SCHEMA_NAME = "SymbolDefinition-2.4.0.xsd"; //NOXLATE
+#elif SYM_DEF_110
+        protected string _vschema = "SymbolDefinition-1.1.0.xsd"; //NOXLATE
+        public const string SCHEMA_NAME = "SymbolDefinition-1.1.0.xsd"; //NOXLATE
+#else
+        protected string _vschema = "SymbolDefinition-1.0.0.xsd"; //NOXLATE
+        public const string SCHEMA_NAME = "SymbolDefinition-1.0.0.xsd"; //NOXLATE
+#endif
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")] //NOXLATE
+        public string ValidatingSchema
+        {
+            get { return _vschema; }
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        [XmlIgnore]
+        public abstract SymbolDefinitionType Type { get; }
+    }
+
+    partial class SimpleSymbolDefinition : ISimpleSymbolDefinition
+    {
+        public override void RemoveSchemaAttributes()
+        {
+            _vschema = null;
+            versionField = null;
+        }
+
+        public override void SetSchemaAttributes()
+        {
+            _vschema = SCHEMA_NAME;
+            versionField = RES_VERSION.Major + "." + RES_VERSION.Minor + "." + RES_VERSION.Build;
+        }
+
+        public static SimpleSymbolDefinition CreateDefault()
+        {
+            var simpleSym = new SimpleSymbolDefinition()
+            {
+                Graphics = new System.ComponentModel.BindingList<GraphicBase>(),
+                ParameterDefinition = new ParameterDefinition()
+                {
+                    Parameter = new System.ComponentModel.BindingList<Parameter>()
+                }
+            };
+            return simpleSym;
+        }
+
+        [XmlIgnore]
+        IEnumerable<IGraphicBase> ISimpleSymbolDefinition.Graphics
+        {
+            get
+            {
+                foreach (var g in this.Graphics)
+                {
+                    yield return g;
+                }
+            }
+        }
+
+        void ISimpleSymbolDefinition.ClearGraphics()
+        {
+            this.Graphics.Clear();
+        }
+
+        void ISimpleSymbolDefinition.AddGraphics(IGraphicBase graphics)
+        {
+            var g = graphics as GraphicBase;
+            if (g != null)
+            {
+                this.Graphics.Add(g);
+            }
+        }
+
+        void ISimpleSymbolDefinition.RemoveGraphics(IGraphicBase graphics)
+        {
+            var g = graphics as GraphicBase;
+            if (g != null)
+            {
+                this.Graphics.Remove(g);
+            }
+        }
+
+        [XmlIgnore]
+        IResizeBox ISimpleSymbolDefinition.ResizeBox
+        {
+            get
+            {
+                return resizeBoxField;
+            }
+            set
+            {
+                resizeBoxField = (ResizeBox)value;
+            }
+        }
+
+        [XmlIgnore]
+        IPointUsage ISimpleSymbolDefinition.PointUsage
+        {
+            get
+            {
+                return pointUsageField;
+            }
+            set
+            {
+                pointUsageField = (PointUsage)value;
+            }
+        }
+
+        [XmlIgnore]
+        ILineUsage ISimpleSymbolDefinition.LineUsage
+        {
+            get
+            {
+                return lineUsageField;
+            }
+            set
+            {
+                lineUsageField = (LineUsage)value;
+            }
+        }
+
+        [XmlIgnore]
+        IAreaUsage ISimpleSymbolDefinition.AreaUsage
+        {
+            get
+            {
+                return areaUsageField;
+            }
+            set
+            {
+                areaUsageField = (AreaUsage)value;
+            }
+        }
+
+        [XmlIgnore]
+        IParameterDefinition ISimpleSymbolDefinition.ParameterDefinition
+        {
+            get { return parameterDefinitionField; }
+        }
+
+        public IImageReference CreateImageReference(string resourceId, string dataName)
+        {
+            return new ImageReference()
+            {
+                ResourceId = resourceId,
+                LibraryItemName = dataName
+            };
+        }
+
+        public IInlineImage CreateInlineImage(byte[] content)
+        {
+            return new InlineImage() { Content = content };
+        }
+
+        public IPointUsage CreatePointUsage()
+        {
+            return new PointUsage()
+            {
+                //Angle = "0", //NOXLATE
+                //AngleControl = "'FromAngle'", //NOXLATE
+                //OriginOffsetX = "0.0", //NOXLATE
+                //OriginOffsetY = "0.0" //NOXLATE
+            };
+        }
+
+        public ILineUsage CreateLineUsage()
+        {
+            return new LineUsage()
+            {
+                //Angle = "0", //NOXLATE
+                //AngleControl = "'FromGeometry'", //NOXLATE
+                /*
+                DefaultPath = new Path()
+                {
+                },*/
+                //EndOffset = "0", //NOXLATE
+                //Repeat = "0", //NOXLATE
+                //StartOffset = "0", //NOXLATE
+                //UnitsControl = "'Absolute'", //NOXLATE
+                //VertexAngleLimit = "0", //NOXLATE
+                //VertexControl = "'OverlapNone'", //NOXLATE
+                //VertexJoin = "'Round'", //NOXLATE
+                //VertexMiterLimit = "5" //NOXLATE
+            };
+        }
+
+        public IAreaUsage CreateAreaUsage()
+        {
+            return new AreaUsage()
+            {
+                //Angle = "0", //NOXLATE
+                //AngleControl = "'FromAngle'", //NOXLATE
+                //BufferWidth = "0", //NOXLATE
+                //ClippingControl = "'Clip'", //NOXLATE
+                //OriginControl = "'Global'", //NOXLATE
+                //OriginX = "0", //NOXLATE
+                //OriginY = "0", //NOXLATE
+                //RepeatX = "0", //NOXLATE
+                //RepeatY = "0" //NOXLATE
+            };
+        }
+
+        public IResizeBox CreateResizeBox()
+        {
+            return new ResizeBox()
+            {
+                SizeX = "1.0", //NOXLATE
+                SizeY = "1.0", //NOXLATE
+                PositionX = "0.0", //NOXLATE
+                PositionY = "0.0", //NOXLATE
+                GrowControl = "\'GrowInXYMaintainAspect\'" //NOXLATE
+            };
+        }
+
+        public ITextFrame CreateFrame()
+        {
+            return new TextFrame() { };
+        }
+
+        public ITextGraphic CreateTextGraphics()
+        {
+            //Required for minimum content
+            return new Text() { Content = "", FontName = "'Arial'" };  //NOXLATE
+        }
+
+        public IPathGraphic CreatePathGraphics()
+        {
+            return new Path() { };
+        }
+
+        public IImageGraphic CreateImageGraphics()
+        {
+            //default to empty inline content
+            return new Image()
+            {
+                Item = new byte[0]
+            };
+        }
+
+        public IParameter CreateParameter()
+        {
+            return new Parameter()
+            {
+                Identifier = "", //NOXLATE
+                DefaultValue = "", //NOXLATE
+                Description = "", //NOXLATE
+                DisplayName = "", //NOXLATE
+            };
+        }
+
+        [XmlIgnore]
+        public override SymbolDefinitionType Type
+        {
+            get { return SymbolDefinitionType.Simple; }
+        }
+    }
+
+    public class InlineImage : IInlineImage
+    {
+        public byte[] Content
+        {
+            get;
+            set;
+        }
+
+        public ImageType Type
+        {
+            get { return ImageType.Inline; }
+        }
+    }
+
+#if SYM_DEF_240 || SYM_DEF_110
+
+    partial class Text : ITextGraphic2
+#else
+
+    partial class Text : ITextGraphic
+#endif
+    {
+        [XmlIgnore]
+        public override GraphicElementType Type
+        {
+            get { return GraphicElementType.Text; }
+        }
+
+        [XmlIgnore]
+        ITextFrame ITextGraphic.Frame
+        {
+            get
+            {
+                return this.Frame;
+            }
+            set
+            {
+                this.Frame = (TextFrame)value;
+            }
+        }
+    }
+
+    partial class TextFrame : ITextFrame
+    {
+        [XmlIgnore]
+        double? ITextFrame.OffsetX
+        {
+            get
+            {
+                double d;
+                if (!double.TryParse(this.OffsetX, out d))
+                    return d;
+                return null;
+            }
+            set
+            {
+                if (value.HasValue)
+                    this.OffsetX = value.Value.ToString(CultureInfo.InvariantCulture);
+                else
+                    this.OffsetX = null;
+            }
+        }
+
+        [XmlIgnore]
+        double? ITextFrame.OffsetY
+        {
+            get
+            {
+                double d;
+                if (!double.TryParse(this.OffsetY, out d))
+                    return d;
+                return null;
+            }
+            set
+            {
+                if (value.HasValue)
+                    this.OffsetY = value.Value.ToString(CultureInfo.InvariantCulture);
+                else
+                    this.OffsetY = null;
+            }
+        }
+    }
+
+    partial class ResizeBox : IResizeBox
+    {
+    }
+
+    partial class Graphics : IGraphics
+    {
+        [XmlIgnore]
+        public IEnumerable<IGraphicBase> Elements
+        {
+            get
+            {
+                foreach (var g in this.Items)
+                {
+                    yield return g;
+                }
+            }
+        }
+
+        public void AddGraphicElement(IGraphicBase graphics)
+        {
+            var g = graphics as GraphicBase;
+            if (g != null)
+            {
+                this.Items.Add(g);
+            }
+        }
+
+        public void RemoveGraphicElement(IGraphicBase graphics)
+        {
+            var g = graphics as GraphicBase;
+            if (g != null)
+            {
+                this.Items.Remove(g);
+            }
+        }
+    }
+
+    abstract partial class GraphicBase : IGraphicBase
+    {
+        public abstract GraphicElementType Type
+        {
+            get;
+        }
+    }
+
+    partial class Parameter : IParameter
+    {
+        [XmlIgnore]
+        string IParameter.DataType
+        {
+            get
+            {
+                return dataTypeField.ToString();
+            }
+            set
+            {
+#if SYM_DEF_110 || SYM_DEF_240
+                dataTypeField = (DataType2)Enum.Parse(typeof(DataType2), value);
+#else
+                dataTypeField = (DataType)Enum.Parse(typeof(DataType), value);
+#endif
+            }
+        }
+
+        string IExpressionPropertySource.Name
+        {
+            get { return this.Identifier; }
+        }
+
+        string IExpressionPropertySource.Description
+        {
+            get { return this.Description; }
+        }
+
+#if SYM_DEF_110 || SYM_DEF_240
+
+        private static ExpressionDataType GetExpressionType(DataType2 dt)
+        {
+            switch (dt)
+            {
+                case DataType2.Angle:
+                    return ExpressionDataType.Sym_Angle;
+
+                case DataType2.Bold:
+                    return ExpressionDataType.Sym_Bold;
+
+                case DataType2.Boolean:
+                    return ExpressionDataType.Sym_Boolean;
+
+                case DataType2.Color:
+                    return ExpressionDataType.Sym_Color;
+
+                case DataType2.Content:
+                    return ExpressionDataType.Sym_Content;
+
+                case DataType2.EndOffset:
+                    return ExpressionDataType.Sym_EndOffset;
+
+                case DataType2.FillColor:
+                    return ExpressionDataType.Sym_FillColor;
+
+                case DataType2.FontHeight:
+                    return ExpressionDataType.Sym_FontHeight;
+
+                case DataType2.FontName:
+                    return ExpressionDataType.Sym_FontName;
+
+                case DataType2.FrameFillColor:
+                    return ExpressionDataType.Sym_FrameFillColor;
+
+                case DataType2.FrameLineColor:
+                    return ExpressionDataType.Sym_FrameLineColor;
+
+                case DataType2.GhostColor:
+                    return ExpressionDataType.Sym_GhostColor;
+
+                case DataType2.HorizontalAlignment:
+                    return ExpressionDataType.Sym_HorizontalAlignment;
+
+                case DataType2.Integer:
+                    return ExpressionDataType.Sym_Integer;
+
+                case DataType2.Italic:
+                    return ExpressionDataType.Sym_Italic;
+
+                case DataType2.Justification:
+                    return ExpressionDataType.Sym_Justification;
+
+                case DataType2.LineColor:
+                    return ExpressionDataType.Sym_LineColor;
+
+                case DataType2.LineSpacing:
+                    return ExpressionDataType.Sym_LineSpacing;
+
+                case DataType2.LineWeight:
+                    return ExpressionDataType.Sym_LineWeight;
+
+                case DataType2.Markup:
+                    return ExpressionDataType.Sym_Markup;
+
+                case DataType2.ObliqueAngle:
+                    return ExpressionDataType.Sym_ObliqueAngle;
+
+                case DataType2.Overlined:
+                    return ExpressionDataType.Sym_Overlined;
+
+                case DataType2.Real:
+                    return ExpressionDataType.Sym_Real;
+
+                case DataType2.RepeatX:
+                    return ExpressionDataType.Sym_RepeatX;
+
+                case DataType2.RepeatY:
+                    return ExpressionDataType.Sym_RepeatY;
+
+                case DataType2.StartOffset:
+                    return ExpressionDataType.Sym_StartOffset;
+
+                case DataType2.String:
+                    return ExpressionDataType.Sym_String;
+
+                case DataType2.TextColor:
+                    return ExpressionDataType.Sym_TextColor;
+
+                case DataType2.TrackSpacing:
+                    return ExpressionDataType.Sym_TrackSpacing;
+
+                case DataType2.Underlined:
+                    return ExpressionDataType.Sym_Underlined;
+
+                case DataType2.VerticalAlignment:
+                    return ExpressionDataType.Sym_VerticalAlignment;
+            }
+            throw new ArgumentException();
+        }
+
+#else
+
+        private static ExpressionDataType GetExpressionType(DataType dt)
+        {
+            switch (dt)
+            {
+                case DataType.Boolean:
+                    return ExpressionDataType.Sym_Boolean;
+
+                case DataType.Color:
+                    return ExpressionDataType.Sym_Color;
+
+                case DataType.Integer:
+                    return ExpressionDataType.Sym_Integer;
+
+                case DataType.Real:
+                    return ExpressionDataType.Sym_Real;
+
+                case DataType.String:
+                    return ExpressionDataType.Sym_String;
+            }
+            throw new ArgumentException();
+        }
+
+#endif
+
+        ExpressionDataType IExpressionPropertySource.ExpressionType
+        {
+            get { return GetExpressionType(this.DataType); }
+        }
+    }
+
+    partial class ParameterDefinition : IParameterDefinition
+    {
+        [XmlIgnore]
+        IEnumerable<IParameter> IParameterDefinition.Parameter
+        {
+            get
+            {
+                foreach (var p in this.Parameter)
+                {
+                    yield return p;
+                }
+            }
+        }
+
+        public void AddParameter(IParameter param)
+        {
+            var p = param as Parameter;
+            if (p != null)
+            {
+                this.Parameter.Add(p);
+            }
+        }
+
+        public void RemoveParameter(IParameter param)
+        {
+            var p = param as Parameter;
+            if (p != null)
+            {
+                this.Parameter.Remove(p);
+            }
+        }
+    }
+
+    partial class LineUsage : ILineUsage
+    {
+        [XmlIgnore]
+        IPathGraphic ILineUsage.DefaultPath
+        {
+            get
+            {
+                return this.DefaultPath;
+            }
+            set
+            {
+                this.DefaultPath = (Path)value;
+            }
+        }
+    }
+
+    partial class PointUsage : IPointUsage
+    {
+    }
+
+    partial class AreaUsage : IAreaUsage
+    {
+    }
+
+    partial class Path : IPathGraphic
+#if SYM_DEF_240
+        , IPathGraphic2
+#endif
+    {
+        [XmlIgnore]
+        public override GraphicElementType Type
+        {
+            get { return GraphicElementType.Path; }
+        }
+    }
+
+    partial class CompoundSymbolDefinition : ICompoundSymbolDefinition
+    {
+        public override void RemoveSchemaAttributes()
+        {
+            _vschema = null;
+            versionField = null;
+            foreach (var sm in this.SimpleSymbol)
+            {
+                var ssym = sm.Item as ISimpleSymbolDefinition;
+                var csym = sm.Item as ICompoundSymbolDefinition;
+                if (ssym != null)
+                    ssym.RemoveSchemaAttributes();
+                else if (csym != null)
+                    csym.RemoveSchemaAttributes();
+            }
+        }
+
+        public override void SetSchemaAttributes()
+        {
+            _vschema = SCHEMA_NAME;
+            versionField = RES_VERSION.Major + "." + RES_VERSION.Minor + "." + RES_VERSION.Build;
+        }
+
+        public static CompoundSymbolDefinition CreateDefault()
+        {
+            var sym = new CompoundSymbolDefinition()
+            {
+                SimpleSymbol = new System.ComponentModel.BindingList<SimpleSymbol>(),
+            };
+            return sym;
+        }
+
+        [XmlIgnore]
+        IEnumerable<ISimpleSymbolReferenceBase> ICompoundSymbolDefinition.SimpleSymbol
+        {
+            get
+            {
+                foreach (var sym in this.SimpleSymbol)
+                {
+                    yield return sym;
+                }
+            }
+        }
+
+        void ICompoundSymbolDefinition.AddSimpleSymbol(ISimpleSymbolReferenceBase sym)
+        {
+            var symb = sym as SimpleSymbol;
+            if (symb != null)
+            {
+                this.SimpleSymbol.Add(symb);
+            }
+        }
+
+        void ICompoundSymbolDefinition.RemoveSimpleSymbol(ISimpleSymbolReferenceBase sym)
+        {
+            var symb = sym as SimpleSymbol;
+            if (symb != null)
+            {
+                this.SimpleSymbol.Remove(symb);
+            }
+        }
+
+        public ISimpleSymbolReferenceBase CreateSimpleSymbol(ISimpleSymbolDefinition sym)
+        {
+            var s = (SimpleSymbolDefinition)sym;
+            s.RemoveSchemaAttributes();
+            return new SimpleSymbol() { Item = s };
+        }
+
+        public ISimpleSymbolReferenceBase CreateSymbolReference(string resourceId)
+        {
+            return new SimpleSymbol() { Item = resourceId };
+        }
+
+        [XmlIgnore]
+        public override SymbolDefinitionType Type
+        {
+            get { return SymbolDefinitionType.Compound; }
+        }
+
+        public void PurgeSimpleSymbolAttributes()
+        {
+            foreach (var sym in this.SimpleSymbol)
+            {
+                if (sym.Type == SimpleSymbolReferenceType.Inline)
+                {
+                    var s = (SimpleSymbolDefinition)sym.Item;
+                    s.RemoveSchemaAttributes();
+                }
+            }
+        }
+    }
+
+    partial class SimpleSymbol : ISimpleSymbolInlineReference, ISimpleSymbolLibraryReference
+    {
+        [XmlIgnore]
+        ISimpleSymbolDefinition ISimpleSymbolInlineReference.SimpleSymbolDefinition
+        {
+            get
+            {
+                return (ISimpleSymbolDefinition)this.Item;
+            }
+            set
+            {
+                this.Item = value;
+            }
+        }
+
+        [XmlIgnore]
+        public SimpleSymbolReferenceType Type
+        {
+            get
+            {
+                if (this.Item != null)
+                {
+                    if (typeof(ISimpleSymbolDefinition).IsAssignableFrom(this.Item.GetType()))
+                        return SimpleSymbolReferenceType.Inline;
+                    else if (typeof(string) == this.Item.GetType())
+                        return SimpleSymbolReferenceType.Library;
+                }
+                return SimpleSymbolReferenceType.Undefined;
+            }
+        }
+
+        [XmlIgnore]
+        string IResourceIdReference.ResourceId
+        {
+            get
+            {
+                return (string)this.Item;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.SymbolDefinition.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.SymbolDefinition));
+
+                this.Item = value;
+                OnPropertyChanged("ResourceId"); //NOXLATE
+            }
+        }
+    }
+
+    partial class Image : IImageGraphic
+    {
+        [XmlIgnore]
+        public override GraphicElementType Type
+        {
+            get { return GraphicElementType.Image; }
+        }
+
+        [XmlIgnore]
+        IImageBase IImageGraphic.Item
+        {
+            get
+            {
+                byte[] content = this.Item as byte[];
+                ImageReference imageRef = this.Item as ImageReference;
+                if (content != null)
+                    return new InlineImage() { Content = content };
+                else if (imageRef != null)
+                    return imageRef;
+                else
+                    return null;
+            }
+            set
+            {
+                if (value != null)
+                {
+                    var inline = value as IInlineImage;
+                    var imageRef = value as IImageReference;
+                    if (inline != null)
+                        this.Item = inline.Content;
+                    else if (imageRef != null)
+                        this.Item = (ImageReference)imageRef;
+                }
+                else
+                {
+                    this.Item = null;
+                }
+            }
+        }
+    }
+
+    partial class ImageReference : ISymbolInstanceReferenceLibrary, IImageReference
+    {
+        [XmlIgnore]
+        SymbolInstanceType ISymbolInstanceReference.Type
+        {
+            get { return SymbolInstanceType.Reference; }
+        }
+
+        ImageType IImageBase.Type
+        {
+            get { return ImageType.Reference; }
+        }
+    }
+
+    public static class SymbolDefEntryPoint
+    {
+        public static ICompoundSymbolDefinition CreateDefaultCompound()
+        {
+            return CompoundSymbolDefinition.CreateDefault();
+        }
+
+        public static ISimpleSymbolDefinition CreateDefaultSimple()
+        {
+            return SimpleSymbolDefinition.CreateDefault();
+        }
+
+        public static Stream Serialize(IResource res)
+        {
+            return res.SerializeToStream();
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            //HACK: We have to peek at the XML to determine if this is simple or compound.
+            var doc = new XmlDocument();
+            doc.LoadXml(xml);
+            if (doc.DocumentElement.Name == "SimpleSymbolDefinition") //NOXLATE
+            {
+                return SimpleSymbolDefinition.Deserialize(xml);
+            }
+            else
+            {
+                if (doc.DocumentElement.Name == "CompoundSymbolDefinition") //NOXLATE
+                    return CompoundSymbolDefinition.Deserialize(xml);
+                else //WTF?
+                    throw new SerializationException();
+            }
+        }
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/SymbolDefinition/v2_4_0/SymbolDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/SymbolDefinition/v2_4_0/SymbolDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/SymbolDefinition/v2_4_0/SymbolDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,969 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define SYM_DEF_240
+using OSGeo.MapGuide.ObjectModels.Common;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Xml;
+using System.Xml.Serialization;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if SYM_DEF_240
+
+namespace OSGeo.MapGuide.ObjectModels.SymbolDefinition.v2_4_0
+#elif SYM_DEF_110
+
+namespace OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_1_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.SymbolDefinition.v1_0_0
+#endif
+{
+    abstract partial class SymbolDefinitionBase : ISymbolDefinitionBase
+    {
+        public abstract void RemoveSchemaAttributes();
+
+        public abstract void SetSchemaAttributes();
+
+#if SYM_DEF_240
+        protected static readonly Version RES_VERSION = new Version(2, 4, 0);
+#elif SYM_DEF_110
+        protected static readonly Version RES_VERSION = new Version(1, 1, 0);
+#else
+        protected static readonly Version RES_VERSION = new Version(1, 0, 0);
+#endif
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.SymbolDefinition.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.SymbolDefinition));
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.SymbolDefinition.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        object ICloneable.Clone()
+        {
+            return this.Clone();
+        }
+
+#if SYM_DEF_240
+        protected string _vschema = "SymbolDefinition-2.4.0.xsd"; //NOXLATE
+        public const string SCHEMA_NAME = "SymbolDefinition-2.4.0.xsd"; //NOXLATE
+#elif SYM_DEF_110
+        protected string _vschema = "SymbolDefinition-1.1.0.xsd"; //NOXLATE
+        public const string SCHEMA_NAME = "SymbolDefinition-1.1.0.xsd"; //NOXLATE
+#else
+        protected string _vschema = "SymbolDefinition-1.0.0.xsd"; //NOXLATE
+        public const string SCHEMA_NAME = "SymbolDefinition-1.0.0.xsd"; //NOXLATE
+#endif
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")] //NOXLATE
+        public string ValidatingSchema
+        {
+            get { return _vschema; }
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        [XmlIgnore]
+        public abstract SymbolDefinitionType Type { get; }
+    }
+
+    partial class SimpleSymbolDefinition : ISimpleSymbolDefinition
+    {
+        public override void RemoveSchemaAttributes()
+        {
+            _vschema = null;
+            versionField = null;
+        }
+
+        public override void SetSchemaAttributes()
+        {
+            _vschema = SCHEMA_NAME;
+            versionField = RES_VERSION.Major + "." + RES_VERSION.Minor + "." + RES_VERSION.Build;
+        }
+
+        public static SimpleSymbolDefinition CreateDefault()
+        {
+            var simpleSym = new SimpleSymbolDefinition()
+            {
+                Graphics = new System.ComponentModel.BindingList<GraphicBase>(),
+                ParameterDefinition = new ParameterDefinition()
+                {
+                    Parameter = new System.ComponentModel.BindingList<Parameter>()
+                }
+            };
+            return simpleSym;
+        }
+
+        [XmlIgnore]
+        IEnumerable<IGraphicBase> ISimpleSymbolDefinition.Graphics
+        {
+            get
+            {
+                foreach (var g in this.Graphics)
+                {
+                    yield return g;
+                }
+            }
+        }
+
+        void ISimpleSymbolDefinition.ClearGraphics()
+        {
+            this.Graphics.Clear();
+        }
+
+        void ISimpleSymbolDefinition.AddGraphics(IGraphicBase graphics)
+        {
+            var g = graphics as GraphicBase;
+            if (g != null)
+            {
+                this.Graphics.Add(g);
+            }
+        }
+
+        void ISimpleSymbolDefinition.RemoveGraphics(IGraphicBase graphics)
+        {
+            var g = graphics as GraphicBase;
+            if (g != null)
+            {
+                this.Graphics.Remove(g);
+            }
+        }
+
+        [XmlIgnore]
+        IResizeBox ISimpleSymbolDefinition.ResizeBox
+        {
+            get
+            {
+                return resizeBoxField;
+            }
+            set
+            {
+                resizeBoxField = (ResizeBox)value;
+            }
+        }
+
+        [XmlIgnore]
+        IPointUsage ISimpleSymbolDefinition.PointUsage
+        {
+            get
+            {
+                return pointUsageField;
+            }
+            set
+            {
+                pointUsageField = (PointUsage)value;
+            }
+        }
+
+        [XmlIgnore]
+        ILineUsage ISimpleSymbolDefinition.LineUsage
+        {
+            get
+            {
+                return lineUsageField;
+            }
+            set
+            {
+                lineUsageField = (LineUsage)value;
+            }
+        }
+
+        [XmlIgnore]
+        IAreaUsage ISimpleSymbolDefinition.AreaUsage
+        {
+            get
+            {
+                return areaUsageField;
+            }
+            set
+            {
+                areaUsageField = (AreaUsage)value;
+            }
+        }
+
+        [XmlIgnore]
+        IParameterDefinition ISimpleSymbolDefinition.ParameterDefinition
+        {
+            get { return parameterDefinitionField; }
+        }
+
+        public IImageReference CreateImageReference(string resourceId, string dataName)
+        {
+            return new ImageReference()
+            {
+                ResourceId = resourceId,
+                LibraryItemName = dataName
+            };
+        }
+
+        public IInlineImage CreateInlineImage(byte[] content)
+        {
+            return new InlineImage() { Content = content };
+        }
+
+        public IPointUsage CreatePointUsage()
+        {
+            return new PointUsage()
+            {
+                //Angle = "0", //NOXLATE
+                //AngleControl = "'FromAngle'", //NOXLATE
+                //OriginOffsetX = "0.0", //NOXLATE
+                //OriginOffsetY = "0.0" //NOXLATE
+            };
+        }
+
+        public ILineUsage CreateLineUsage()
+        {
+            return new LineUsage()
+            {
+                //Angle = "0", //NOXLATE
+                //AngleControl = "'FromGeometry'", //NOXLATE
+                /*
+                DefaultPath = new Path()
+                {
+                },*/
+                //EndOffset = "0", //NOXLATE
+                //Repeat = "0", //NOXLATE
+                //StartOffset = "0", //NOXLATE
+                //UnitsControl = "'Absolute'", //NOXLATE
+                //VertexAngleLimit = "0", //NOXLATE
+                //VertexControl = "'OverlapNone'", //NOXLATE
+                //VertexJoin = "'Round'", //NOXLATE
+                //VertexMiterLimit = "5" //NOXLATE
+            };
+        }
+
+        public IAreaUsage CreateAreaUsage()
+        {
+            return new AreaUsage()
+            {
+                //Angle = "0", //NOXLATE
+                //AngleControl = "'FromAngle'", //NOXLATE
+                //BufferWidth = "0", //NOXLATE
+                //ClippingControl = "'Clip'", //NOXLATE
+                //OriginControl = "'Global'", //NOXLATE
+                //OriginX = "0", //NOXLATE
+                //OriginY = "0", //NOXLATE
+                //RepeatX = "0", //NOXLATE
+                //RepeatY = "0" //NOXLATE
+            };
+        }
+
+        public IResizeBox CreateResizeBox()
+        {
+            return new ResizeBox()
+            {
+                SizeX = "1.0", //NOXLATE
+                SizeY = "1.0", //NOXLATE
+                PositionX = "0.0", //NOXLATE
+                PositionY = "0.0", //NOXLATE
+                GrowControl = "\'GrowInXYMaintainAspect\'" //NOXLATE
+            };
+        }
+
+        public ITextFrame CreateFrame()
+        {
+            return new TextFrame() { };
+        }
+
+        public ITextGraphic CreateTextGraphics()
+        {
+            //Required for minimum content
+            return new Text() { Content = "", FontName = "'Arial'" };  //NOXLATE
+        }
+
+        public IPathGraphic CreatePathGraphics()
+        {
+            return new Path() { };
+        }
+
+        public IImageGraphic CreateImageGraphics()
+        {
+            //default to empty inline content
+            return new Image()
+            {
+                Item = new byte[0]
+            };
+        }
+
+        public IParameter CreateParameter()
+        {
+            return new Parameter()
+            {
+                Identifier = "", //NOXLATE
+                DefaultValue = "", //NOXLATE
+                Description = "", //NOXLATE
+                DisplayName = "", //NOXLATE
+            };
+        }
+
+        [XmlIgnore]
+        public override SymbolDefinitionType Type
+        {
+            get { return SymbolDefinitionType.Simple; }
+        }
+    }
+
+    public class InlineImage : IInlineImage
+    {
+        public byte[] Content
+        {
+            get;
+            set;
+        }
+
+        public ImageType Type
+        {
+            get { return ImageType.Inline; }
+        }
+    }
+
+#if SYM_DEF_240 || SYM_DEF_110
+
+    partial class Text : ITextGraphic2
+#else
+
+    partial class Text : ITextGraphic
+#endif
+    {
+        [XmlIgnore]
+        public override GraphicElementType Type
+        {
+            get { return GraphicElementType.Text; }
+        }
+
+        [XmlIgnore]
+        ITextFrame ITextGraphic.Frame
+        {
+            get
+            {
+                return this.Frame;
+            }
+            set
+            {
+                this.Frame = (TextFrame)value;
+            }
+        }
+    }
+
+    partial class TextFrame : ITextFrame
+    {
+        [XmlIgnore]
+        double? ITextFrame.OffsetX
+        {
+            get
+            {
+                double d;
+                if (!double.TryParse(this.OffsetX, out d))
+                    return d;
+                return null;
+            }
+            set
+            {
+                if (value.HasValue)
+                    this.OffsetX = value.Value.ToString(CultureInfo.InvariantCulture);
+                else
+                    this.OffsetX = null;
+            }
+        }
+
+        [XmlIgnore]
+        double? ITextFrame.OffsetY
+        {
+            get
+            {
+                double d;
+                if (!double.TryParse(this.OffsetY, out d))
+                    return d;
+                return null;
+            }
+            set
+            {
+                if (value.HasValue)
+                    this.OffsetY = value.Value.ToString(CultureInfo.InvariantCulture);
+                else
+                    this.OffsetY = null;
+            }
+        }
+    }
+
+    partial class ResizeBox : IResizeBox
+    {
+    }
+
+    partial class Graphics : IGraphics
+    {
+        [XmlIgnore]
+        public IEnumerable<IGraphicBase> Elements
+        {
+            get
+            {
+                foreach (var g in this.Items)
+                {
+                    yield return g;
+                }
+            }
+        }
+
+        public void AddGraphicElement(IGraphicBase graphics)
+        {
+            var g = graphics as GraphicBase;
+            if (g != null)
+            {
+                this.Items.Add(g);
+            }
+        }
+
+        public void RemoveGraphicElement(IGraphicBase graphics)
+        {
+            var g = graphics as GraphicBase;
+            if (g != null)
+            {
+                this.Items.Remove(g);
+            }
+        }
+    }
+
+    abstract partial class GraphicBase : IGraphicBase
+    {
+        public abstract GraphicElementType Type
+        {
+            get;
+        }
+    }
+
+    partial class Parameter : IParameter
+    {
+        [XmlIgnore]
+        string IParameter.DataType
+        {
+            get
+            {
+                return dataTypeField.ToString();
+            }
+            set
+            {
+#if SYM_DEF_110 || SYM_DEF_240
+                dataTypeField = (DataType2)Enum.Parse(typeof(DataType2), value);
+#else
+                dataTypeField = (DataType)Enum.Parse(typeof(DataType), value);
+#endif
+            }
+        }
+
+        string IExpressionPropertySource.Name
+        {
+            get { return this.Identifier; }
+        }
+
+        string IExpressionPropertySource.Description
+        {
+            get { return this.Description; }
+        }
+
+#if SYM_DEF_110 || SYM_DEF_240
+
+        private static ExpressionDataType GetExpressionType(DataType2 dt)
+        {
+            switch (dt)
+            {
+                case DataType2.Angle:
+                    return ExpressionDataType.Sym_Angle;
+
+                case DataType2.Bold:
+                    return ExpressionDataType.Sym_Bold;
+
+                case DataType2.Boolean:
+                    return ExpressionDataType.Sym_Boolean;
+
+                case DataType2.Color:
+                    return ExpressionDataType.Sym_Color;
+
+                case DataType2.Content:
+                    return ExpressionDataType.Sym_Content;
+
+                case DataType2.EndOffset:
+                    return ExpressionDataType.Sym_EndOffset;
+
+                case DataType2.FillColor:
+                    return ExpressionDataType.Sym_FillColor;
+
+                case DataType2.FontHeight:
+                    return ExpressionDataType.Sym_FontHeight;
+
+                case DataType2.FontName:
+                    return ExpressionDataType.Sym_FontName;
+
+                case DataType2.FrameFillColor:
+                    return ExpressionDataType.Sym_FrameFillColor;
+
+                case DataType2.FrameLineColor:
+                    return ExpressionDataType.Sym_FrameLineColor;
+
+                case DataType2.GhostColor:
+                    return ExpressionDataType.Sym_GhostColor;
+
+                case DataType2.HorizontalAlignment:
+                    return ExpressionDataType.Sym_HorizontalAlignment;
+
+                case DataType2.Integer:
+                    return ExpressionDataType.Sym_Integer;
+
+                case DataType2.Italic:
+                    return ExpressionDataType.Sym_Italic;
+
+                case DataType2.Justification:
+                    return ExpressionDataType.Sym_Justification;
+
+                case DataType2.LineColor:
+                    return ExpressionDataType.Sym_LineColor;
+
+                case DataType2.LineSpacing:
+                    return ExpressionDataType.Sym_LineSpacing;
+
+                case DataType2.LineWeight:
+                    return ExpressionDataType.Sym_LineWeight;
+
+                case DataType2.Markup:
+                    return ExpressionDataType.Sym_Markup;
+
+                case DataType2.ObliqueAngle:
+                    return ExpressionDataType.Sym_ObliqueAngle;
+
+                case DataType2.Overlined:
+                    return ExpressionDataType.Sym_Overlined;
+
+                case DataType2.Real:
+                    return ExpressionDataType.Sym_Real;
+
+                case DataType2.RepeatX:
+                    return ExpressionDataType.Sym_RepeatX;
+
+                case DataType2.RepeatY:
+                    return ExpressionDataType.Sym_RepeatY;
+
+                case DataType2.StartOffset:
+                    return ExpressionDataType.Sym_StartOffset;
+
+                case DataType2.String:
+                    return ExpressionDataType.Sym_String;
+
+                case DataType2.TextColor:
+                    return ExpressionDataType.Sym_TextColor;
+
+                case DataType2.TrackSpacing:
+                    return ExpressionDataType.Sym_TrackSpacing;
+
+                case DataType2.Underlined:
+                    return ExpressionDataType.Sym_Underlined;
+
+                case DataType2.VerticalAlignment:
+                    return ExpressionDataType.Sym_VerticalAlignment;
+            }
+            throw new ArgumentException();
+        }
+
+#else
+
+        private static ExpressionDataType GetExpressionType(DataType dt)
+        {
+            switch (dt)
+            {
+                case DataType.Boolean:
+                    return ExpressionDataType.Sym_Boolean;
+
+                case DataType.Color:
+                    return ExpressionDataType.Sym_Color;
+
+                case DataType.Integer:
+                    return ExpressionDataType.Sym_Integer;
+
+                case DataType.Real:
+                    return ExpressionDataType.Sym_Real;
+
+                case DataType.String:
+                    return ExpressionDataType.Sym_String;
+            }
+            throw new ArgumentException();
+        }
+
+#endif
+
+        ExpressionDataType IExpressionPropertySource.ExpressionType
+        {
+            get { return GetExpressionType(this.DataType); }
+        }
+    }
+
+    partial class ParameterDefinition : IParameterDefinition
+    {
+        [XmlIgnore]
+        IEnumerable<IParameter> IParameterDefinition.Parameter
+        {
+            get
+            {
+                foreach (var p in this.Parameter)
+                {
+                    yield return p;
+                }
+            }
+        }
+
+        public void AddParameter(IParameter param)
+        {
+            var p = param as Parameter;
+            if (p != null)
+            {
+                this.Parameter.Add(p);
+            }
+        }
+
+        public void RemoveParameter(IParameter param)
+        {
+            var p = param as Parameter;
+            if (p != null)
+            {
+                this.Parameter.Remove(p);
+            }
+        }
+    }
+
+    partial class LineUsage : ILineUsage
+    {
+        [XmlIgnore]
+        IPathGraphic ILineUsage.DefaultPath
+        {
+            get
+            {
+                return this.DefaultPath;
+            }
+            set
+            {
+                this.DefaultPath = (Path)value;
+            }
+        }
+    }
+
+    partial class PointUsage : IPointUsage
+    {
+    }
+
+    partial class AreaUsage : IAreaUsage
+    {
+    }
+
+    partial class Path : IPathGraphic
+#if SYM_DEF_240
+, IPathGraphic2
+#endif
+    {
+        [XmlIgnore]
+        public override GraphicElementType Type
+        {
+            get { return GraphicElementType.Path; }
+        }
+    }
+
+    partial class CompoundSymbolDefinition : ICompoundSymbolDefinition
+    {
+        public override void RemoveSchemaAttributes()
+        {
+            _vschema = null;
+            versionField = null;
+            foreach (var sm in this.SimpleSymbol)
+            {
+                var ssym = sm.Item as ISimpleSymbolDefinition;
+                var csym = sm.Item as ICompoundSymbolDefinition;
+                if (ssym != null)
+                    ssym.RemoveSchemaAttributes();
+                else if (csym != null)
+                    csym.RemoveSchemaAttributes();
+            }
+        }
+
+        public override void SetSchemaAttributes()
+        {
+            _vschema = SCHEMA_NAME;
+            versionField = RES_VERSION.Major + "." + RES_VERSION.Minor + "." + RES_VERSION.Build;
+        }
+
+        public static CompoundSymbolDefinition CreateDefault()
+        {
+            var sym = new CompoundSymbolDefinition()
+            {
+                SimpleSymbol = new System.ComponentModel.BindingList<SimpleSymbol>(),
+            };
+            return sym;
+        }
+
+        [XmlIgnore]
+        IEnumerable<ISimpleSymbolReferenceBase> ICompoundSymbolDefinition.SimpleSymbol
+        {
+            get
+            {
+                foreach (var sym in this.SimpleSymbol)
+                {
+                    yield return sym;
+                }
+            }
+        }
+
+        void ICompoundSymbolDefinition.AddSimpleSymbol(ISimpleSymbolReferenceBase sym)
+        {
+            var symb = sym as SimpleSymbol;
+            if (symb != null)
+            {
+                this.SimpleSymbol.Add(symb);
+            }
+        }
+
+        void ICompoundSymbolDefinition.RemoveSimpleSymbol(ISimpleSymbolReferenceBase sym)
+        {
+            var symb = sym as SimpleSymbol;
+            if (symb != null)
+            {
+                this.SimpleSymbol.Remove(symb);
+            }
+        }
+
+        public ISimpleSymbolReferenceBase CreateSimpleSymbol(ISimpleSymbolDefinition sym)
+        {
+            var s = (SimpleSymbolDefinition)sym;
+            s.RemoveSchemaAttributes();
+            return new SimpleSymbol() { Item = s };
+        }
+
+        public ISimpleSymbolReferenceBase CreateSymbolReference(string resourceId)
+        {
+            return new SimpleSymbol() { Item = resourceId };
+        }
+
+        [XmlIgnore]
+        public override SymbolDefinitionType Type
+        {
+            get { return SymbolDefinitionType.Compound; }
+        }
+
+        public void PurgeSimpleSymbolAttributes()
+        {
+            foreach (var sym in this.SimpleSymbol)
+            {
+                if (sym.Type == SimpleSymbolReferenceType.Inline)
+                {
+                    var s = (SimpleSymbolDefinition)sym.Item;
+                    s.RemoveSchemaAttributes();
+                }
+            }
+        }
+    }
+
+    partial class SimpleSymbol : ISimpleSymbolInlineReference, ISimpleSymbolLibraryReference
+    {
+        [XmlIgnore]
+        ISimpleSymbolDefinition ISimpleSymbolInlineReference.SimpleSymbolDefinition
+        {
+            get
+            {
+                return (ISimpleSymbolDefinition)this.Item;
+            }
+            set
+            {
+                this.Item = value;
+            }
+        }
+
+        [XmlIgnore]
+        public SimpleSymbolReferenceType Type
+        {
+            get
+            {
+                if (this.Item != null)
+                {
+                    if (typeof(ISimpleSymbolDefinition).IsAssignableFrom(this.Item.GetType()))
+                        return SimpleSymbolReferenceType.Inline;
+                    else if (typeof(string) == this.Item.GetType())
+                        return SimpleSymbolReferenceType.Library;
+                }
+                return SimpleSymbolReferenceType.Undefined;
+            }
+        }
+
+        [XmlIgnore]
+        string IResourceIdReference.ResourceId
+        {
+            get
+            {
+                return (string)this.Item;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.SymbolDefinition.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.SymbolDefinition));
+
+                this.Item = value;
+                OnPropertyChanged("ResourceId"); //NOXLATE
+            }
+        }
+    }
+
+    partial class Image : IImageGraphic
+    {
+        [XmlIgnore]
+        public override GraphicElementType Type
+        {
+            get { return GraphicElementType.Image; }
+        }
+
+        [XmlIgnore]
+        IImageBase IImageGraphic.Item
+        {
+            get
+            {
+                byte[] content = this.Item as byte[];
+                ImageReference imageRef = this.Item as ImageReference;
+                if (content != null)
+                    return new InlineImage() { Content = content };
+                else if (imageRef != null)
+                    return imageRef;
+                else
+                    return null;
+            }
+            set
+            {
+                if (value != null)
+                {
+                    var inline = value as IInlineImage;
+                    var imageRef = value as IImageReference;
+                    if (inline != null)
+                        this.Item = inline.Content;
+                    else if (imageRef != null)
+                        this.Item = (ImageReference)imageRef;
+                }
+                else
+                {
+                    this.Item = null;
+                }
+            }
+        }
+    }
+
+    partial class ImageReference : ISymbolInstanceReferenceLibrary, IImageReference
+    {
+        [XmlIgnore]
+        SymbolInstanceType ISymbolInstanceReference.Type
+        {
+            get { return SymbolInstanceType.Reference; }
+        }
+
+        ImageType IImageBase.Type
+        {
+            get { return ImageType.Reference; }
+        }
+    }
+
+    public static class SymbolDefEntryPoint
+    {
+        public static ICompoundSymbolDefinition CreateDefaultCompound()
+        {
+            return CompoundSymbolDefinition.CreateDefault();
+        }
+
+        public static ISimpleSymbolDefinition CreateDefaultSimple()
+        {
+            return SimpleSymbolDefinition.CreateDefault();
+        }
+
+        public static Stream Serialize(IResource res)
+        {
+            return res.SerializeToStream();
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            //HACK: We have to peek at the XML to determine if this is simple or compound.
+            var doc = new XmlDocument();
+            doc.LoadXml(xml);
+            if (doc.DocumentElement.Name == "SimpleSymbolDefinition") //NOXLATE
+            {
+                return SimpleSymbolDefinition.Deserialize(xml);
+            }
+            else
+            {
+                if (doc.DocumentElement.Name == "CompoundSymbolDefinition") //NOXLATE
+                    return CompoundSymbolDefinition.Deserialize(xml);
+                else //WTF?
+                    throw new SerializationException();
+            }
+        }
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WatermarkDefinition/WatermarkCollectionUtil.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WatermarkDefinition/WatermarkCollectionUtil.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WatermarkDefinition/WatermarkCollectionUtil.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,51 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OSGeo.MapGuide.ObjectModels.WatermarkDefinition
+{
+    internal class WatermarkCollectionUtil
+    {
+        public static IWatermark AddWatermark<T>(IList<T> collection, IWatermarkDefinition watermark) where T : class, IWatermark, new()
+        {
+            Check.NotNull(watermark, "watermark");
+            T impl = new T();
+            impl.ResourceId = watermark.ResourceID;
+            impl.Name = ResourceIdentifier.GetName(impl.ResourceId);
+            impl.Usage = UsageType.All;
+            collection.Add(impl);
+            return impl;
+        }
+
+        public static void RemoveWatermark<T>(IList<T> collection, IWatermark watermark) where T : class, IWatermark
+        {
+            Check.NotNull(watermark, "watermark");
+            T impl = watermark as T;
+            if (impl != null)
+                collection.Remove(impl);
+        }
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WatermarkDefinition/v2_3_0/WatermarkDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WatermarkDefinition/v2_3_0/WatermarkDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WatermarkDefinition/v2_3_0/WatermarkDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,417 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define WDF_230
+
+using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+
+#if WDF_240
+
+namespace OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_4_0
+{
+    using Sdf240 = SymbolDefinition.v2_4_0;
+
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_3_0
+{
+    using Sdf110 = SymbolDefinition.v1_1_0;
+
+#endif
+
+    public static class WdfEntryPoint
+    {
+        public static WatermarkDefinition CreateDefault(SymbolDefinitionType type)
+        {
+            var wdf = new WatermarkDefinition()
+            {
+                Appearance = new WatermarkAppearanceType(),
+                Content = new WatermarkDefinitionTypeContent()
+                {
+#if WDF_240
+                    Item = (type == SymbolDefinitionType.Simple) ? (Sdf240.SymbolDefinitionBase)Sdf240.SymbolDefEntryPoint.CreateDefaultSimple() : (Sdf240.SymbolDefinitionBase)Sdf240.SymbolDefEntryPoint.CreateDefaultCompound()
+#else
+                    Item = (type == SymbolDefinitionType.Simple) ? (Sdf110.SymbolDefinitionBase)Sdf110.SymbolDefEntryPoint.CreateDefaultSimple() : (Sdf110.SymbolDefinitionBase)Sdf110.SymbolDefEntryPoint.CreateDefaultCompound()
+#endif
+                },
+                Position = new WatermarkDefinitionTypePosition()
+                {
+                    Item = new XYPositionType()
+                }
+            };
+            if (wdf.Content.Item.Type == SymbolDefinitionType.Simple)
+            {
+                var sym = (ISimpleSymbolDefinition)wdf.Content.Item;
+                sym.PointUsage = sym.CreatePointUsage();
+            }
+            wdf.Content.Item.Name = wdf.Content.Item.Description = "";
+            wdf.Content.Item.RemoveSchemaAttributes();
+            return wdf;
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            IWatermarkDefinition wdf = WatermarkDefinition.Deserialize(xml);
+            if (wdf.Content != null)
+                wdf.Content.RemoveSchemaAttributes();
+
+            return wdf;
+        }
+
+        public static Stream Serialize(IResource res)
+        {
+            return res.SerializeToStream();
+        }
+    }
+
+    partial class WatermarkDefinition : IWatermarkDefinition
+    {
+#if WDF_240
+        private static readonly Version RES_VERSION = new Version(2, 4, 0);
+#else
+        private static readonly Version RES_VERSION = new Version(2, 3, 0);
+#endif
+
+        [XmlIgnore]
+        public string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.WatermarkDefinition.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")]
+        public string ValidatingSchema
+        {
+#if WDF_240
+            get { return "WatermarkDefinition-2.4.0.xsd"; }
+#else
+            get { return "WatermarkDefinition-2.3.0.xsd"; }
+#endif
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        [XmlIgnore]
+        ISymbolDefinitionBase IWatermarkDefinition.Content
+        {
+            get
+            {
+                if (this.Content != null)
+                    return this.Content.Item;
+
+                return null;
+            }
+            set
+            {
+                throw new NotImplementedException();
+            }
+        }
+
+        [XmlIgnore]
+        IWatermarkAppearance IWatermarkDefinition.Appearance
+        {
+            get
+            {
+                return this.Appearance;
+            }
+            set
+            {
+                this.Appearance = (WatermarkAppearanceType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IPosition IWatermarkDefinition.Position
+        {
+            get
+            {
+                if (this.Position != null)
+                    return this.Position.Item;
+                return null;
+            }
+            set
+            {
+                if (value != null)
+                {
+                    if (this.Position == null)
+                        this.Position = new WatermarkDefinitionTypePosition();
+
+                    this.Position.Item = (PositionType)value;
+                }
+            }
+        }
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException("Not a valid resource identifier"); //LOCALIZE
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.WatermarkDefinition.ToString())
+                    throw new InvalidOperationException("Invalid resource identifier for this type of object: " + res.Extension); //LOCALIZE
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID");
+            }
+        }
+
+        object ICloneable.Clone()
+        {
+            return this.Clone();
+        }
+
+        public IXYPosition CreateXYPosition()
+        {
+            return new XYPositionType()
+            {
+                XPosition = new HorizontalPositionType(),
+                YPosition = new VerticalPositionType()
+            };
+        }
+
+        public ITilePosition CreateTilePosition()
+        {
+            return new TilePositionType()
+            {
+                HorizontalPosition = new HorizontalPositionType(),
+                VerticalPosition = new VerticalPositionType()
+            };
+        }
+
+        public Version SupportedMapDefinitionVersion
+        {
+            get
+            {
+#if WDF_240
+                return new Version(2, 4, 0);
+#else
+                return new Version(2, 3, 0);
+#endif
+            }
+        }
+
+        public Version SupportedLayerDefinitionVersion
+        {
+            get
+            {
+#if WDF_240
+                return new Version(2, 4, 0);
+#else
+                return new Version(2, 3, 0);
+#endif
+            }
+        }
+    }
+
+    partial class WatermarkType : IWatermark
+    {
+        [XmlIgnore]
+        IWatermarkAppearance IWatermark.AppearanceOverride
+        {
+            get
+            {
+                return this.AppearanceOverride;
+            }
+            set
+            {
+                this.AppearanceOverride = (WatermarkAppearanceType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IPosition IWatermark.PositionOverride
+        {
+            get
+            {
+                return this.PositionOverride == null ? null : this.PositionOverride.Item;
+            }
+            set
+            {
+                if (value == null)
+                {
+                    this.PositionOverride = null;
+                }
+                else
+                {
+                    if (this.PositionOverride == null)
+                        this.PositionOverride = new WatermarkTypePositionOverride();
+
+                    this.PositionOverride.Item = (PositionType)value;
+                }
+            }
+        }
+
+        public IWatermarkAppearance CreateDefaultAppearance()
+        {
+            return new WatermarkAppearanceType()
+            {
+                Rotation = 0,
+                Transparency = 0
+            };
+        }
+
+        public IXYPosition CreateDefaultXYPosition()
+        {
+            return new XYPositionType()
+            {
+                XPosition = new HorizontalPositionType()
+                {
+                    Alignment = HorizontalAlignmentType.Center,
+                    Offset = 0.0,
+                    Unit = UnitType.Pixels
+                },
+                YPosition = new VerticalPositionType()
+                {
+                    Alignment = VerticalAlignmentType.Center,
+                    Offset = 0.0,
+                    Unit = UnitType.Pixels
+                }
+            };
+        }
+
+        public ITilePosition CreateDefaultTilePosition()
+        {
+            return new TilePositionType()
+            {
+                VerticalPosition = new VerticalPositionType(),
+                HorizontalPosition = new HorizontalPositionType(),
+                TileHeight = 200,
+                TileWidth = 200
+            };
+        }
+    }
+
+    partial class WatermarkAppearanceType : IWatermarkAppearance { }
+
+    partial class WatermarkTypePositionOverride { }
+
+    partial class XYPositionType : IXYPosition
+    {
+        [XmlIgnore]
+        public override OSGeo.MapGuide.ObjectModels.WatermarkDefinition.PositionType Type
+        {
+            get { return OSGeo.MapGuide.ObjectModels.WatermarkDefinition.PositionType.XY; }
+        }
+
+        [XmlIgnore]
+        IHorizontalPosition IXYPosition.XPosition
+        {
+            get
+            {
+                return this.XPosition;
+            }
+            set
+            {
+                this.XPosition = (HorizontalPositionType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IVerticalPosition IXYPosition.YPosition
+        {
+            get
+            {
+                return this.YPosition;
+            }
+            set
+            {
+                this.YPosition = (VerticalPositionType)value;
+            }
+        }
+    }
+
+    abstract partial class PositionType : IPosition
+    {
+        [XmlIgnore]
+        public abstract OSGeo.MapGuide.ObjectModels.WatermarkDefinition.PositionType Type { get; }
+    }
+
+    partial class TilePositionType : ITilePosition
+    {
+        [XmlIgnore]
+        public override OSGeo.MapGuide.ObjectModels.WatermarkDefinition.PositionType Type
+        {
+            get { return OSGeo.MapGuide.ObjectModels.WatermarkDefinition.PositionType.Tile; ; }
+        }
+
+        [XmlIgnore]
+        IHorizontalPosition ITilePosition.HorizontalPosition
+        {
+            get
+            {
+                return this.HorizontalPosition;
+            }
+            set
+            {
+                this.HorizontalPosition = (HorizontalPositionType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IVerticalPosition ITilePosition.VerticalPosition
+        {
+            get
+            {
+                return this.VerticalPosition;
+            }
+            set
+            {
+                this.VerticalPosition = (VerticalPositionType)value;
+            }
+        }
+    }
+
+    partial class VerticalPositionType : IVerticalPosition { }
+
+    partial class HorizontalPositionType : IHorizontalPosition { }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WatermarkDefinition/v2_4_0/WatermarkDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WatermarkDefinition/v2_4_0/WatermarkDefinitionImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WatermarkDefinition/v2_4_0/WatermarkDefinitionImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,417 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define WDF_240
+
+using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+
+#if WDF_240
+
+namespace OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_4_0
+{
+    using Sdf240 = SymbolDefinition.v2_4_0;
+
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_3_0
+{
+    using Sdf110 = SymbolDefinition.v1_1_0;
+
+#endif
+
+    public static class WdfEntryPoint
+    {
+        public static WatermarkDefinition CreateDefault(SymbolDefinitionType type)
+        {
+            var wdf = new WatermarkDefinition()
+            {
+                Appearance = new WatermarkAppearanceType(),
+                Content = new WatermarkDefinitionTypeContent()
+                {
+#if WDF_240
+                    Item = (type == SymbolDefinitionType.Simple) ? (Sdf240.SymbolDefinitionBase)Sdf240.SymbolDefEntryPoint.CreateDefaultSimple() : (Sdf240.SymbolDefinitionBase)Sdf240.SymbolDefEntryPoint.CreateDefaultCompound()
+#else
+                    Item = (type == SymbolDefinitionType.Simple) ? (Sdf110.SymbolDefinitionBase)Sdf110.SymbolDefEntryPoint.CreateDefaultSimple() : (Sdf110.SymbolDefinitionBase)Sdf110.SymbolDefEntryPoint.CreateDefaultCompound()
+#endif
+                },
+                Position = new WatermarkDefinitionTypePosition()
+                {
+                    Item = new XYPositionType()
+                }
+            };
+            if (wdf.Content.Item.Type == SymbolDefinitionType.Simple)
+            {
+                var sym = (ISimpleSymbolDefinition)wdf.Content.Item;
+                sym.PointUsage = sym.CreatePointUsage();
+            }
+            wdf.Content.Item.Name = wdf.Content.Item.Description = "";
+            wdf.Content.Item.RemoveSchemaAttributes();
+            return wdf;
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            IWatermarkDefinition wdf = WatermarkDefinition.Deserialize(xml);
+            if (wdf.Content != null)
+                wdf.Content.RemoveSchemaAttributes();
+
+            return wdf;
+        }
+
+        public static Stream Serialize(IResource res)
+        {
+            return res.SerializeToStream();
+        }
+    }
+
+    partial class WatermarkDefinition : IWatermarkDefinition
+    {
+#if WDF_240
+        private static readonly Version RES_VERSION = new Version(2, 4, 0);
+#else
+        private static readonly Version RES_VERSION = new Version(2, 3, 0);
+#endif
+
+        [XmlIgnore]
+        public string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.WatermarkDefinition.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")]
+        public string ValidatingSchema
+        {
+#if WDF_240
+            get { return "WatermarkDefinition-2.4.0.xsd"; }
+#else
+            get { return "WatermarkDefinition-2.3.0.xsd"; }
+#endif
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        [XmlIgnore]
+        ISymbolDefinitionBase IWatermarkDefinition.Content
+        {
+            get
+            {
+                if (this.Content != null)
+                    return this.Content.Item;
+
+                return null;
+            }
+            set
+            {
+                throw new NotImplementedException();
+            }
+        }
+
+        [XmlIgnore]
+        IWatermarkAppearance IWatermarkDefinition.Appearance
+        {
+            get
+            {
+                return this.Appearance;
+            }
+            set
+            {
+                this.Appearance = (WatermarkAppearanceType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IPosition IWatermarkDefinition.Position
+        {
+            get
+            {
+                if (this.Position != null)
+                    return this.Position.Item;
+                return null;
+            }
+            set
+            {
+                if (value != null)
+                {
+                    if (this.Position == null)
+                        this.Position = new WatermarkDefinitionTypePosition();
+
+                    this.Position.Item = (PositionType)value;
+                }
+            }
+        }
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException("Not a valid resource identifier"); //LOCALIZE
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.WatermarkDefinition.ToString())
+                    throw new InvalidOperationException("Invalid resource identifier for this type of object: " + res.Extension); //LOCALIZE
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID");
+            }
+        }
+
+        object ICloneable.Clone()
+        {
+            return this.Clone();
+        }
+
+        public IXYPosition CreateXYPosition()
+        {
+            return new XYPositionType()
+            {
+                XPosition = new HorizontalPositionType(),
+                YPosition = new VerticalPositionType()
+            };
+        }
+
+        public ITilePosition CreateTilePosition()
+        {
+            return new TilePositionType()
+            {
+                HorizontalPosition = new HorizontalPositionType(),
+                VerticalPosition = new VerticalPositionType()
+            };
+        }
+
+        public Version SupportedMapDefinitionVersion
+        {
+            get
+            {
+#if WDF_240
+                return new Version(2, 4, 0);
+#else
+                return new Version(2, 3, 0);
+#endif
+            }
+        }
+
+        public Version SupportedLayerDefinitionVersion
+        {
+            get
+            {
+#if WDF_240
+                return new Version(2, 4, 0);
+#else
+                return new Version(2, 3, 0);
+#endif
+            }
+        }
+    }
+
+    partial class WatermarkType : IWatermark
+    {
+        [XmlIgnore]
+        IWatermarkAppearance IWatermark.AppearanceOverride
+        {
+            get
+            {
+                return this.AppearanceOverride;
+            }
+            set
+            {
+                this.AppearanceOverride = (WatermarkAppearanceType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IPosition IWatermark.PositionOverride
+        {
+            get
+            {
+                return this.PositionOverride == null ? null : this.PositionOverride.Item;
+            }
+            set
+            {
+                if (value == null)
+                {
+                    this.PositionOverride = null;
+                }
+                else
+                {
+                    if (this.PositionOverride == null)
+                        this.PositionOverride = new WatermarkTypePositionOverride();
+
+                    this.PositionOverride.Item = (PositionType)value;
+                }
+            }
+        }
+
+        public IWatermarkAppearance CreateDefaultAppearance()
+        {
+            return new WatermarkAppearanceType()
+            {
+                Rotation = 0,
+                Transparency = 0
+            };
+        }
+
+        public IXYPosition CreateDefaultXYPosition()
+        {
+            return new XYPositionType()
+            {
+                XPosition = new HorizontalPositionType()
+                {
+                    Alignment = HorizontalAlignmentType.Center,
+                    Offset = 0.0,
+                    Unit = UnitType.Pixels
+                },
+                YPosition = new VerticalPositionType()
+                {
+                    Alignment = VerticalAlignmentType.Center,
+                    Offset = 0.0,
+                    Unit = UnitType.Pixels
+                }
+            };
+        }
+
+        public ITilePosition CreateDefaultTilePosition()
+        {
+            return new TilePositionType()
+            {
+                VerticalPosition = new VerticalPositionType(),
+                HorizontalPosition = new HorizontalPositionType(),
+                TileHeight = 200,
+                TileWidth = 200
+            };
+        }
+    }
+
+    partial class WatermarkAppearanceType : IWatermarkAppearance { }
+
+    partial class WatermarkTypePositionOverride { }
+
+    partial class XYPositionType : IXYPosition
+    {
+        [XmlIgnore]
+        public override OSGeo.MapGuide.ObjectModels.WatermarkDefinition.PositionType Type
+        {
+            get { return OSGeo.MapGuide.ObjectModels.WatermarkDefinition.PositionType.XY; }
+        }
+
+        [XmlIgnore]
+        IHorizontalPosition IXYPosition.XPosition
+        {
+            get
+            {
+                return this.XPosition;
+            }
+            set
+            {
+                this.XPosition = (HorizontalPositionType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IVerticalPosition IXYPosition.YPosition
+        {
+            get
+            {
+                return this.YPosition;
+            }
+            set
+            {
+                this.YPosition = (VerticalPositionType)value;
+            }
+        }
+    }
+
+    abstract partial class PositionType : IPosition
+    {
+        [XmlIgnore]
+        public abstract OSGeo.MapGuide.ObjectModels.WatermarkDefinition.PositionType Type { get; }
+    }
+
+    partial class TilePositionType : ITilePosition
+    {
+        [XmlIgnore]
+        public override OSGeo.MapGuide.ObjectModels.WatermarkDefinition.PositionType Type
+        {
+            get { return OSGeo.MapGuide.ObjectModels.WatermarkDefinition.PositionType.Tile; ; }
+        }
+
+        [XmlIgnore]
+        IHorizontalPosition ITilePosition.HorizontalPosition
+        {
+            get
+            {
+                return this.HorizontalPosition;
+            }
+            set
+            {
+                this.HorizontalPosition = (HorizontalPositionType)value;
+            }
+        }
+
+        [XmlIgnore]
+        IVerticalPosition ITilePosition.VerticalPosition
+        {
+            get
+            {
+                return this.VerticalPosition;
+            }
+            set
+            {
+                this.VerticalPosition = (VerticalPositionType)value;
+            }
+        }
+    }
+
+    partial class VerticalPositionType : IVerticalPosition { }
+
+    partial class HorizontalPositionType : IHorizontalPosition { }
+}
\ No newline at end of file

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v1_0_0/WebLayoutImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v1_0_0/WebLayoutImpl.cs	2014-12-25 13:55:42 UTC (rev 8462)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v1_0_0/WebLayoutImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -20,6 +20,7 @@
 
 #endregion Disclaimer / License
 
+#define WL100
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v1_1_0/WebLayoutImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v1_1_0/WebLayoutImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v1_1_0/WebLayoutImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,1709 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define WL110
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if WL260
+namespace OSGeo.MapGuide.ObjectModels.WebLayout.v2_6_0
+#elif WL240
+namespace OSGeo.MapGuide.ObjectModels.WebLayout.v2_4_0
+#elif WL110
+
+namespace OSGeo.MapGuide.ObjectModels.WebLayout.v1_1_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.WebLayout.v1_0_0
+#endif
+{
+    public static class WebLayoutEntryPoint
+    {
+        public static IWebLayout CreateDefault(string mapDefinitionId)
+        {
+            IWebLayout wl = WebLayoutType.CreateDefault(mapDefinitionId);
+#if WL240 || WL260
+            //NOTE: This separator is needed because the AJAX viewer currently assumes the maptip
+            //command to be at a certain position (!!!). The seperator ensures the command is at
+            //the right position
+            wl.ToolBar.AddItem(wl.CreateSeparator());
+            wl.CommandSet.AddCommand(wl.CreateBasicCommand("Maptip", Strings.WL_Desc_MapTip, Strings.WL_Desc_MapTip, "icon_maptip", TargetViewerType.All, BasicCommandActionType.MapTip)); //NOXLATE
+            wl.ToolBar.AddItem(wl.CreateCommandItem(BasicCommandActionType.MapTip.ToString()));
+            IWebLayout2 wl2 = (IWebLayout2)wl;
+            wl2.EnablePingServer = true;
+#endif
+
+#if WL260
+            IWebLayout3 wl3 = (IWebLayout3)wl;
+            wl3.SelectionColor = "0000FFFF";
+            wl3.PointSelectionBuffer = 2;
+            wl3.MapImageFormat = "PNG";
+            wl3.SelectionImageFormat = "PNG";
+#endif
+            return wl;
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            return WebLayoutType.Deserialize(xml);
+        }
+
+        public static Stream Serialize(IResource res)
+        {
+            return res.SerializeToStream();
+        }
+    }
+
+    [Serializable]
+    public class WebLayoutCustomCommandList
+    {
+        [XmlArrayItem("CustomCommands")] //NOXLATE
+        public CommandType[] Commands { get; set; }
+    }
+
+    partial class WebLayoutType : IWebLayout, ICommandSet
+    {
+        internal WebLayoutType()
+        {
+        }
+
+#if WL260
+        private static readonly Version RES_VERSION = new Version(2, 6, 0);
+#elif WL240
+        private static readonly Version RES_VERSION = new Version(2, 4, 0);
+#elif WL110
+        private static readonly Version RES_VERSION = new Version(1, 1, 0);
+#else
+        private static readonly Version RES_VERSION = new Version(1, 0, 0);
+#endif
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.WebLayout.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.WebLayout));
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.WebLayout.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        object ICloneable.Clone()
+        {
+            return this.Clone();
+        }
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")] //NOXLATE
+        public string ValidatingSchema
+        {
+#if WL260
+            get { return "WebLayout-2.6.0.xsd"; } //NOXLATE
+#elif WL240
+            get { return "WebLayout-2.4.0.xsd"; } //NOXLATE
+#elif WL110
+            get { return "WebLayout-1.1.0.xsd"; } //NOXLATE
+#else
+            get { return "WebLayout-1.0.0.xsd"; } //NOXLATE
+#endif
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        public static IWebLayout CreateDefault(string mapDefinitionId)
+        {
+            //TODO: Localize these strings. Once localized we can have *translatable*
+            //web layouts!
+
+            IWebLayout wl = new WebLayoutType()
+            {
+                CommandSet = new System.ComponentModel.BindingList<CommandType>(),
+                ContextMenu = new ContextMenuType()
+                {
+                    Visible = true,
+                    MenuItem = new System.ComponentModel.BindingList<UIItemType>()
+                },
+                InformationPane = new InformationPaneType()
+                {
+                    LegendVisible = true,
+                    PropertiesVisible = true,
+                    Visible = true,
+                    Width = 200
+                },
+                Map = new MapType()
+                {
+                    HyperlinkTarget = TargetType.TaskPane,
+                    ResourceId = mapDefinitionId,
+                    //null InitialView = Use map's initial view
+                },
+                StatusBar = new StatusBarType()
+                {
+                    Visible = true
+                },
+                TaskPane = new TaskPaneType()
+                {
+                    TaskBar = new TaskBarType()
+                    {
+                        Back = new TaskButtonType()
+                        {
+                            Name = "Back",
+                            Tooltip = Strings.WL_Desc_TaskBack,
+                            Description = Strings.WL_Desc_TaskBack,
+                            ImageURL = "../stdicons/icon_back.gif",
+                            DisabledImageURL = "../stdicons/icon_back_disabled.gif"
+                        },
+                        Forward = new TaskButtonType()
+                        {
+                            Name = "Forward",
+                            Tooltip = Strings.WL_Desc_TaskForward,
+                            Description = Strings.WL_Desc_TaskForward,
+                            ImageURL = "../stdicons/icon_forward.gif",
+                            DisabledImageURL = "../stdicons/icon_forward_disabled.gif"
+                        },
+                        Home = new TaskButtonType()
+                        {
+                            Name = "Home",
+                            Tooltip = Strings.WL_Desc_TaskHome,
+                            Description = Strings.WL_Desc_TaskHome,
+                            ImageURL = "../stdicons/icon_home.gif",
+                            DisabledImageURL = "../stdicons/icon_home_disabled.gif"
+                        },
+                        //Task Pane menu buttons
+                        MenuButton = new System.ComponentModel.BindingList<UIItemType>(),
+                        Tasks = new TaskButtonType()
+                        {
+                            Name = "Tasks",
+                            Tooltip = Strings.WL_Label_TaskList,
+                            Description = Strings.WL_Desc_TaskList,
+                            ImageURL = "../stdicons/icon_tasks.gif",
+                            DisabledImageURL = "../stdicons/icon_tasks_disabled.gif"
+                        },
+                        Visible = true,
+                    },
+                    Visible = true,
+                    Width = 250,
+                },
+                Title = string.Empty,
+                ToolBar = new ToolBarType()
+                {
+                    Visible = true,
+                    Button = new System.ComponentModel.BindingList<UIItemType>()
+                },
+                ZoomControl = new ZoomControlType()
+                {
+                    Visible = true
+                },
+            };
+
+            CreateDefaultCommandSet(wl);
+            CreateDefaultContextMenu(wl);
+            CreateDefaultToolbar(wl);
+
+            return wl;
+        }
+
+        private static void CreateDefaultToolbar(IWebLayout wl)
+        {
+            wl.ToolBar.AddItems(
+            wl.CreateCommandItem(BuiltInCommandType.Print.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.GetPrintablePage.ToString()),
+            wl.CreateSeparator(),
+            wl.CreateCommandItem(BuiltInCommandType.Measure.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.Buffer.ToString()),
+            wl.CreateSeparator(),
+            wl.CreateFlyout(Strings.WL_Label_Zoom, null, null, null, null,
+                wl.CreateCommandItem(BuiltInCommandType.PreviousView.ToString()),
+                wl.CreateCommandItem(BuiltInCommandType.NextView.ToString()),
+                wl.CreateCommandItem(BuiltInCommandType.RestoreView.ToString())
+            ),
+            wl.CreateSeparator(),
+            wl.CreateCommandItem(BuiltInCommandType.ZoomRectangle.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.ZoomIn.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.ZoomOut.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.Zoom.ToString()),
+            wl.CreateSeparator(),
+            wl.CreateCommandItem(BuiltInCommandType.Select.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.Pan.ToString())
+            );
+        }
+
+        private static void CreateDefaultContextMenu(IWebLayout wl)
+        {
+            wl.ContextMenu.AddItems(
+                            wl.CreateCommandItem(BuiltInCommandType.Select.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.ClearSelection.ToString()),
+                                wl.CreateFlyout(Strings.WL_Label_SelectMore, null, null, null, null,
+                                    wl.CreateCommandItem(BuiltInCommandType.SelectRadius.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.SelectPolygon.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.SelectWithin.ToString())
+                                ),
+                                wl.CreateCommandItem(BuiltInCommandType.Pan.ToString()),
+                                wl.CreateSeparator(),
+                                wl.CreateCommandItem(BuiltInCommandType.ZoomRectangle.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.ZoomIn.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.ZoomOut.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.Zoom.ToString()),
+                                wl.CreateFlyout(Strings.WL_Label_Zoom, null, null, null, null,
+                                    wl.CreateCommandItem(BuiltInCommandType.PreviousView.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.NextView.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.FitToWindow.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.RestoreView.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.ZoomToSelection.ToString())
+                                ),
+                                wl.CreateSeparator(),
+                                wl.CreateCommandItem(BuiltInCommandType.Measure.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.Buffer.ToString()),
+                                wl.CreateSeparator(),
+                                wl.CreateCommandItem(BuiltInCommandType.Refresh.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.CopyMap.ToString()),
+                                wl.CreateSeparator(),
+                                wl.CreateCommandItem(BuiltInCommandType.Print.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.GetPrintablePage.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.ViewOptions.ToString()),
+                                wl.CreateSeparator(),
+                                wl.CreateCommandItem(BuiltInCommandType.Help.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.About.ToString())
+                                );
+        }
+
+        private static void CreateDefaultCommandSet(IWebLayout wl)
+        {
+            wl.CommandSet.AddCommand(
+                            wl.CreateBasicCommand(Strings.WL_Label_Pan,
+                                               Strings.WL_Label_Pan,
+                                               Strings.WL_Desc_Pan,
+                                               "icon_pan",
+                                               TargetViewerType.All,
+                                               BasicCommandActionType.Pan));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_PanUp,
+                               Strings.WL_Label_PanUp,
+                               Strings.WL_Desc_PanUp,
+                               "icon_panup",
+                               TargetViewerType.All,
+                               BasicCommandActionType.PanUp));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_PanDown,
+                               Strings.WL_Label_PanDown,
+                               Strings.WL_Desc_PanDown,
+                               "icon_pandown",
+                               TargetViewerType.All,
+                               BasicCommandActionType.PanDown));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_PanRight,
+                               Strings.WL_Label_PanRight,
+                               Strings.WL_Desc_PanRight,
+                               "icon_panright",
+                               TargetViewerType.All,
+                               BasicCommandActionType.PanRight));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_PanLeft,
+                               Strings.WL_Label_PanLeft,
+                               Strings.WL_Desc_PanLeft,
+                               "icon_panleft",
+                               TargetViewerType.All,
+                               BasicCommandActionType.PanLeft));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_Zoom,
+                               Strings.WL_Label_ZoomDynamic,
+                               Strings.WL_Desc_ZoomDynamic,
+                               "icon_zoom",
+                               TargetViewerType.Dwf,
+                               BasicCommandActionType.Zoom));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_ZoomIn,
+                               Strings.WL_Label_ZoomIn,
+                               Strings.WL_Desc_ZoomIn,
+                               "icon_zoomin",
+                               TargetViewerType.All,
+                               BasicCommandActionType.ZoomIn));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_ZoomOut,
+                               Strings.WL_Label_ZoomOut,
+                               Strings.WL_Desc_ZoomOut,
+                               "icon_zoomout",
+                               TargetViewerType.All,
+                               BasicCommandActionType.ZoomOut));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_ZoomRect,
+                               Strings.WL_Label_ZoomRect,
+                               Strings.WL_Desc_ZoomRect,
+                               "icon_zoomrect",
+                               TargetViewerType.All,
+                               BasicCommandActionType.ZoomRectangle));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_ZoomSelection,
+                               Strings.WL_Label_ZoomSelection,
+                               Strings.WL_Desc_ZoomSelection,
+                               "icon_zoomselect",
+                               TargetViewerType.All,
+                               BasicCommandActionType.ZoomToSelection));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_InitialMapView,
+                               Strings.WL_Label_InitialMapView,
+                               Strings.WL_Desc_InitialMapView,
+                               "icon_fitwindow",
+                               TargetViewerType.All,
+                               BasicCommandActionType.FitToWindow));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_PrevView,
+                               Strings.WL_Label_PrevView,
+                               Strings.WL_Desc_PrevView,
+                               "icon_zoomprev",
+                               TargetViewerType.All,
+                               BasicCommandActionType.PreviousView));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_NextView,
+                               Strings.WL_Label_NextView,
+                               Strings.WL_Desc_NextView,
+                               "icon_zoomnext",
+                               TargetViewerType.All,
+                               BasicCommandActionType.NextView));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_InitialCenterScale,
+                               Strings.WL_Label_InitialCenterScale,
+                               Strings.WL_Desc_InitialCenterScale,
+                               "icon_restorecenter",
+                               TargetViewerType.All,
+                               BasicCommandActionType.RestoreView));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_Select,
+                               Strings.WL_Label_Select,
+                               Strings.WL_Desc_Select,
+                               "icon_select",
+                               TargetViewerType.All,
+                               BasicCommandActionType.Select));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_SelectRadius,
+                               Strings.WL_Label_SelectRadius,
+                               Strings.WL_Desc_SelectRadius,
+                               "icon_selectradius",
+                               TargetViewerType.All,
+                               BasicCommandActionType.SelectRadius));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_SelectPolygon,
+                               Strings.WL_Label_SelectPolygon,
+                               Strings.WL_Desc_SelectPolygon,
+                               "icon_selectpolygon",
+                               TargetViewerType.All,
+                               BasicCommandActionType.SelectPolygon));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Desc_ClearSelection,
+                               Strings.WL_Label_ClearSelection,
+                               Strings.WL_Desc_ClearSelection,
+                               "icon_clearselect",
+                               TargetViewerType.All,
+                               BasicCommandActionType.ClearSelection));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_RefreshMap,
+                               Strings.WL_Label_RefreshMap,
+                               Strings.WL_Desc_RefreshMap,
+                               "icon_refreshmap",
+                               TargetViewerType.All,
+                               BasicCommandActionType.Refresh));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_Copy,
+                               Strings.WL_Label_Copy,
+                               Strings.WL_Desc_Copy,
+                               "icon_copy",
+                               TargetViewerType.Dwf,
+                               BasicCommandActionType.CopyMap));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_About,
+                               Strings.WL_Label_About,
+                               Strings.WL_Desc_About,
+                               null,
+                               TargetViewerType.All,
+                               BasicCommandActionType.About));
+            wl.CommandSet.AddCommand(
+            wl.CreateTargetedCommand<BufferCommandType>(BuiltInCommandType.Buffer.ToString(),
+                                                     Strings.WL_Label_Buffer,
+                                                     Strings.WL_Label_Buffer,
+                                                     Strings.WL_Desc_Buffer,
+                                                     "icon_buffer",
+                                                     TargetViewerType.All,
+                                                     TargetType.TaskPane,
+                                                     null));
+            wl.CommandSet.AddCommand(
+            wl.CreateTargetedCommand<SelectWithinCommandType>(BuiltInCommandType.SelectWithin.ToString(),
+                                                     Strings.WL_Label_SelectWithin,
+                                                     Strings.WL_Label_SelectWithin,
+                                                     Strings.WL_Desc_SelectWithin,
+                                                     "icon_selectwithin",
+                                                     TargetViewerType.All,
+                                                     TargetType.TaskPane,
+                                                     null));
+            wl.CommandSet.AddCommand(
+            wl.CreateTargetedCommand<MeasureCommandType>(BuiltInCommandType.Measure.ToString(),
+                                                      Strings.WL_Label_Measure,
+                                                      Strings.WL_Label_Measure,
+                                                      Strings.WL_Desc_Measure,
+                                                      "icon_measure",
+                                                      TargetViewerType.All,
+                                                      TargetType.TaskPane,
+                                                      null));
+            wl.CommandSet.AddCommand(
+            new PrintCommandType()
+            {
+                Name = "Print",
+                Label = Strings.WL_Label_Print,
+                Tooltip = Strings.WL_Label_Print,
+                Description = Strings.WL_Desc_Print,
+                ImageURL = "../stdicons/icon_print.gif",
+                DisabledImageURL = "../stdicons/icon_print_disabled.gif",
+                TargetViewer = TargetViewerType.Dwf
+            });
+            wl.CommandSet.AddCommand(
+            wl.CreateTargetedCommand<ViewOptionsCommandType>(BuiltInCommandType.ViewOptions.ToString(),
+                                                          Strings.WL_Label_ViewOptions,
+                                                          Strings.WL_Label_ViewOptions,
+                                                          Strings.WL_Desc_ViewOptions,
+                                                          "icon_viewoptions",
+                                                          TargetViewerType.All,
+                                                          TargetType.TaskPane,
+                                                          null));
+            wl.CommandSet.AddCommand(
+            wl.CreateTargetedCommand<GetPrintablePageCommandType>(BuiltInCommandType.GetPrintablePage.ToString(),
+                                                          Strings.WL_Label_GetPrintablePage,
+                                                          Strings.WL_Label_GetPrintablePage,
+                                                          Strings.WL_Desc_GetPrintablePage,
+                                                          "icon_printablepage",
+                                                          TargetViewerType.Ajax,
+                                                          TargetType.NewWindow,
+                                                          null));
+            wl.CommandSet.AddCommand(
+            new HelpCommandType()
+            {
+                Name = BuiltInCommandType.Help.ToString(),
+                Label = Strings.WL_Label_Help,
+                Tooltip = Strings.WL_Label_Help,
+                Description = Strings.WL_Desc_Help,
+                ImageURL = "../stdicons/icon_help.gif",
+                DisabledImageURL = "../stdicons/icon_help_disabled.gif",
+                TargetViewer = TargetViewerType.All,
+                Target = TargetType.TaskPane
+            });
+        }
+
+        public IMapView CreateDefaultView()
+        {
+            return new MapViewType();
+        }
+
+        /// <summary>
+        /// Indicates whether a given command is referenced in the user interface
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="region"></param>
+        /// <returns></returns>
+        public bool IsCommandReferenced(string name, out WebLayoutRegion[] region)
+        {
+            region = new WebLayoutRegion[0];
+            List<WebLayoutRegion> regions = new List<WebLayoutRegion>();
+            if (FindCommand(name, this.ContextMenu))
+            {
+                regions.Add(WebLayoutRegion.ContextMenu);
+            }
+
+            if (FindCommand(name, this.ToolBar))
+            {
+                regions.Add(WebLayoutRegion.Toolbar);
+            }
+
+            if (FindCommand(name, this.TaskPane.TaskBar))
+            {
+                regions.Add(WebLayoutRegion.TaskBar);
+            }
+
+            region = regions.ToArray();
+            return region.Length > 0;
+        }
+
+        /// <summary>
+        /// Removes all references of a given command
+        /// </summary>
+        /// <param name="cmdName"></param>
+        /// <returns>The number of references removed</returns>
+        public int RemoveAllReferences(string cmdName)
+        {
+            int removed = 0;
+            removed += RemoveInternal(cmdName, contextMenuField.MenuItem);
+            removed += RemoveInternal(cmdName, toolBarField.Button);
+            removed += RemoveInternal(cmdName, taskPaneField.TaskBar.MenuButton);
+            return removed;
+        }
+
+        private int RemoveInternal(string cmdName, IList<UIItemType> items)
+        {
+            int foundCount = 0;
+            List<IList<UIItemType>> subItemCheck = new List<IList<UIItemType>>();
+            List<UIItemType> found = new List<UIItemType>();
+            foreach (var item in items)
+            {
+                if (item.Function == UIItemFunctionType.Command)
+                {
+                    if (((CommandItemType)item).Command == cmdName)
+                        found.Add(item);
+                }
+                else if (item.Function == UIItemFunctionType.Flyout)
+                {
+                    subItemCheck.Add(((FlyoutItemType)item).SubItem);
+                }
+            }
+            foundCount += found.Count;
+            //Purge any found
+            foreach (var item in found)
+            {
+                items.Remove(item);
+            }
+            //Check these sub lists
+            foreach (var list in subItemCheck)
+            {
+                foundCount += RemoveInternal(cmdName, list);
+            }
+
+            return foundCount;
+        }
+
+        public ICommand GetCommandByName(string cmdName)
+        {
+            foreach (var cmd in this.CommandSet)
+            {
+                if (cmd.Name == cmdName)
+                    return cmd;
+            }
+
+            return null;
+        }
+
+        public IEnumerable<ICommand> GetCustomCommands()
+        {
+            foreach (var cmd in this.CommandSet)
+            {
+                var type = cmd.GetType();
+                if (typeof(InvokeURLCommandType).IsAssignableFrom(type) ||
+                    typeof(InvokeScriptCommandType).IsAssignableFrom(type) ||
+                    typeof(SearchCommandType).IsAssignableFrom(type))
+                {
+                    yield return cmd;
+                }
+            }
+        }
+
+        public bool FindCommand(string name, IMenu menu)
+        {
+            foreach (var item in menu.Items)
+            {
+                if (item.Function == UIItemFunctionType.Command)
+                {
+                    if (((CommandItemType)item).Command == name)
+                        return true;
+                }
+                else if (item.Function == UIItemFunctionType.Flyout)
+                {
+                    return FindCommand(name, ((IFlyoutItem)item));
+                }
+            }
+            return false;
+        }
+
+        public IBasicCommand CreateBasicCommand(string label, string tooltip, string description, string iconName, TargetViewerType targets, BasicCommandActionType action)
+        {
+            var cmd = new BasicCommandType()
+            {
+                Name = action.ToString(),
+                Label = label,
+                Tooltip = tooltip,
+                Description = description,
+
+                TargetViewer = targets,
+                Action = action
+            };
+
+            if (!string.IsNullOrEmpty(iconName))
+            {
+                cmd.ImageURL = "../stdicons/" + iconName + ".gif"; //NOXLATE
+                cmd.DisabledImageURL = "../stdicons/" + iconName + "_disabled.gif"; //NOXLATE
+            }
+
+            return cmd;
+        }
+
+        private string GenerateUniqueName(string prefix)
+        {
+            int counter = 0;
+            string name = prefix + counter;
+
+            Dictionary<string, string> ids = new Dictionary<string, string>();
+            foreach (var cmd in this.CommandSet)
+            {
+                ids.Add(cmd.Name, cmd.Name);
+            }
+
+            while (ids.ContainsKey(name))
+            {
+                counter++;
+                name = prefix + counter;
+            }
+
+            return name;
+        }
+
+        public IInvokeUrlCommand CreateInvokeUrlCommand()
+        {
+            return new InvokeURLCommandType()
+            {
+                Name = GenerateUniqueName("InvokeUrlCommand"), //NOXLATE
+                Target = TargetType.TaskPane,
+                DisableIfSelectionEmpty = false,
+                ImageURL = "../stdicons/icon_invokeurl.gif", //NOXLATE
+                DisabledImageURL = "../stdicons/icon_invokeurl_disabled.gif", //NOXLATE
+                TargetViewer = TargetViewerType.All,
+                AdditionalParameter = new BindingList<ParameterPairType>(),
+                URL = "",
+                LayerSet = new BindingList<string>()
+            };
+        }
+
+        public ISearchCommand CreateSearchCommand()
+        {
+            return new SearchCommandType()
+            {
+                Name = GenerateUniqueName("SearchCommand"), //NOXLATE
+                ResultColumns = new System.ComponentModel.BindingList<ResultColumnType>(),
+                Target = TargetType.TaskPane,
+                TargetViewer = TargetViewerType.All, //NOXLATE
+                DisabledImageURL = "../stdicons/icon_search_disabled.gif", //NOXLATE
+                ImageURL = "../stdicons/icon_search.gif", //NOXLATE
+                Layer = string.Empty,
+                Filter = string.Empty,
+                MatchLimit = "100",
+                Prompt = string.Empty
+            };
+        }
+
+        public IInvokeScriptCommand CreateInvokeScriptCommand()
+        {
+            return new InvokeScriptCommandType()
+            {
+                Name = GenerateUniqueName("InvokeScriptCommand"), //NOXLATE
+                DisabledImageURL = "../stdicons/icon_invokescript_disabled.gif", //NOXLATE
+                ImageURL = "../stdicons/icon_invokescript.gif", //NOXLATE
+                TargetViewer = TargetViewerType.All,
+                Script = "//Enter your script code here. You can use AJAX viewer API calls here. This code is called from the viewer's main frame" //NOXLATE
+            };
+        }
+
+        public T CreateTargetedCommand<T>(string name, string label, string tooltip, string description, string iconName, TargetViewerType targets, TargetType target, string targetFrame) where T : ITargetedCommand, new()
+        {
+            var cmd = new T()
+            {
+                Name = name,
+                Label = label,
+                Tooltip = tooltip,
+                Description = description,
+                TargetViewer = targets,
+                Target = target,
+            };
+
+            if (!string.IsNullOrEmpty(targetFrame) && target == TargetType.SpecifiedFrame)
+            {
+                cmd.TargetFrame = targetFrame;
+            }
+
+            if (!string.IsNullOrEmpty(iconName))
+            {
+                cmd.ImageURL = "../stdicons/" + iconName + ".gif";
+                cmd.DisabledImageURL = "../stdicons/" + iconName + "_disabled.gif";
+            }
+
+            return cmd;
+        }
+
+        public IFlyoutItem CreateFlyout(
+            string label,
+            string tooltip,
+            string description,
+            string imageUrl,
+            string disabledImageUrl,
+            params IUIItem[] subItems)
+        {
+            IFlyoutItem flyout = new FlyoutItemType()
+            {
+                Function = UIItemFunctionType.Flyout,
+                Description = description,
+                DisabledImageURL = disabledImageUrl,
+                ImageURL = imageUrl,
+                Label = label,
+                SubItem = new System.ComponentModel.BindingList<UIItemType>(),
+                Tooltip = tooltip
+            };
+            flyout.AddItems(subItems);
+            return flyout;
+        }
+
+        public ICommandItem CreateCommandItem(string cmdName)
+        {
+            return new CommandItemType() { Function = UIItemFunctionType.Command, Command = cmdName };
+        }
+
+        public ISeparatorItem CreateSeparator()
+        {
+            return new SeparatorItemType() { Function = UIItemFunctionType.Separator };
+        }
+
+        public void ExportCustomCommands(string file, string[] cmdNames)
+        {
+            WebLayoutCustomCommandList list = new WebLayoutCustomCommandList();
+
+            List<CommandType> commands = new List<CommandType>();
+
+            foreach (var name in cmdNames)
+            {
+                var cmd = (CommandType)GetCommandByName(name);
+                if (cmd != null)
+                    commands.Add(cmd);
+            }
+
+            list.Commands = commands.ToArray();
+
+            using (var fs = File.OpenWrite(file))
+            {
+                new XmlSerializer(typeof(WebLayoutCustomCommandList)).Serialize(fs, list);
+            }
+        }
+
+        public ImportedCommandResult[] ImportCustomCommands(string file)
+        {
+            List<ImportedCommandResult> clashes = new List<ImportedCommandResult>();
+
+            using (var fs = File.OpenRead(file))
+            {
+                var list = (WebLayoutCustomCommandList)(new XmlSerializer(typeof(WebLayoutCustomCommandList)).Deserialize(fs));
+                foreach (var importCmd in list.Commands)
+                {
+                    int counter = 0;
+                    string oldName = importCmd.Name;
+                    string newName = oldName;
+
+                    ICommand cmd = this.GetCommandByName(newName);
+                    while (cmd != null)
+                    {
+                        counter++;
+                        newName = oldName + counter;
+                        cmd = this.GetCommandByName(newName);
+                    }
+
+                    this.commandSetField.Add(importCmd);
+
+                    clashes.Add(new ImportedCommandResult() { OriginalName = oldName, ImportedName = newName });
+                }
+            }
+
+            return clashes.ToArray();
+        }
+
+        [XmlIgnore]
+        ICommandSet IWebLayout.CommandSet
+        {
+            get { return this; }
+        }
+
+        void ICommandSet.Clear()
+        {
+            this.CommandSet.Clear();
+        }
+
+        [XmlIgnore]
+        int ICommandSet.CommandCount
+        {
+            get { return this.CommandSet.Count; }
+        }
+
+        [XmlIgnore]
+        IEnumerable<ICommand> ICommandSet.Commands
+        {
+            get
+            {
+                foreach (var cmd in this.CommandSet)
+                {
+                    yield return cmd;
+                }
+            }
+        }
+
+        public event CommandEventHandler CustomCommandAdded;
+
+        public event CommandEventHandler CustomCommandRemoved;
+
+        void ICommandSet.AddCommand(ICommand cmd)
+        {
+            var c = cmd as CommandType;
+            if (c != null)
+            {
+                this.CommandSet.Add(c);
+                OnPropertyChanged("CommandSet"); //NOXLATE
+                if (cmd is IInvokeUrlCommand || cmd is IInvokeScriptCommand || cmd is ISearchCommand)
+                {
+                    var handler = this.CustomCommandAdded;
+                    if (handler != null)
+                        handler(cmd);
+                }
+            }
+        }
+
+        void ICommandSet.RemoveCommand(ICommand cmd)
+        {
+            var c = cmd as CommandType;
+            if (c != null)
+            {
+                this.CommandSet.Remove(c);
+                OnPropertyChanged("CommandSet"); //NOXLATE
+                if (cmd is IInvokeUrlCommand || cmd is IInvokeScriptCommand || cmd is ISearchCommand)
+                {
+                    var handler = this.CustomCommandRemoved;
+                    if (handler != null)
+                        handler(cmd);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        string IWebLayout.Title
+        {
+            get
+            {
+                return this.Title;
+            }
+            set
+            {
+                this.Title = value;
+            }
+        }
+
+        [XmlIgnore]
+        IMap IWebLayout.Map
+        {
+            get { return this.Map; }
+        }
+
+        [XmlIgnore]
+        ITaskPane IWebLayout.TaskPane
+        {
+            get { return this.TaskPane; }
+        }
+
+        [XmlIgnore]
+        IToolbar IWebLayout.ToolBar
+        {
+            get { return this.ToolBar; }
+        }
+
+        [XmlIgnore]
+        IInformationPane IWebLayout.InformationPane
+        {
+            get { return this.InformationPane; }
+        }
+
+        [XmlIgnore]
+        IContextMenu IWebLayout.ContextMenu
+        {
+            get { return this.ContextMenu; }
+        }
+
+        [XmlIgnore]
+        IStatusBar IWebLayout.StatusBar
+        {
+            get { return this.StatusBar; }
+        }
+
+        [XmlIgnore]
+        IZoomControl IWebLayout.ZoomControl
+        {
+            get { return this.ZoomControl; }
+        }
+    }
+
+    partial class TaskPaneType : ITaskPane
+    {
+        [XmlIgnore]
+        ITaskBar ITaskPane.TaskBar
+        {
+            get
+            {
+                return this.TaskBar;
+            }
+        }
+    }
+
+    partial class MapType : IMap
+    {
+        [XmlIgnore]
+        IMapView IMap.InitialView
+        {
+            get
+            {
+                return this.InitialView;
+            }
+            set
+            {
+                this.InitialView = (MapViewType)value;
+            }
+        }
+    }
+
+    partial class MapViewType : IMapView
+    {
+    }
+
+    partial class ToolBarType : IToolbar
+    {
+        [XmlIgnore]
+        public int ItemCount
+        {
+            get { return this.Button.Count; }
+        }
+
+        [XmlIgnore]
+        public IEnumerable<IUIItem> Items
+        {
+            get
+            {
+                foreach (var item in this.Button)
+                {
+                    yield return item;
+                }
+            }
+        }
+
+        public void AddItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.Button.Add(it);
+                it.Parent = this;
+                OnPropertyChanged("Button"); //NOXLATE
+            }
+        }
+
+        public void RemoveItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.Button.Remove(it);
+                it.Parent = null;
+                OnPropertyChanged("Button"); //NOXLATE
+            }
+        }
+
+        public bool MoveUp(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.Button.IndexOf(it);
+                if (isrc > 0)
+                {
+                    var idst = isrc - 1;
+                    var src = this.Button[isrc];
+                    var dst = this.Button[idst];
+
+                    this.Button[isrc] = dst;
+                    this.Button[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
+        public bool MoveDown(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.Button.IndexOf(it);
+                if (isrc < this.Button.Count - 1)
+                {
+                    var idst = isrc + 1;
+                    var src = this.Button[isrc];
+                    var dst = this.Button[idst];
+
+                    this.Button[isrc] = dst;
+                    this.Button[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public int GetIndex(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                return this.Button.IndexOf(it);
+            }
+            return -1;
+        }
+
+        public void Insert(IUIItem item, int index)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                it.Parent = this;
+                this.Button.Insert(index, it);
+            }
+        }
+    }
+
+    partial class InformationPaneType : IInformationPane
+    {
+    }
+
+    partial class ContextMenuType : IContextMenu
+    {
+        [XmlIgnore]
+        public int ItemCount
+        {
+            get { return this.MenuItem.Count; }
+        }
+
+        [XmlIgnore]
+        public IEnumerable<IUIItem> Items
+        {
+            get
+            {
+                foreach (var item in this.MenuItem)
+                {
+                    yield return item;
+                }
+            }
+        }
+
+        public void AddItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.MenuItem.Add(it);
+                it.Parent = this;
+                OnPropertyChanged("MenuItem"); //NOXLATE
+            }
+        }
+
+        public void RemoveItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.MenuItem.Remove(it);
+                it.Parent = null;
+                OnPropertyChanged("MenuItem"); //NOXLATE
+            }
+        }
+
+        public bool MoveUp(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.MenuItem.IndexOf(it);
+                if (isrc > 0)
+                {
+                    var idst = isrc - 1;
+                    var src = this.MenuItem[isrc];
+                    var dst = this.MenuItem[idst];
+
+                    this.MenuItem[isrc] = dst;
+                    this.MenuItem[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public bool MoveDown(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.MenuItem.IndexOf(it);
+                if (isrc < this.MenuItem.Count - 1)
+                {
+                    var idst = isrc + 1;
+                    var src = this.MenuItem[isrc];
+                    var dst = this.MenuItem[idst];
+
+                    this.MenuItem[isrc] = dst;
+                    this.MenuItem[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public int GetIndex(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                return this.MenuItem.IndexOf(it);
+            }
+            return -1;
+        }
+
+        public void Insert(IUIItem item, int index)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                it.Parent = this;
+                this.MenuItem.Insert(index, it);
+            }
+        }
+    }
+
+    partial class TaskBarType : ITaskBar
+    {
+        [XmlIgnore]
+        public int ItemCount
+        {
+            get { return this.MenuButton.Count; }
+        }
+
+        [XmlIgnore]
+        public IEnumerable<IUIItem> Items
+        {
+            get
+            {
+                foreach (var item in this.MenuButton)
+                {
+                    yield return item;
+                }
+            }
+        }
+
+        public void AddItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.MenuButton.Add(it);
+                it.Parent = this;
+                OnPropertyChanged("MenuButton"); //NOXLATE
+            }
+        }
+
+        public void RemoveItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.MenuButton.Remove(it);
+                it.Parent = null;
+                OnPropertyChanged("MenuButton"); //NOXLATE
+            }
+        }
+
+        public bool MoveUp(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.MenuButton.IndexOf(it);
+                if (isrc > 0)
+                {
+                    var idst = isrc - 1;
+                    var src = this.MenuButton[isrc];
+                    var dst = this.MenuButton[idst];
+
+                    this.MenuButton[isrc] = dst;
+                    this.MenuButton[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public bool MoveDown(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.MenuButton.IndexOf(it);
+                if (isrc < this.MenuButton.Count - 1)
+                {
+                    var idst = isrc + 1;
+                    var src = this.MenuButton[isrc];
+                    var dst = this.MenuButton[idst];
+
+                    this.MenuButton[isrc] = dst;
+                    this.MenuButton[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public int GetIndex(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                return this.MenuButton.IndexOf(it);
+            }
+            return -1;
+        }
+
+        public void Insert(IUIItem item, int index)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                it.Parent = this;
+                this.MenuButton.Insert(index, it);
+            }
+        }
+
+        [XmlIgnore]
+        ITaskButton ITaskBar.Home
+        {
+            get { return this.Home; }
+        }
+
+        [XmlIgnore]
+        ITaskButton ITaskBar.Forward
+        {
+            get { return this.Forward; }
+        }
+
+        [XmlIgnore]
+        ITaskButton ITaskBar.Back
+        {
+            get { return this.Back; }
+        }
+
+        [XmlIgnore]
+        ITaskButton ITaskBar.Tasks
+        {
+            get { return this.Tasks; }
+        }
+    }
+
+    partial class TaskButtonType : ITaskButton
+    {
+    }
+
+    partial class StatusBarType : IStatusBar
+    {
+    }
+
+    partial class ZoomControlType : IZoomControl
+    {
+    }
+
+    partial class CommandType : ICommand
+    {
+    }
+
+    partial class ResourceReferenceType : IResourceReference
+    {
+    }
+
+    partial class PrintCommandType : IPrintCommand
+    {
+        public void Clear()
+        {
+            this.PrintLayout.Clear();
+        }
+
+        [XmlIgnore]
+        IEnumerable<IResourceReference> IPrintCommand.PrintLayout
+        {
+            get
+            {
+                foreach (var refer in this.PrintLayout)
+                {
+                    yield return refer;
+                }
+            }
+        }
+
+        public IResourceReference CreatePrintLayout(string resourceId)
+        {
+            return new ResourceReferenceType() { ResourceId = resourceId };
+        }
+
+        public void AddPrintLayout(IResourceReference reference)
+        {
+            var r = reference as ResourceReferenceType;
+            if (r != null)
+            {
+                this.PrintLayout.Add(r);
+                OnPropertyChanged("PrintLayout"); //NOXLATE
+            }
+        }
+
+        public void RemovePrintLayout(IResourceReference reference)
+        {
+            var r = reference as ResourceReferenceType;
+            if (r != null)
+            {
+                this.PrintLayout.Remove(r);
+                OnPropertyChanged("PrintLayout"); //NOXLATE
+            }
+        }
+    }
+
+    partial class SeparatorItemType : ISeparatorItem
+    {
+    }
+
+    partial class BasicCommandType : IBasicCommand
+    {
+    }
+
+    partial class TargetedCommandType : ITargetedCommand
+    {
+    }
+
+    partial class FlyoutItemType : IFlyoutItem
+    {
+        [XmlIgnore]
+        public int ItemCount
+        {
+            get { return this.SubItem.Count; }
+        }
+
+        [XmlIgnore]
+        public IEnumerable<IUIItem> Items
+        {
+            get
+            {
+                foreach (var item in this.SubItem)
+                {
+                    yield return item;
+                }
+            }
+        }
+
+        public void AddItem(IUIItem item)
+        {
+            var i = item as UIItemType;
+            if (i != null)
+            {
+                this.SubItem.Add(i);
+                i.Parent = this;
+                OnPropertyChanged("SubItem"); //NOXLATE
+            }
+        }
+
+        public void RemoveItem(IUIItem item)
+        {
+            var i = item as UIItemType;
+            if (i != null)
+            {
+                this.SubItem.Remove(i);
+                i.Parent = null;
+                OnPropertyChanged("SubItem"); //NOXLATE
+            };
+        }
+
+        public bool MoveUp(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.SubItem.IndexOf(it);
+                if (isrc > 0)
+                {
+                    var idst = isrc - 1;
+                    var src = this.SubItem[isrc];
+                    var dst = this.SubItem[idst];
+
+                    this.SubItem[isrc] = dst;
+                    this.SubItem[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public bool MoveDown(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.SubItem.IndexOf(it);
+                if (isrc < this.SubItem.Count - 1)
+                {
+                    var idst = isrc + 1;
+                    var src = this.SubItem[isrc];
+                    var dst = this.SubItem[idst];
+
+                    this.SubItem[isrc] = dst;
+                    this.SubItem[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public int GetIndex(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                return this.SubItem.IndexOf(it);
+            }
+            return -1;
+        }
+
+        public void Insert(IUIItem item, int index)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                it.Parent = this;
+                this.SubItem.Insert(index, it);
+            }
+        }
+    }
+
+    partial class UIItemType : IUIItem
+    {
+        [XmlIgnore]
+        public IMenu Parent
+        {
+            get;
+            set;
+        }
+    }
+
+    partial class CommandItemType : ICommandItem
+    {
+    }
+
+    partial class InvokeURLCommandType : IInvokeUrlCommand, ILayerSet
+    {
+        [XmlIgnore]
+        ILayerSet IInvokeUrlCommand.LayerSet
+        {
+            get
+            {
+                return this;
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IParameterPair> IInvokeUrlCommand.AdditionalParameter
+        {
+            get
+            {
+                foreach (var pair in this.AdditionalParameter)
+                {
+                    yield return pair;
+                }
+            }
+        }
+
+        public IParameterPair CreateParameter(string name, string value)
+        {
+            return new ParameterPairType() { Key = name, Value = value };
+        }
+
+        public void AddParameter(IParameterPair param)
+        {
+            var p = param as ParameterPairType;
+            if (p != null)
+            {
+                this.AdditionalParameter.Add(p);
+                OnPropertyChanged("AdditionalParameter"); //NOXLATE
+            }
+        }
+
+        public void RemoveParameter(IParameterPair param)
+        {
+            var p = param as ParameterPairType;
+            if (p != null)
+            {
+                this.AdditionalParameter.Remove(p);
+                OnPropertyChanged("AdditionalParameter"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public BindingList<string> Layer
+        {
+            get
+            {
+                return this.LayerSet;
+            }
+        }
+    }
+
+    partial class ParameterPairType : IParameterPair
+    {
+    }
+
+    partial class SearchCommandType : ISearchCommand, IResultColumnSet
+    {
+        IResultColumn IResultColumnSet.CreateColumn(string name, string property)
+        {
+            return new ResultColumnType() { Name = name, Property = property };
+        }
+
+        [XmlIgnore]
+        IResultColumnSet ISearchCommand.ResultColumns
+        {
+            get
+            {
+                return this;
+            }
+        }
+
+        [XmlIgnore]
+        int ISearchCommand.MatchLimit
+        {
+            get
+            {
+                int i;
+                if (!int.TryParse(this.MatchLimit, out i))
+                {
+                    i = 100;
+                    this.MatchLimit = i.ToString();
+                }
+                return i;
+            }
+            set
+            {
+                this.MatchLimit = value.ToString();
+            }
+        }
+
+        public void Clear()
+        {
+            this.ResultColumns.Clear();
+        }
+
+        [XmlIgnore]
+        public IEnumerable<IResultColumn> Column
+        {
+            get
+            {
+                foreach (var col in this.ResultColumns)
+                {
+                    yield return col;
+                }
+            }
+        }
+
+        public void AddResultColumn(IResultColumn col)
+        {
+            var c = col as ResultColumnType;
+            if (c != null)
+            {
+                this.ResultColumns.Add(c);
+                OnPropertyChanged("ResultColumns"); //NOXLATE
+            }
+        }
+
+        public void RemoveResultColumn(IResultColumn col)
+        {
+            var c = col as ResultColumnType;
+            if (c != null)
+            {
+                this.ResultColumns.Remove(c);
+                OnPropertyChanged("ResultColumns"); //NOXLATE
+            }
+        }
+    }
+
+    partial class ResultColumnType : IResultColumn
+    {
+    }
+
+    partial class InvokeScriptCommandType : IInvokeScriptCommand
+    {
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v2_4_0/WebLayoutImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v2_4_0/WebLayoutImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v2_4_0/WebLayoutImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,1710 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define WL240
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if WL260
+namespace OSGeo.MapGuide.ObjectModels.WebLayout.v2_6_0
+#elif WL240
+
+namespace OSGeo.MapGuide.ObjectModels.WebLayout.v2_4_0
+#elif WL110
+
+namespace OSGeo.MapGuide.ObjectModels.WebLayout.v1_1_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.WebLayout.v1_0_0
+#endif
+{
+    public static class WebLayoutEntryPoint
+    {
+        public static IWebLayout CreateDefault(string mapDefinitionId)
+        {
+            IWebLayout wl = WebLayoutType.CreateDefault(mapDefinitionId);
+#if WL240 || WL260
+            //NOTE: This separator is needed because the AJAX viewer currently assumes the maptip
+            //command to be at a certain position (!!!). The seperator ensures the command is at
+            //the right position
+            wl.ToolBar.AddItem(wl.CreateSeparator());
+            wl.CommandSet.AddCommand(wl.CreateBasicCommand("Maptip", Strings.WL_Desc_MapTip, Strings.WL_Desc_MapTip, "icon_maptip", TargetViewerType.All, BasicCommandActionType.MapTip)); //NOXLATE
+            wl.ToolBar.AddItem(wl.CreateCommandItem(BasicCommandActionType.MapTip.ToString()));
+            IWebLayout2 wl2 = (IWebLayout2)wl;
+            wl2.EnablePingServer = true;
+#endif
+
+#if WL260
+            IWebLayout3 wl3 = (IWebLayout3)wl;
+            wl3.SelectionColor = "0000FFFF";
+            wl3.PointSelectionBuffer = 2;
+            wl3.MapImageFormat = "PNG";
+            wl3.SelectionImageFormat = "PNG";
+#endif
+            return wl;
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            return WebLayoutType.Deserialize(xml);
+        }
+
+        public static Stream Serialize(IResource res)
+        {
+            return res.SerializeToStream();
+        }
+    }
+
+    [Serializable]
+    public class WebLayoutCustomCommandList
+    {
+        [XmlArrayItem("CustomCommands")] //NOXLATE
+        public CommandType[] Commands { get; set; }
+    }
+
+    partial class WebLayoutType : IWebLayout, ICommandSet
+    {
+        internal WebLayoutType()
+        {
+        }
+
+#if WL260
+        private static readonly Version RES_VERSION = new Version(2, 6, 0);
+#elif WL240
+        private static readonly Version RES_VERSION = new Version(2, 4, 0);
+#elif WL110
+        private static readonly Version RES_VERSION = new Version(1, 1, 0);
+#else
+        private static readonly Version RES_VERSION = new Version(1, 0, 0);
+#endif
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.WebLayout.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.WebLayout));
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.WebLayout.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        object ICloneable.Clone()
+        {
+            return this.Clone();
+        }
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")] //NOXLATE
+        public string ValidatingSchema
+        {
+#if WL260
+            get { return "WebLayout-2.6.0.xsd"; } //NOXLATE
+#elif WL240
+            get { return "WebLayout-2.4.0.xsd"; } //NOXLATE
+#elif WL110
+            get { return "WebLayout-1.1.0.xsd"; } //NOXLATE
+#else
+            get { return "WebLayout-1.0.0.xsd"; } //NOXLATE
+#endif
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        public static IWebLayout CreateDefault(string mapDefinitionId)
+        {
+            //TODO: Localize these strings. Once localized we can have *translatable*
+            //web layouts!
+
+            IWebLayout wl = new WebLayoutType()
+            {
+                CommandSet = new System.ComponentModel.BindingList<CommandType>(),
+                ContextMenu = new ContextMenuType()
+                {
+                    Visible = true,
+                    MenuItem = new System.ComponentModel.BindingList<UIItemType>()
+                },
+                InformationPane = new InformationPaneType()
+                {
+                    LegendVisible = true,
+                    PropertiesVisible = true,
+                    Visible = true,
+                    Width = 200
+                },
+                Map = new MapType()
+                {
+                    HyperlinkTarget = TargetType.TaskPane,
+                    ResourceId = mapDefinitionId,
+                    //null InitialView = Use map's initial view
+                },
+                StatusBar = new StatusBarType()
+                {
+                    Visible = true
+                },
+                TaskPane = new TaskPaneType()
+                {
+                    TaskBar = new TaskBarType()
+                    {
+                        Back = new TaskButtonType()
+                        {
+                            Name = "Back",
+                            Tooltip = Strings.WL_Desc_TaskBack,
+                            Description = Strings.WL_Desc_TaskBack,
+                            ImageURL = "../stdicons/icon_back.gif",
+                            DisabledImageURL = "../stdicons/icon_back_disabled.gif"
+                        },
+                        Forward = new TaskButtonType()
+                        {
+                            Name = "Forward",
+                            Tooltip = Strings.WL_Desc_TaskForward,
+                            Description = Strings.WL_Desc_TaskForward,
+                            ImageURL = "../stdicons/icon_forward.gif",
+                            DisabledImageURL = "../stdicons/icon_forward_disabled.gif"
+                        },
+                        Home = new TaskButtonType()
+                        {
+                            Name = "Home",
+                            Tooltip = Strings.WL_Desc_TaskHome,
+                            Description = Strings.WL_Desc_TaskHome,
+                            ImageURL = "../stdicons/icon_home.gif",
+                            DisabledImageURL = "../stdicons/icon_home_disabled.gif"
+                        },
+                        //Task Pane menu buttons
+                        MenuButton = new System.ComponentModel.BindingList<UIItemType>(),
+                        Tasks = new TaskButtonType()
+                        {
+                            Name = "Tasks",
+                            Tooltip = Strings.WL_Label_TaskList,
+                            Description = Strings.WL_Desc_TaskList,
+                            ImageURL = "../stdicons/icon_tasks.gif",
+                            DisabledImageURL = "../stdicons/icon_tasks_disabled.gif"
+                        },
+                        Visible = true,
+                    },
+                    Visible = true,
+                    Width = 250,
+                },
+                Title = string.Empty,
+                ToolBar = new ToolBarType()
+                {
+                    Visible = true,
+                    Button = new System.ComponentModel.BindingList<UIItemType>()
+                },
+                ZoomControl = new ZoomControlType()
+                {
+                    Visible = true
+                },
+            };
+
+            CreateDefaultCommandSet(wl);
+            CreateDefaultContextMenu(wl);
+            CreateDefaultToolbar(wl);
+
+            return wl;
+        }
+
+        private static void CreateDefaultToolbar(IWebLayout wl)
+        {
+            wl.ToolBar.AddItems(
+            wl.CreateCommandItem(BuiltInCommandType.Print.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.GetPrintablePage.ToString()),
+            wl.CreateSeparator(),
+            wl.CreateCommandItem(BuiltInCommandType.Measure.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.Buffer.ToString()),
+            wl.CreateSeparator(),
+            wl.CreateFlyout(Strings.WL_Label_Zoom, null, null, null, null,
+                wl.CreateCommandItem(BuiltInCommandType.PreviousView.ToString()),
+                wl.CreateCommandItem(BuiltInCommandType.NextView.ToString()),
+                wl.CreateCommandItem(BuiltInCommandType.RestoreView.ToString())
+            ),
+            wl.CreateSeparator(),
+            wl.CreateCommandItem(BuiltInCommandType.ZoomRectangle.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.ZoomIn.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.ZoomOut.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.Zoom.ToString()),
+            wl.CreateSeparator(),
+            wl.CreateCommandItem(BuiltInCommandType.Select.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.Pan.ToString())
+            );
+        }
+
+        private static void CreateDefaultContextMenu(IWebLayout wl)
+        {
+            wl.ContextMenu.AddItems(
+                            wl.CreateCommandItem(BuiltInCommandType.Select.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.ClearSelection.ToString()),
+                                wl.CreateFlyout(Strings.WL_Label_SelectMore, null, null, null, null,
+                                    wl.CreateCommandItem(BuiltInCommandType.SelectRadius.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.SelectPolygon.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.SelectWithin.ToString())
+                                ),
+                                wl.CreateCommandItem(BuiltInCommandType.Pan.ToString()),
+                                wl.CreateSeparator(),
+                                wl.CreateCommandItem(BuiltInCommandType.ZoomRectangle.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.ZoomIn.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.ZoomOut.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.Zoom.ToString()),
+                                wl.CreateFlyout(Strings.WL_Label_Zoom, null, null, null, null,
+                                    wl.CreateCommandItem(BuiltInCommandType.PreviousView.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.NextView.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.FitToWindow.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.RestoreView.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.ZoomToSelection.ToString())
+                                ),
+                                wl.CreateSeparator(),
+                                wl.CreateCommandItem(BuiltInCommandType.Measure.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.Buffer.ToString()),
+                                wl.CreateSeparator(),
+                                wl.CreateCommandItem(BuiltInCommandType.Refresh.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.CopyMap.ToString()),
+                                wl.CreateSeparator(),
+                                wl.CreateCommandItem(BuiltInCommandType.Print.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.GetPrintablePage.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.ViewOptions.ToString()),
+                                wl.CreateSeparator(),
+                                wl.CreateCommandItem(BuiltInCommandType.Help.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.About.ToString())
+                                );
+        }
+
+        private static void CreateDefaultCommandSet(IWebLayout wl)
+        {
+            wl.CommandSet.AddCommand(
+                            wl.CreateBasicCommand(Strings.WL_Label_Pan,
+                                               Strings.WL_Label_Pan,
+                                               Strings.WL_Desc_Pan,
+                                               "icon_pan",
+                                               TargetViewerType.All,
+                                               BasicCommandActionType.Pan));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_PanUp,
+                               Strings.WL_Label_PanUp,
+                               Strings.WL_Desc_PanUp,
+                               "icon_panup",
+                               TargetViewerType.All,
+                               BasicCommandActionType.PanUp));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_PanDown,
+                               Strings.WL_Label_PanDown,
+                               Strings.WL_Desc_PanDown,
+                               "icon_pandown",
+                               TargetViewerType.All,
+                               BasicCommandActionType.PanDown));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_PanRight,
+                               Strings.WL_Label_PanRight,
+                               Strings.WL_Desc_PanRight,
+                               "icon_panright",
+                               TargetViewerType.All,
+                               BasicCommandActionType.PanRight));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_PanLeft,
+                               Strings.WL_Label_PanLeft,
+                               Strings.WL_Desc_PanLeft,
+                               "icon_panleft",
+                               TargetViewerType.All,
+                               BasicCommandActionType.PanLeft));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_Zoom,
+                               Strings.WL_Label_ZoomDynamic,
+                               Strings.WL_Desc_ZoomDynamic,
+                               "icon_zoom",
+                               TargetViewerType.Dwf,
+                               BasicCommandActionType.Zoom));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_ZoomIn,
+                               Strings.WL_Label_ZoomIn,
+                               Strings.WL_Desc_ZoomIn,
+                               "icon_zoomin",
+                               TargetViewerType.All,
+                               BasicCommandActionType.ZoomIn));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_ZoomOut,
+                               Strings.WL_Label_ZoomOut,
+                               Strings.WL_Desc_ZoomOut,
+                               "icon_zoomout",
+                               TargetViewerType.All,
+                               BasicCommandActionType.ZoomOut));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_ZoomRect,
+                               Strings.WL_Label_ZoomRect,
+                               Strings.WL_Desc_ZoomRect,
+                               "icon_zoomrect",
+                               TargetViewerType.All,
+                               BasicCommandActionType.ZoomRectangle));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_ZoomSelection,
+                               Strings.WL_Label_ZoomSelection,
+                               Strings.WL_Desc_ZoomSelection,
+                               "icon_zoomselect",
+                               TargetViewerType.All,
+                               BasicCommandActionType.ZoomToSelection));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_InitialMapView,
+                               Strings.WL_Label_InitialMapView,
+                               Strings.WL_Desc_InitialMapView,
+                               "icon_fitwindow",
+                               TargetViewerType.All,
+                               BasicCommandActionType.FitToWindow));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_PrevView,
+                               Strings.WL_Label_PrevView,
+                               Strings.WL_Desc_PrevView,
+                               "icon_zoomprev",
+                               TargetViewerType.All,
+                               BasicCommandActionType.PreviousView));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_NextView,
+                               Strings.WL_Label_NextView,
+                               Strings.WL_Desc_NextView,
+                               "icon_zoomnext",
+                               TargetViewerType.All,
+                               BasicCommandActionType.NextView));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_InitialCenterScale,
+                               Strings.WL_Label_InitialCenterScale,
+                               Strings.WL_Desc_InitialCenterScale,
+                               "icon_restorecenter",
+                               TargetViewerType.All,
+                               BasicCommandActionType.RestoreView));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_Select,
+                               Strings.WL_Label_Select,
+                               Strings.WL_Desc_Select,
+                               "icon_select",
+                               TargetViewerType.All,
+                               BasicCommandActionType.Select));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_SelectRadius,
+                               Strings.WL_Label_SelectRadius,
+                               Strings.WL_Desc_SelectRadius,
+                               "icon_selectradius",
+                               TargetViewerType.All,
+                               BasicCommandActionType.SelectRadius));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_SelectPolygon,
+                               Strings.WL_Label_SelectPolygon,
+                               Strings.WL_Desc_SelectPolygon,
+                               "icon_selectpolygon",
+                               TargetViewerType.All,
+                               BasicCommandActionType.SelectPolygon));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Desc_ClearSelection,
+                               Strings.WL_Label_ClearSelection,
+                               Strings.WL_Desc_ClearSelection,
+                               "icon_clearselect",
+                               TargetViewerType.All,
+                               BasicCommandActionType.ClearSelection));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_RefreshMap,
+                               Strings.WL_Label_RefreshMap,
+                               Strings.WL_Desc_RefreshMap,
+                               "icon_refreshmap",
+                               TargetViewerType.All,
+                               BasicCommandActionType.Refresh));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_Copy,
+                               Strings.WL_Label_Copy,
+                               Strings.WL_Desc_Copy,
+                               "icon_copy",
+                               TargetViewerType.Dwf,
+                               BasicCommandActionType.CopyMap));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_About,
+                               Strings.WL_Label_About,
+                               Strings.WL_Desc_About,
+                               null,
+                               TargetViewerType.All,
+                               BasicCommandActionType.About));
+            wl.CommandSet.AddCommand(
+            wl.CreateTargetedCommand<BufferCommandType>(BuiltInCommandType.Buffer.ToString(),
+                                                     Strings.WL_Label_Buffer,
+                                                     Strings.WL_Label_Buffer,
+                                                     Strings.WL_Desc_Buffer,
+                                                     "icon_buffer",
+                                                     TargetViewerType.All,
+                                                     TargetType.TaskPane,
+                                                     null));
+            wl.CommandSet.AddCommand(
+            wl.CreateTargetedCommand<SelectWithinCommandType>(BuiltInCommandType.SelectWithin.ToString(),
+                                                     Strings.WL_Label_SelectWithin,
+                                                     Strings.WL_Label_SelectWithin,
+                                                     Strings.WL_Desc_SelectWithin,
+                                                     "icon_selectwithin",
+                                                     TargetViewerType.All,
+                                                     TargetType.TaskPane,
+                                                     null));
+            wl.CommandSet.AddCommand(
+            wl.CreateTargetedCommand<MeasureCommandType>(BuiltInCommandType.Measure.ToString(),
+                                                      Strings.WL_Label_Measure,
+                                                      Strings.WL_Label_Measure,
+                                                      Strings.WL_Desc_Measure,
+                                                      "icon_measure",
+                                                      TargetViewerType.All,
+                                                      TargetType.TaskPane,
+                                                      null));
+            wl.CommandSet.AddCommand(
+            new PrintCommandType()
+            {
+                Name = "Print",
+                Label = Strings.WL_Label_Print,
+                Tooltip = Strings.WL_Label_Print,
+                Description = Strings.WL_Desc_Print,
+                ImageURL = "../stdicons/icon_print.gif",
+                DisabledImageURL = "../stdicons/icon_print_disabled.gif",
+                TargetViewer = TargetViewerType.Dwf
+            });
+            wl.CommandSet.AddCommand(
+            wl.CreateTargetedCommand<ViewOptionsCommandType>(BuiltInCommandType.ViewOptions.ToString(),
+                                                          Strings.WL_Label_ViewOptions,
+                                                          Strings.WL_Label_ViewOptions,
+                                                          Strings.WL_Desc_ViewOptions,
+                                                          "icon_viewoptions",
+                                                          TargetViewerType.All,
+                                                          TargetType.TaskPane,
+                                                          null));
+            wl.CommandSet.AddCommand(
+            wl.CreateTargetedCommand<GetPrintablePageCommandType>(BuiltInCommandType.GetPrintablePage.ToString(),
+                                                          Strings.WL_Label_GetPrintablePage,
+                                                          Strings.WL_Label_GetPrintablePage,
+                                                          Strings.WL_Desc_GetPrintablePage,
+                                                          "icon_printablepage",
+                                                          TargetViewerType.Ajax,
+                                                          TargetType.NewWindow,
+                                                          null));
+            wl.CommandSet.AddCommand(
+            new HelpCommandType()
+            {
+                Name = BuiltInCommandType.Help.ToString(),
+                Label = Strings.WL_Label_Help,
+                Tooltip = Strings.WL_Label_Help,
+                Description = Strings.WL_Desc_Help,
+                ImageURL = "../stdicons/icon_help.gif",
+                DisabledImageURL = "../stdicons/icon_help_disabled.gif",
+                TargetViewer = TargetViewerType.All,
+                Target = TargetType.TaskPane
+            });
+        }
+
+        public IMapView CreateDefaultView()
+        {
+            return new MapViewType();
+        }
+
+        /// <summary>
+        /// Indicates whether a given command is referenced in the user interface
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="region"></param>
+        /// <returns></returns>
+        public bool IsCommandReferenced(string name, out WebLayoutRegion[] region)
+        {
+            region = new WebLayoutRegion[0];
+            List<WebLayoutRegion> regions = new List<WebLayoutRegion>();
+            if (FindCommand(name, this.ContextMenu))
+            {
+                regions.Add(WebLayoutRegion.ContextMenu);
+            }
+
+            if (FindCommand(name, this.ToolBar))
+            {
+                regions.Add(WebLayoutRegion.Toolbar);
+            }
+
+            if (FindCommand(name, this.TaskPane.TaskBar))
+            {
+                regions.Add(WebLayoutRegion.TaskBar);
+            }
+
+            region = regions.ToArray();
+            return region.Length > 0;
+        }
+
+        /// <summary>
+        /// Removes all references of a given command
+        /// </summary>
+        /// <param name="cmdName"></param>
+        /// <returns>The number of references removed</returns>
+        public int RemoveAllReferences(string cmdName)
+        {
+            int removed = 0;
+            removed += RemoveInternal(cmdName, contextMenuField.MenuItem);
+            removed += RemoveInternal(cmdName, toolBarField.Button);
+            removed += RemoveInternal(cmdName, taskPaneField.TaskBar.MenuButton);
+            return removed;
+        }
+
+        private int RemoveInternal(string cmdName, IList<UIItemType> items)
+        {
+            int foundCount = 0;
+            List<IList<UIItemType>> subItemCheck = new List<IList<UIItemType>>();
+            List<UIItemType> found = new List<UIItemType>();
+            foreach (var item in items)
+            {
+                if (item.Function == UIItemFunctionType.Command)
+                {
+                    if (((CommandItemType)item).Command == cmdName)
+                        found.Add(item);
+                }
+                else if (item.Function == UIItemFunctionType.Flyout)
+                {
+                    subItemCheck.Add(((FlyoutItemType)item).SubItem);
+                }
+            }
+            foundCount += found.Count;
+            //Purge any found
+            foreach (var item in found)
+            {
+                items.Remove(item);
+            }
+            //Check these sub lists
+            foreach (var list in subItemCheck)
+            {
+                foundCount += RemoveInternal(cmdName, list);
+            }
+
+            return foundCount;
+        }
+
+        public ICommand GetCommandByName(string cmdName)
+        {
+            foreach (var cmd in this.CommandSet)
+            {
+                if (cmd.Name == cmdName)
+                    return cmd;
+            }
+
+            return null;
+        }
+
+        public IEnumerable<ICommand> GetCustomCommands()
+        {
+            foreach (var cmd in this.CommandSet)
+            {
+                var type = cmd.GetType();
+                if (typeof(InvokeURLCommandType).IsAssignableFrom(type) ||
+                    typeof(InvokeScriptCommandType).IsAssignableFrom(type) ||
+                    typeof(SearchCommandType).IsAssignableFrom(type))
+                {
+                    yield return cmd;
+                }
+            }
+        }
+
+        public bool FindCommand(string name, IMenu menu)
+        {
+            foreach (var item in menu.Items)
+            {
+                if (item.Function == UIItemFunctionType.Command)
+                {
+                    if (((CommandItemType)item).Command == name)
+                        return true;
+                }
+                else if (item.Function == UIItemFunctionType.Flyout)
+                {
+                    return FindCommand(name, ((IFlyoutItem)item));
+                }
+            }
+            return false;
+        }
+
+        public IBasicCommand CreateBasicCommand(string label, string tooltip, string description, string iconName, TargetViewerType targets, BasicCommandActionType action)
+        {
+            var cmd = new BasicCommandType()
+            {
+                Name = action.ToString(),
+                Label = label,
+                Tooltip = tooltip,
+                Description = description,
+
+                TargetViewer = targets,
+                Action = action
+            };
+
+            if (!string.IsNullOrEmpty(iconName))
+            {
+                cmd.ImageURL = "../stdicons/" + iconName + ".gif"; //NOXLATE
+                cmd.DisabledImageURL = "../stdicons/" + iconName + "_disabled.gif"; //NOXLATE
+            }
+
+            return cmd;
+        }
+
+        private string GenerateUniqueName(string prefix)
+        {
+            int counter = 0;
+            string name = prefix + counter;
+
+            Dictionary<string, string> ids = new Dictionary<string, string>();
+            foreach (var cmd in this.CommandSet)
+            {
+                ids.Add(cmd.Name, cmd.Name);
+            }
+
+            while (ids.ContainsKey(name))
+            {
+                counter++;
+                name = prefix + counter;
+            }
+
+            return name;
+        }
+
+        public IInvokeUrlCommand CreateInvokeUrlCommand()
+        {
+            return new InvokeURLCommandType()
+            {
+                Name = GenerateUniqueName("InvokeUrlCommand"), //NOXLATE
+                Target = TargetType.TaskPane,
+                DisableIfSelectionEmpty = false,
+                ImageURL = "../stdicons/icon_invokeurl.gif", //NOXLATE
+                DisabledImageURL = "../stdicons/icon_invokeurl_disabled.gif", //NOXLATE
+                TargetViewer = TargetViewerType.All,
+                AdditionalParameter = new BindingList<ParameterPairType>(),
+                URL = "",
+                LayerSet = new BindingList<string>()
+            };
+        }
+
+        public ISearchCommand CreateSearchCommand()
+        {
+            return new SearchCommandType()
+            {
+                Name = GenerateUniqueName("SearchCommand"), //NOXLATE
+                ResultColumns = new System.ComponentModel.BindingList<ResultColumnType>(),
+                Target = TargetType.TaskPane,
+                TargetViewer = TargetViewerType.All, //NOXLATE
+                DisabledImageURL = "../stdicons/icon_search_disabled.gif", //NOXLATE
+                ImageURL = "../stdicons/icon_search.gif", //NOXLATE
+                Layer = string.Empty,
+                Filter = string.Empty,
+                MatchLimit = "100",
+                Prompt = string.Empty
+            };
+        }
+
+        public IInvokeScriptCommand CreateInvokeScriptCommand()
+        {
+            return new InvokeScriptCommandType()
+            {
+                Name = GenerateUniqueName("InvokeScriptCommand"), //NOXLATE
+                DisabledImageURL = "../stdicons/icon_invokescript_disabled.gif", //NOXLATE
+                ImageURL = "../stdicons/icon_invokescript.gif", //NOXLATE
+                TargetViewer = TargetViewerType.All,
+                Script = "//Enter your script code here. You can use AJAX viewer API calls here. This code is called from the viewer's main frame" //NOXLATE
+            };
+        }
+
+        public T CreateTargetedCommand<T>(string name, string label, string tooltip, string description, string iconName, TargetViewerType targets, TargetType target, string targetFrame) where T : ITargetedCommand, new()
+        {
+            var cmd = new T()
+            {
+                Name = name,
+                Label = label,
+                Tooltip = tooltip,
+                Description = description,
+                TargetViewer = targets,
+                Target = target,
+            };
+
+            if (!string.IsNullOrEmpty(targetFrame) && target == TargetType.SpecifiedFrame)
+            {
+                cmd.TargetFrame = targetFrame;
+            }
+
+            if (!string.IsNullOrEmpty(iconName))
+            {
+                cmd.ImageURL = "../stdicons/" + iconName + ".gif";
+                cmd.DisabledImageURL = "../stdicons/" + iconName + "_disabled.gif";
+            }
+
+            return cmd;
+        }
+
+        public IFlyoutItem CreateFlyout(
+            string label,
+            string tooltip,
+            string description,
+            string imageUrl,
+            string disabledImageUrl,
+            params IUIItem[] subItems)
+        {
+            IFlyoutItem flyout = new FlyoutItemType()
+            {
+                Function = UIItemFunctionType.Flyout,
+                Description = description,
+                DisabledImageURL = disabledImageUrl,
+                ImageURL = imageUrl,
+                Label = label,
+                SubItem = new System.ComponentModel.BindingList<UIItemType>(),
+                Tooltip = tooltip
+            };
+            flyout.AddItems(subItems);
+            return flyout;
+        }
+
+        public ICommandItem CreateCommandItem(string cmdName)
+        {
+            return new CommandItemType() { Function = UIItemFunctionType.Command, Command = cmdName };
+        }
+
+        public ISeparatorItem CreateSeparator()
+        {
+            return new SeparatorItemType() { Function = UIItemFunctionType.Separator };
+        }
+
+        public void ExportCustomCommands(string file, string[] cmdNames)
+        {
+            WebLayoutCustomCommandList list = new WebLayoutCustomCommandList();
+
+            List<CommandType> commands = new List<CommandType>();
+
+            foreach (var name in cmdNames)
+            {
+                var cmd = (CommandType)GetCommandByName(name);
+                if (cmd != null)
+                    commands.Add(cmd);
+            }
+
+            list.Commands = commands.ToArray();
+
+            using (var fs = File.OpenWrite(file))
+            {
+                new XmlSerializer(typeof(WebLayoutCustomCommandList)).Serialize(fs, list);
+            }
+        }
+
+        public ImportedCommandResult[] ImportCustomCommands(string file)
+        {
+            List<ImportedCommandResult> clashes = new List<ImportedCommandResult>();
+
+            using (var fs = File.OpenRead(file))
+            {
+                var list = (WebLayoutCustomCommandList)(new XmlSerializer(typeof(WebLayoutCustomCommandList)).Deserialize(fs));
+                foreach (var importCmd in list.Commands)
+                {
+                    int counter = 0;
+                    string oldName = importCmd.Name;
+                    string newName = oldName;
+
+                    ICommand cmd = this.GetCommandByName(newName);
+                    while (cmd != null)
+                    {
+                        counter++;
+                        newName = oldName + counter;
+                        cmd = this.GetCommandByName(newName);
+                    }
+
+                    this.commandSetField.Add(importCmd);
+
+                    clashes.Add(new ImportedCommandResult() { OriginalName = oldName, ImportedName = newName });
+                }
+            }
+
+            return clashes.ToArray();
+        }
+
+        [XmlIgnore]
+        ICommandSet IWebLayout.CommandSet
+        {
+            get { return this; }
+        }
+
+        void ICommandSet.Clear()
+        {
+            this.CommandSet.Clear();
+        }
+
+        [XmlIgnore]
+        int ICommandSet.CommandCount
+        {
+            get { return this.CommandSet.Count; }
+        }
+
+        [XmlIgnore]
+        IEnumerable<ICommand> ICommandSet.Commands
+        {
+            get
+            {
+                foreach (var cmd in this.CommandSet)
+                {
+                    yield return cmd;
+                }
+            }
+        }
+
+        public event CommandEventHandler CustomCommandAdded;
+
+        public event CommandEventHandler CustomCommandRemoved;
+
+        void ICommandSet.AddCommand(ICommand cmd)
+        {
+            var c = cmd as CommandType;
+            if (c != null)
+            {
+                this.CommandSet.Add(c);
+                OnPropertyChanged("CommandSet"); //NOXLATE
+                if (cmd is IInvokeUrlCommand || cmd is IInvokeScriptCommand || cmd is ISearchCommand)
+                {
+                    var handler = this.CustomCommandAdded;
+                    if (handler != null)
+                        handler(cmd);
+                }
+            }
+        }
+
+        void ICommandSet.RemoveCommand(ICommand cmd)
+        {
+            var c = cmd as CommandType;
+            if (c != null)
+            {
+                this.CommandSet.Remove(c);
+                OnPropertyChanged("CommandSet"); //NOXLATE
+                if (cmd is IInvokeUrlCommand || cmd is IInvokeScriptCommand || cmd is ISearchCommand)
+                {
+                    var handler = this.CustomCommandRemoved;
+                    if (handler != null)
+                        handler(cmd);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        string IWebLayout.Title
+        {
+            get
+            {
+                return this.Title;
+            }
+            set
+            {
+                this.Title = value;
+            }
+        }
+
+        [XmlIgnore]
+        IMap IWebLayout.Map
+        {
+            get { return this.Map; }
+        }
+
+        [XmlIgnore]
+        ITaskPane IWebLayout.TaskPane
+        {
+            get { return this.TaskPane; }
+        }
+
+        [XmlIgnore]
+        IToolbar IWebLayout.ToolBar
+        {
+            get { return this.ToolBar; }
+        }
+
+        [XmlIgnore]
+        IInformationPane IWebLayout.InformationPane
+        {
+            get { return this.InformationPane; }
+        }
+
+        [XmlIgnore]
+        IContextMenu IWebLayout.ContextMenu
+        {
+            get { return this.ContextMenu; }
+        }
+
+        [XmlIgnore]
+        IStatusBar IWebLayout.StatusBar
+        {
+            get { return this.StatusBar; }
+        }
+
+        [XmlIgnore]
+        IZoomControl IWebLayout.ZoomControl
+        {
+            get { return this.ZoomControl; }
+        }
+    }
+
+    partial class TaskPaneType : ITaskPane
+    {
+        [XmlIgnore]
+        ITaskBar ITaskPane.TaskBar
+        {
+            get
+            {
+                return this.TaskBar;
+            }
+        }
+    }
+
+    partial class MapType : IMap
+    {
+        [XmlIgnore]
+        IMapView IMap.InitialView
+        {
+            get
+            {
+                return this.InitialView;
+            }
+            set
+            {
+                this.InitialView = (MapViewType)value;
+            }
+        }
+    }
+
+    partial class MapViewType : IMapView
+    {
+    }
+
+    partial class ToolBarType : IToolbar
+    {
+        [XmlIgnore]
+        public int ItemCount
+        {
+            get { return this.Button.Count; }
+        }
+
+        [XmlIgnore]
+        public IEnumerable<IUIItem> Items
+        {
+            get
+            {
+                foreach (var item in this.Button)
+                {
+                    yield return item;
+                }
+            }
+        }
+
+        public void AddItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.Button.Add(it);
+                it.Parent = this;
+                OnPropertyChanged("Button"); //NOXLATE
+            }
+        }
+
+        public void RemoveItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.Button.Remove(it);
+                it.Parent = null;
+                OnPropertyChanged("Button"); //NOXLATE
+            }
+        }
+
+        public bool MoveUp(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.Button.IndexOf(it);
+                if (isrc > 0)
+                {
+                    var idst = isrc - 1;
+                    var src = this.Button[isrc];
+                    var dst = this.Button[idst];
+
+                    this.Button[isrc] = dst;
+                    this.Button[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
+        public bool MoveDown(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.Button.IndexOf(it);
+                if (isrc < this.Button.Count - 1)
+                {
+                    var idst = isrc + 1;
+                    var src = this.Button[isrc];
+                    var dst = this.Button[idst];
+
+                    this.Button[isrc] = dst;
+                    this.Button[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public int GetIndex(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                return this.Button.IndexOf(it);
+            }
+            return -1;
+        }
+
+        public void Insert(IUIItem item, int index)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                it.Parent = this;
+                this.Button.Insert(index, it);
+            }
+        }
+    }
+
+    partial class InformationPaneType : IInformationPane
+    {
+    }
+
+    partial class ContextMenuType : IContextMenu
+    {
+        [XmlIgnore]
+        public int ItemCount
+        {
+            get { return this.MenuItem.Count; }
+        }
+
+        [XmlIgnore]
+        public IEnumerable<IUIItem> Items
+        {
+            get
+            {
+                foreach (var item in this.MenuItem)
+                {
+                    yield return item;
+                }
+            }
+        }
+
+        public void AddItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.MenuItem.Add(it);
+                it.Parent = this;
+                OnPropertyChanged("MenuItem"); //NOXLATE
+            }
+        }
+
+        public void RemoveItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.MenuItem.Remove(it);
+                it.Parent = null;
+                OnPropertyChanged("MenuItem"); //NOXLATE
+            }
+        }
+
+        public bool MoveUp(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.MenuItem.IndexOf(it);
+                if (isrc > 0)
+                {
+                    var idst = isrc - 1;
+                    var src = this.MenuItem[isrc];
+                    var dst = this.MenuItem[idst];
+
+                    this.MenuItem[isrc] = dst;
+                    this.MenuItem[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public bool MoveDown(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.MenuItem.IndexOf(it);
+                if (isrc < this.MenuItem.Count - 1)
+                {
+                    var idst = isrc + 1;
+                    var src = this.MenuItem[isrc];
+                    var dst = this.MenuItem[idst];
+
+                    this.MenuItem[isrc] = dst;
+                    this.MenuItem[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public int GetIndex(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                return this.MenuItem.IndexOf(it);
+            }
+            return -1;
+        }
+
+        public void Insert(IUIItem item, int index)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                it.Parent = this;
+                this.MenuItem.Insert(index, it);
+            }
+        }
+    }
+
+    partial class TaskBarType : ITaskBar
+    {
+        [XmlIgnore]
+        public int ItemCount
+        {
+            get { return this.MenuButton.Count; }
+        }
+
+        [XmlIgnore]
+        public IEnumerable<IUIItem> Items
+        {
+            get
+            {
+                foreach (var item in this.MenuButton)
+                {
+                    yield return item;
+                }
+            }
+        }
+
+        public void AddItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.MenuButton.Add(it);
+                it.Parent = this;
+                OnPropertyChanged("MenuButton"); //NOXLATE
+            }
+        }
+
+        public void RemoveItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.MenuButton.Remove(it);
+                it.Parent = null;
+                OnPropertyChanged("MenuButton"); //NOXLATE
+            }
+        }
+
+        public bool MoveUp(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.MenuButton.IndexOf(it);
+                if (isrc > 0)
+                {
+                    var idst = isrc - 1;
+                    var src = this.MenuButton[isrc];
+                    var dst = this.MenuButton[idst];
+
+                    this.MenuButton[isrc] = dst;
+                    this.MenuButton[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public bool MoveDown(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.MenuButton.IndexOf(it);
+                if (isrc < this.MenuButton.Count - 1)
+                {
+                    var idst = isrc + 1;
+                    var src = this.MenuButton[isrc];
+                    var dst = this.MenuButton[idst];
+
+                    this.MenuButton[isrc] = dst;
+                    this.MenuButton[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public int GetIndex(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                return this.MenuButton.IndexOf(it);
+            }
+            return -1;
+        }
+
+        public void Insert(IUIItem item, int index)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                it.Parent = this;
+                this.MenuButton.Insert(index, it);
+            }
+        }
+
+        [XmlIgnore]
+        ITaskButton ITaskBar.Home
+        {
+            get { return this.Home; }
+        }
+
+        [XmlIgnore]
+        ITaskButton ITaskBar.Forward
+        {
+            get { return this.Forward; }
+        }
+
+        [XmlIgnore]
+        ITaskButton ITaskBar.Back
+        {
+            get { return this.Back; }
+        }
+
+        [XmlIgnore]
+        ITaskButton ITaskBar.Tasks
+        {
+            get { return this.Tasks; }
+        }
+    }
+
+    partial class TaskButtonType : ITaskButton
+    {
+    }
+
+    partial class StatusBarType : IStatusBar
+    {
+    }
+
+    partial class ZoomControlType : IZoomControl
+    {
+    }
+
+    partial class CommandType : ICommand
+    {
+    }
+
+    partial class ResourceReferenceType : IResourceReference
+    {
+    }
+
+    partial class PrintCommandType : IPrintCommand
+    {
+        public void Clear()
+        {
+            this.PrintLayout.Clear();
+        }
+
+        [XmlIgnore]
+        IEnumerable<IResourceReference> IPrintCommand.PrintLayout
+        {
+            get
+            {
+                foreach (var refer in this.PrintLayout)
+                {
+                    yield return refer;
+                }
+            }
+        }
+
+        public IResourceReference CreatePrintLayout(string resourceId)
+        {
+            return new ResourceReferenceType() { ResourceId = resourceId };
+        }
+
+        public void AddPrintLayout(IResourceReference reference)
+        {
+            var r = reference as ResourceReferenceType;
+            if (r != null)
+            {
+                this.PrintLayout.Add(r);
+                OnPropertyChanged("PrintLayout"); //NOXLATE
+            }
+        }
+
+        public void RemovePrintLayout(IResourceReference reference)
+        {
+            var r = reference as ResourceReferenceType;
+            if (r != null)
+            {
+                this.PrintLayout.Remove(r);
+                OnPropertyChanged("PrintLayout"); //NOXLATE
+            }
+        }
+    }
+
+    partial class SeparatorItemType : ISeparatorItem
+    {
+    }
+
+    partial class BasicCommandType : IBasicCommand
+    {
+    }
+
+    partial class TargetedCommandType : ITargetedCommand
+    {
+    }
+
+    partial class FlyoutItemType : IFlyoutItem
+    {
+        [XmlIgnore]
+        public int ItemCount
+        {
+            get { return this.SubItem.Count; }
+        }
+
+        [XmlIgnore]
+        public IEnumerable<IUIItem> Items
+        {
+            get
+            {
+                foreach (var item in this.SubItem)
+                {
+                    yield return item;
+                }
+            }
+        }
+
+        public void AddItem(IUIItem item)
+        {
+            var i = item as UIItemType;
+            if (i != null)
+            {
+                this.SubItem.Add(i);
+                i.Parent = this;
+                OnPropertyChanged("SubItem"); //NOXLATE
+            }
+        }
+
+        public void RemoveItem(IUIItem item)
+        {
+            var i = item as UIItemType;
+            if (i != null)
+            {
+                this.SubItem.Remove(i);
+                i.Parent = null;
+                OnPropertyChanged("SubItem"); //NOXLATE
+            };
+        }
+
+        public bool MoveUp(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.SubItem.IndexOf(it);
+                if (isrc > 0)
+                {
+                    var idst = isrc - 1;
+                    var src = this.SubItem[isrc];
+                    var dst = this.SubItem[idst];
+
+                    this.SubItem[isrc] = dst;
+                    this.SubItem[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public bool MoveDown(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.SubItem.IndexOf(it);
+                if (isrc < this.SubItem.Count - 1)
+                {
+                    var idst = isrc + 1;
+                    var src = this.SubItem[isrc];
+                    var dst = this.SubItem[idst];
+
+                    this.SubItem[isrc] = dst;
+                    this.SubItem[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public int GetIndex(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                return this.SubItem.IndexOf(it);
+            }
+            return -1;
+        }
+
+        public void Insert(IUIItem item, int index)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                it.Parent = this;
+                this.SubItem.Insert(index, it);
+            }
+        }
+    }
+
+    partial class UIItemType : IUIItem
+    {
+        [XmlIgnore]
+        public IMenu Parent
+        {
+            get;
+            set;
+        }
+    }
+
+    partial class CommandItemType : ICommandItem
+    {
+    }
+
+    partial class InvokeURLCommandType : IInvokeUrlCommand, ILayerSet
+    {
+        [XmlIgnore]
+        ILayerSet IInvokeUrlCommand.LayerSet
+        {
+            get
+            {
+                return this;
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IParameterPair> IInvokeUrlCommand.AdditionalParameter
+        {
+            get
+            {
+                foreach (var pair in this.AdditionalParameter)
+                {
+                    yield return pair;
+                }
+            }
+        }
+
+        public IParameterPair CreateParameter(string name, string value)
+        {
+            return new ParameterPairType() { Key = name, Value = value };
+        }
+
+        public void AddParameter(IParameterPair param)
+        {
+            var p = param as ParameterPairType;
+            if (p != null)
+            {
+                this.AdditionalParameter.Add(p);
+                OnPropertyChanged("AdditionalParameter"); //NOXLATE
+            }
+        }
+
+        public void RemoveParameter(IParameterPair param)
+        {
+            var p = param as ParameterPairType;
+            if (p != null)
+            {
+                this.AdditionalParameter.Remove(p);
+                OnPropertyChanged("AdditionalParameter"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public BindingList<string> Layer
+        {
+            get
+            {
+                return this.LayerSet;
+            }
+        }
+    }
+
+    partial class ParameterPairType : IParameterPair
+    {
+    }
+
+    partial class SearchCommandType : ISearchCommand, IResultColumnSet
+    {
+        IResultColumn IResultColumnSet.CreateColumn(string name, string property)
+        {
+            return new ResultColumnType() { Name = name, Property = property };
+        }
+
+        [XmlIgnore]
+        IResultColumnSet ISearchCommand.ResultColumns
+        {
+            get
+            {
+                return this;
+            }
+        }
+
+        [XmlIgnore]
+        int ISearchCommand.MatchLimit
+        {
+            get
+            {
+                int i;
+                if (!int.TryParse(this.MatchLimit, out i))
+                {
+                    i = 100;
+                    this.MatchLimit = i.ToString();
+                }
+                return i;
+            }
+            set
+            {
+                this.MatchLimit = value.ToString();
+            }
+        }
+
+        public void Clear()
+        {
+            this.ResultColumns.Clear();
+        }
+
+        [XmlIgnore]
+        public IEnumerable<IResultColumn> Column
+        {
+            get
+            {
+                foreach (var col in this.ResultColumns)
+                {
+                    yield return col;
+                }
+            }
+        }
+
+        public void AddResultColumn(IResultColumn col)
+        {
+            var c = col as ResultColumnType;
+            if (c != null)
+            {
+                this.ResultColumns.Add(c);
+                OnPropertyChanged("ResultColumns"); //NOXLATE
+            }
+        }
+
+        public void RemoveResultColumn(IResultColumn col)
+        {
+            var c = col as ResultColumnType;
+            if (c != null)
+            {
+                this.ResultColumns.Remove(c);
+                OnPropertyChanged("ResultColumns"); //NOXLATE
+            }
+        }
+    }
+
+    partial class ResultColumnType : IResultColumn
+    {
+    }
+
+    partial class InvokeScriptCommandType : IInvokeScriptCommand
+    {
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v2_6_0/WebLayoutImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v2_6_0/WebLayoutImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/v2_6_0/WebLayoutImpl.cs	2014-12-25 14:53:57 UTC (rev 8463)
@@ -0,0 +1,1711 @@
+#region Disclaimer / License
+
+// Copyright (C) 2014, 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 Disclaimer / License
+
+#define WL260
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+
+#pragma warning disable 1591, 0114, 0108
+
+#if WL260
+
+namespace OSGeo.MapGuide.ObjectModels.WebLayout.v2_6_0
+#elif WL240
+
+namespace OSGeo.MapGuide.ObjectModels.WebLayout.v2_4_0
+#elif WL110
+
+namespace OSGeo.MapGuide.ObjectModels.WebLayout.v1_1_0
+#else
+
+namespace OSGeo.MapGuide.ObjectModels.WebLayout.v1_0_0
+#endif
+{
+    public static class WebLayoutEntryPoint
+    {
+        public static IWebLayout CreateDefault(string mapDefinitionId)
+        {
+            IWebLayout wl = WebLayoutType.CreateDefault(mapDefinitionId);
+#if WL240 || WL260
+            //NOTE: This separator is needed because the AJAX viewer currently assumes the maptip
+            //command to be at a certain position (!!!). The seperator ensures the command is at
+            //the right position
+            wl.ToolBar.AddItem(wl.CreateSeparator());
+            wl.CommandSet.AddCommand(wl.CreateBasicCommand("Maptip", Strings.WL_Desc_MapTip, Strings.WL_Desc_MapTip, "icon_maptip", TargetViewerType.All, BasicCommandActionType.MapTip)); //NOXLATE
+            wl.ToolBar.AddItem(wl.CreateCommandItem(BasicCommandActionType.MapTip.ToString()));
+            IWebLayout2 wl2 = (IWebLayout2)wl;
+            wl2.EnablePingServer = true;
+#endif
+
+#if WL260
+            IWebLayout3 wl3 = (IWebLayout3)wl;
+            wl3.SelectionColor = "0000FFFF";
+            wl3.PointSelectionBuffer = 2;
+            wl3.MapImageFormat = "PNG";
+            wl3.SelectionImageFormat = "PNG";
+#endif
+            return wl;
+        }
+
+        public static IResource Deserialize(string xml)
+        {
+            return WebLayoutType.Deserialize(xml);
+        }
+
+        public static Stream Serialize(IResource res)
+        {
+            return res.SerializeToStream();
+        }
+    }
+
+    [Serializable]
+    public class WebLayoutCustomCommandList
+    {
+        [XmlArrayItem("CustomCommands")] //NOXLATE
+        public CommandType[] Commands { get; set; }
+    }
+
+    partial class WebLayoutType : IWebLayout, ICommandSet
+    {
+        internal WebLayoutType()
+        {
+        }
+
+#if WL260
+        private static readonly Version RES_VERSION = new Version(2, 6, 0);
+#elif WL240
+        private static readonly Version RES_VERSION = new Version(2, 4, 0);
+#elif WL110
+        private static readonly Version RES_VERSION = new Version(1, 1, 0);
+#else
+        private static readonly Version RES_VERSION = new Version(1, 0, 0);
+#endif
+
+        private string _resId;
+
+        [XmlIgnore]
+        public string ResourceID
+        {
+            get
+            {
+                return _resId;
+            }
+            set
+            {
+                if (!ResourceIdentifier.Validate(value))
+                    throw new InvalidOperationException(Strings.ErrorInvalidResourceIdentifier);
+
+                var res = new ResourceIdentifier(value);
+                if (res.Extension != ResourceTypes.WebLayout.ToString())
+                    throw new InvalidOperationException(string.Format(Strings.ErrorUnexpectedResourceType, res.ToString(), ResourceTypes.WebLayout));
+
+                _resId = value;
+                this.OnPropertyChanged("ResourceID"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public string ResourceType
+        {
+            get
+            {
+                return ResourceTypes.WebLayout.ToString();
+            }
+        }
+
+        [XmlIgnore]
+        public Version ResourceVersion
+        {
+            get
+            {
+                return RES_VERSION;
+            }
+        }
+
+        object ICloneable.Clone()
+        {
+            return this.Clone();
+        }
+
+        [XmlAttribute("noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")] //NOXLATE
+        public string ValidatingSchema
+        {
+#if WL260
+            get { return "WebLayout-2.6.0.xsd"; } //NOXLATE
+#elif WL240
+            get { return "WebLayout-2.4.0.xsd"; } //NOXLATE
+#elif WL110
+            get { return "WebLayout-1.1.0.xsd"; } //NOXLATE
+#else
+            get { return "WebLayout-1.0.0.xsd"; } //NOXLATE
+#endif
+            set { }
+        }
+
+        [XmlIgnore]
+        public bool IsStronglyTyped
+        {
+            get { return true; }
+        }
+
+        public static IWebLayout CreateDefault(string mapDefinitionId)
+        {
+            //TODO: Localize these strings. Once localized we can have *translatable*
+            //web layouts!
+
+            IWebLayout wl = new WebLayoutType()
+            {
+                CommandSet = new System.ComponentModel.BindingList<CommandType>(),
+                ContextMenu = new ContextMenuType()
+                {
+                    Visible = true,
+                    MenuItem = new System.ComponentModel.BindingList<UIItemType>()
+                },
+                InformationPane = new InformationPaneType()
+                {
+                    LegendVisible = true,
+                    PropertiesVisible = true,
+                    Visible = true,
+                    Width = 200
+                },
+                Map = new MapType()
+                {
+                    HyperlinkTarget = TargetType.TaskPane,
+                    ResourceId = mapDefinitionId,
+                    //null InitialView = Use map's initial view
+                },
+                StatusBar = new StatusBarType()
+                {
+                    Visible = true
+                },
+                TaskPane = new TaskPaneType()
+                {
+                    TaskBar = new TaskBarType()
+                    {
+                        Back = new TaskButtonType()
+                        {
+                            Name = "Back",
+                            Tooltip = Strings.WL_Desc_TaskBack,
+                            Description = Strings.WL_Desc_TaskBack,
+                            ImageURL = "../stdicons/icon_back.gif",
+                            DisabledImageURL = "../stdicons/icon_back_disabled.gif"
+                        },
+                        Forward = new TaskButtonType()
+                        {
+                            Name = "Forward",
+                            Tooltip = Strings.WL_Desc_TaskForward,
+                            Description = Strings.WL_Desc_TaskForward,
+                            ImageURL = "../stdicons/icon_forward.gif",
+                            DisabledImageURL = "../stdicons/icon_forward_disabled.gif"
+                        },
+                        Home = new TaskButtonType()
+                        {
+                            Name = "Home",
+                            Tooltip = Strings.WL_Desc_TaskHome,
+                            Description = Strings.WL_Desc_TaskHome,
+                            ImageURL = "../stdicons/icon_home.gif",
+                            DisabledImageURL = "../stdicons/icon_home_disabled.gif"
+                        },
+                        //Task Pane menu buttons
+                        MenuButton = new System.ComponentModel.BindingList<UIItemType>(),
+                        Tasks = new TaskButtonType()
+                        {
+                            Name = "Tasks",
+                            Tooltip = Strings.WL_Label_TaskList,
+                            Description = Strings.WL_Desc_TaskList,
+                            ImageURL = "../stdicons/icon_tasks.gif",
+                            DisabledImageURL = "../stdicons/icon_tasks_disabled.gif"
+                        },
+                        Visible = true,
+                    },
+                    Visible = true,
+                    Width = 250,
+                },
+                Title = string.Empty,
+                ToolBar = new ToolBarType()
+                {
+                    Visible = true,
+                    Button = new System.ComponentModel.BindingList<UIItemType>()
+                },
+                ZoomControl = new ZoomControlType()
+                {
+                    Visible = true
+                },
+            };
+
+            CreateDefaultCommandSet(wl);
+            CreateDefaultContextMenu(wl);
+            CreateDefaultToolbar(wl);
+
+            return wl;
+        }
+
+        private static void CreateDefaultToolbar(IWebLayout wl)
+        {
+            wl.ToolBar.AddItems(
+            wl.CreateCommandItem(BuiltInCommandType.Print.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.GetPrintablePage.ToString()),
+            wl.CreateSeparator(),
+            wl.CreateCommandItem(BuiltInCommandType.Measure.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.Buffer.ToString()),
+            wl.CreateSeparator(),
+            wl.CreateFlyout(Strings.WL_Label_Zoom, null, null, null, null,
+                wl.CreateCommandItem(BuiltInCommandType.PreviousView.ToString()),
+                wl.CreateCommandItem(BuiltInCommandType.NextView.ToString()),
+                wl.CreateCommandItem(BuiltInCommandType.RestoreView.ToString())
+            ),
+            wl.CreateSeparator(),
+            wl.CreateCommandItem(BuiltInCommandType.ZoomRectangle.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.ZoomIn.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.ZoomOut.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.Zoom.ToString()),
+            wl.CreateSeparator(),
+            wl.CreateCommandItem(BuiltInCommandType.Select.ToString()),
+            wl.CreateCommandItem(BuiltInCommandType.Pan.ToString())
+            );
+        }
+
+        private static void CreateDefaultContextMenu(IWebLayout wl)
+        {
+            wl.ContextMenu.AddItems(
+                            wl.CreateCommandItem(BuiltInCommandType.Select.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.ClearSelection.ToString()),
+                                wl.CreateFlyout(Strings.WL_Label_SelectMore, null, null, null, null,
+                                    wl.CreateCommandItem(BuiltInCommandType.SelectRadius.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.SelectPolygon.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.SelectWithin.ToString())
+                                ),
+                                wl.CreateCommandItem(BuiltInCommandType.Pan.ToString()),
+                                wl.CreateSeparator(),
+                                wl.CreateCommandItem(BuiltInCommandType.ZoomRectangle.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.ZoomIn.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.ZoomOut.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.Zoom.ToString()),
+                                wl.CreateFlyout(Strings.WL_Label_Zoom, null, null, null, null,
+                                    wl.CreateCommandItem(BuiltInCommandType.PreviousView.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.NextView.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.FitToWindow.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.RestoreView.ToString()),
+                                    wl.CreateCommandItem(BuiltInCommandType.ZoomToSelection.ToString())
+                                ),
+                                wl.CreateSeparator(),
+                                wl.CreateCommandItem(BuiltInCommandType.Measure.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.Buffer.ToString()),
+                                wl.CreateSeparator(),
+                                wl.CreateCommandItem(BuiltInCommandType.Refresh.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.CopyMap.ToString()),
+                                wl.CreateSeparator(),
+                                wl.CreateCommandItem(BuiltInCommandType.Print.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.GetPrintablePage.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.ViewOptions.ToString()),
+                                wl.CreateSeparator(),
+                                wl.CreateCommandItem(BuiltInCommandType.Help.ToString()),
+                                wl.CreateCommandItem(BuiltInCommandType.About.ToString())
+                                );
+        }
+
+        private static void CreateDefaultCommandSet(IWebLayout wl)
+        {
+            wl.CommandSet.AddCommand(
+                            wl.CreateBasicCommand(Strings.WL_Label_Pan,
+                                               Strings.WL_Label_Pan,
+                                               Strings.WL_Desc_Pan,
+                                               "icon_pan",
+                                               TargetViewerType.All,
+                                               BasicCommandActionType.Pan));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_PanUp,
+                               Strings.WL_Label_PanUp,
+                               Strings.WL_Desc_PanUp,
+                               "icon_panup",
+                               TargetViewerType.All,
+                               BasicCommandActionType.PanUp));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_PanDown,
+                               Strings.WL_Label_PanDown,
+                               Strings.WL_Desc_PanDown,
+                               "icon_pandown",
+                               TargetViewerType.All,
+                               BasicCommandActionType.PanDown));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_PanRight,
+                               Strings.WL_Label_PanRight,
+                               Strings.WL_Desc_PanRight,
+                               "icon_panright",
+                               TargetViewerType.All,
+                               BasicCommandActionType.PanRight));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_PanLeft,
+                               Strings.WL_Label_PanLeft,
+                               Strings.WL_Desc_PanLeft,
+                               "icon_panleft",
+                               TargetViewerType.All,
+                               BasicCommandActionType.PanLeft));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_Zoom,
+                               Strings.WL_Label_ZoomDynamic,
+                               Strings.WL_Desc_ZoomDynamic,
+                               "icon_zoom",
+                               TargetViewerType.Dwf,
+                               BasicCommandActionType.Zoom));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_ZoomIn,
+                               Strings.WL_Label_ZoomIn,
+                               Strings.WL_Desc_ZoomIn,
+                               "icon_zoomin",
+                               TargetViewerType.All,
+                               BasicCommandActionType.ZoomIn));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_ZoomOut,
+                               Strings.WL_Label_ZoomOut,
+                               Strings.WL_Desc_ZoomOut,
+                               "icon_zoomout",
+                               TargetViewerType.All,
+                               BasicCommandActionType.ZoomOut));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_ZoomRect,
+                               Strings.WL_Label_ZoomRect,
+                               Strings.WL_Desc_ZoomRect,
+                               "icon_zoomrect",
+                               TargetViewerType.All,
+                               BasicCommandActionType.ZoomRectangle));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_ZoomSelection,
+                               Strings.WL_Label_ZoomSelection,
+                               Strings.WL_Desc_ZoomSelection,
+                               "icon_zoomselect",
+                               TargetViewerType.All,
+                               BasicCommandActionType.ZoomToSelection));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_InitialMapView,
+                               Strings.WL_Label_InitialMapView,
+                               Strings.WL_Desc_InitialMapView,
+                               "icon_fitwindow",
+                               TargetViewerType.All,
+                               BasicCommandActionType.FitToWindow));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_PrevView,
+                               Strings.WL_Label_PrevView,
+                               Strings.WL_Desc_PrevView,
+                               "icon_zoomprev",
+                               TargetViewerType.All,
+                               BasicCommandActionType.PreviousView));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_NextView,
+                               Strings.WL_Label_NextView,
+                               Strings.WL_Desc_NextView,
+                               "icon_zoomnext",
+                               TargetViewerType.All,
+                               BasicCommandActionType.NextView));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_InitialCenterScale,
+                               Strings.WL_Label_InitialCenterScale,
+                               Strings.WL_Desc_InitialCenterScale,
+                               "icon_restorecenter",
+                               TargetViewerType.All,
+                               BasicCommandActionType.RestoreView));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_Select,
+                               Strings.WL_Label_Select,
+                               Strings.WL_Desc_Select,
+                               "icon_select",
+                               TargetViewerType.All,
+                               BasicCommandActionType.Select));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_SelectRadius,
+                               Strings.WL_Label_SelectRadius,
+                               Strings.WL_Desc_SelectRadius,
+                               "icon_selectradius",
+                               TargetViewerType.All,
+                               BasicCommandActionType.SelectRadius));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_SelectPolygon,
+                               Strings.WL_Label_SelectPolygon,
+                               Strings.WL_Desc_SelectPolygon,
+                               "icon_selectpolygon",
+                               TargetViewerType.All,
+                               BasicCommandActionType.SelectPolygon));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Desc_ClearSelection,
+                               Strings.WL_Label_ClearSelection,
+                               Strings.WL_Desc_ClearSelection,
+                               "icon_clearselect",
+                               TargetViewerType.All,
+                               BasicCommandActionType.ClearSelection));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_RefreshMap,
+                               Strings.WL_Label_RefreshMap,
+                               Strings.WL_Desc_RefreshMap,
+                               "icon_refreshmap",
+                               TargetViewerType.All,
+                               BasicCommandActionType.Refresh));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_Copy,
+                               Strings.WL_Label_Copy,
+                               Strings.WL_Desc_Copy,
+                               "icon_copy",
+                               TargetViewerType.Dwf,
+                               BasicCommandActionType.CopyMap));
+            wl.CommandSet.AddCommand(
+            wl.CreateBasicCommand(Strings.WL_Label_About,
+                               Strings.WL_Label_About,
+                               Strings.WL_Desc_About,
+                               null,
+                               TargetViewerType.All,
+                               BasicCommandActionType.About));
+            wl.CommandSet.AddCommand(
+            wl.CreateTargetedCommand<BufferCommandType>(BuiltInCommandType.Buffer.ToString(),
+                                                     Strings.WL_Label_Buffer,
+                                                     Strings.WL_Label_Buffer,
+                                                     Strings.WL_Desc_Buffer,
+                                                     "icon_buffer",
+                                                     TargetViewerType.All,
+                                                     TargetType.TaskPane,
+                                                     null));
+            wl.CommandSet.AddCommand(
+            wl.CreateTargetedCommand<SelectWithinCommandType>(BuiltInCommandType.SelectWithin.ToString(),
+                                                     Strings.WL_Label_SelectWithin,
+                                                     Strings.WL_Label_SelectWithin,
+                                                     Strings.WL_Desc_SelectWithin,
+                                                     "icon_selectwithin",
+                                                     TargetViewerType.All,
+                                                     TargetType.TaskPane,
+                                                     null));
+            wl.CommandSet.AddCommand(
+            wl.CreateTargetedCommand<MeasureCommandType>(BuiltInCommandType.Measure.ToString(),
+                                                      Strings.WL_Label_Measure,
+                                                      Strings.WL_Label_Measure,
+                                                      Strings.WL_Desc_Measure,
+                                                      "icon_measure",
+                                                      TargetViewerType.All,
+                                                      TargetType.TaskPane,
+                                                      null));
+            wl.CommandSet.AddCommand(
+            new PrintCommandType()
+            {
+                Name = "Print",
+                Label = Strings.WL_Label_Print,
+                Tooltip = Strings.WL_Label_Print,
+                Description = Strings.WL_Desc_Print,
+                ImageURL = "../stdicons/icon_print.gif",
+                DisabledImageURL = "../stdicons/icon_print_disabled.gif",
+                TargetViewer = TargetViewerType.Dwf
+            });
+            wl.CommandSet.AddCommand(
+            wl.CreateTargetedCommand<ViewOptionsCommandType>(BuiltInCommandType.ViewOptions.ToString(),
+                                                          Strings.WL_Label_ViewOptions,
+                                                          Strings.WL_Label_ViewOptions,
+                                                          Strings.WL_Desc_ViewOptions,
+                                                          "icon_viewoptions",
+                                                          TargetViewerType.All,
+                                                          TargetType.TaskPane,
+                                                          null));
+            wl.CommandSet.AddCommand(
+            wl.CreateTargetedCommand<GetPrintablePageCommandType>(BuiltInCommandType.GetPrintablePage.ToString(),
+                                                          Strings.WL_Label_GetPrintablePage,
+                                                          Strings.WL_Label_GetPrintablePage,
+                                                          Strings.WL_Desc_GetPrintablePage,
+                                                          "icon_printablepage",
+                                                          TargetViewerType.Ajax,
+                                                          TargetType.NewWindow,
+                                                          null));
+            wl.CommandSet.AddCommand(
+            new HelpCommandType()
+            {
+                Name = BuiltInCommandType.Help.ToString(),
+                Label = Strings.WL_Label_Help,
+                Tooltip = Strings.WL_Label_Help,
+                Description = Strings.WL_Desc_Help,
+                ImageURL = "../stdicons/icon_help.gif",
+                DisabledImageURL = "../stdicons/icon_help_disabled.gif",
+                TargetViewer = TargetViewerType.All,
+                Target = TargetType.TaskPane
+            });
+        }
+
+        public IMapView CreateDefaultView()
+        {
+            return new MapViewType();
+        }
+
+        /// <summary>
+        /// Indicates whether a given command is referenced in the user interface
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="region"></param>
+        /// <returns></returns>
+        public bool IsCommandReferenced(string name, out WebLayoutRegion[] region)
+        {
+            region = new WebLayoutRegion[0];
+            List<WebLayoutRegion> regions = new List<WebLayoutRegion>();
+            if (FindCommand(name, this.ContextMenu))
+            {
+                regions.Add(WebLayoutRegion.ContextMenu);
+            }
+
+            if (FindCommand(name, this.ToolBar))
+            {
+                regions.Add(WebLayoutRegion.Toolbar);
+            }
+
+            if (FindCommand(name, this.TaskPane.TaskBar))
+            {
+                regions.Add(WebLayoutRegion.TaskBar);
+            }
+
+            region = regions.ToArray();
+            return region.Length > 0;
+        }
+
+        /// <summary>
+        /// Removes all references of a given command
+        /// </summary>
+        /// <param name="cmdName"></param>
+        /// <returns>The number of references removed</returns>
+        public int RemoveAllReferences(string cmdName)
+        {
+            int removed = 0;
+            removed += RemoveInternal(cmdName, contextMenuField.MenuItem);
+            removed += RemoveInternal(cmdName, toolBarField.Button);
+            removed += RemoveInternal(cmdName, taskPaneField.TaskBar.MenuButton);
+            return removed;
+        }
+
+        private int RemoveInternal(string cmdName, IList<UIItemType> items)
+        {
+            int foundCount = 0;
+            List<IList<UIItemType>> subItemCheck = new List<IList<UIItemType>>();
+            List<UIItemType> found = new List<UIItemType>();
+            foreach (var item in items)
+            {
+                if (item.Function == UIItemFunctionType.Command)
+                {
+                    if (((CommandItemType)item).Command == cmdName)
+                        found.Add(item);
+                }
+                else if (item.Function == UIItemFunctionType.Flyout)
+                {
+                    subItemCheck.Add(((FlyoutItemType)item).SubItem);
+                }
+            }
+            foundCount += found.Count;
+            //Purge any found
+            foreach (var item in found)
+            {
+                items.Remove(item);
+            }
+            //Check these sub lists
+            foreach (var list in subItemCheck)
+            {
+                foundCount += RemoveInternal(cmdName, list);
+            }
+
+            return foundCount;
+        }
+
+        public ICommand GetCommandByName(string cmdName)
+        {
+            foreach (var cmd in this.CommandSet)
+            {
+                if (cmd.Name == cmdName)
+                    return cmd;
+            }
+
+            return null;
+        }
+
+        public IEnumerable<ICommand> GetCustomCommands()
+        {
+            foreach (var cmd in this.CommandSet)
+            {
+                var type = cmd.GetType();
+                if (typeof(InvokeURLCommandType).IsAssignableFrom(type) ||
+                    typeof(InvokeScriptCommandType).IsAssignableFrom(type) ||
+                    typeof(SearchCommandType).IsAssignableFrom(type))
+                {
+                    yield return cmd;
+                }
+            }
+        }
+
+        public bool FindCommand(string name, IMenu menu)
+        {
+            foreach (var item in menu.Items)
+            {
+                if (item.Function == UIItemFunctionType.Command)
+                {
+                    if (((CommandItemType)item).Command == name)
+                        return true;
+                }
+                else if (item.Function == UIItemFunctionType.Flyout)
+                {
+                    return FindCommand(name, ((IFlyoutItem)item));
+                }
+            }
+            return false;
+        }
+
+        public IBasicCommand CreateBasicCommand(string label, string tooltip, string description, string iconName, TargetViewerType targets, BasicCommandActionType action)
+        {
+            var cmd = new BasicCommandType()
+            {
+                Name = action.ToString(),
+                Label = label,
+                Tooltip = tooltip,
+                Description = description,
+
+                TargetViewer = targets,
+                Action = action
+            };
+
+            if (!string.IsNullOrEmpty(iconName))
+            {
+                cmd.ImageURL = "../stdicons/" + iconName + ".gif"; //NOXLATE
+                cmd.DisabledImageURL = "../stdicons/" + iconName + "_disabled.gif"; //NOXLATE
+            }
+
+            return cmd;
+        }
+
+        private string GenerateUniqueName(string prefix)
+        {
+            int counter = 0;
+            string name = prefix + counter;
+
+            Dictionary<string, string> ids = new Dictionary<string, string>();
+            foreach (var cmd in this.CommandSet)
+            {
+                ids.Add(cmd.Name, cmd.Name);
+            }
+
+            while (ids.ContainsKey(name))
+            {
+                counter++;
+                name = prefix + counter;
+            }
+
+            return name;
+        }
+
+        public IInvokeUrlCommand CreateInvokeUrlCommand()
+        {
+            return new InvokeURLCommandType()
+            {
+                Name = GenerateUniqueName("InvokeUrlCommand"), //NOXLATE
+                Target = TargetType.TaskPane,
+                DisableIfSelectionEmpty = false,
+                ImageURL = "../stdicons/icon_invokeurl.gif", //NOXLATE
+                DisabledImageURL = "../stdicons/icon_invokeurl_disabled.gif", //NOXLATE
+                TargetViewer = TargetViewerType.All,
+                AdditionalParameter = new BindingList<ParameterPairType>(),
+                URL = "",
+                LayerSet = new BindingList<string>()
+            };
+        }
+
+        public ISearchCommand CreateSearchCommand()
+        {
+            return new SearchCommandType()
+            {
+                Name = GenerateUniqueName("SearchCommand"), //NOXLATE
+                ResultColumns = new System.ComponentModel.BindingList<ResultColumnType>(),
+                Target = TargetType.TaskPane,
+                TargetViewer = TargetViewerType.All, //NOXLATE
+                DisabledImageURL = "../stdicons/icon_search_disabled.gif", //NOXLATE
+                ImageURL = "../stdicons/icon_search.gif", //NOXLATE
+                Layer = string.Empty,
+                Filter = string.Empty,
+                MatchLimit = "100",
+                Prompt = string.Empty
+            };
+        }
+
+        public IInvokeScriptCommand CreateInvokeScriptCommand()
+        {
+            return new InvokeScriptCommandType()
+            {
+                Name = GenerateUniqueName("InvokeScriptCommand"), //NOXLATE
+                DisabledImageURL = "../stdicons/icon_invokescript_disabled.gif", //NOXLATE
+                ImageURL = "../stdicons/icon_invokescript.gif", //NOXLATE
+                TargetViewer = TargetViewerType.All,
+                Script = "//Enter your script code here. You can use AJAX viewer API calls here. This code is called from the viewer's main frame" //NOXLATE
+            };
+        }
+
+        public T CreateTargetedCommand<T>(string name, string label, string tooltip, string description, string iconName, TargetViewerType targets, TargetType target, string targetFrame) where T : ITargetedCommand, new()
+        {
+            var cmd = new T()
+            {
+                Name = name,
+                Label = label,
+                Tooltip = tooltip,
+                Description = description,
+                TargetViewer = targets,
+                Target = target,
+            };
+
+            if (!string.IsNullOrEmpty(targetFrame) && target == TargetType.SpecifiedFrame)
+            {
+                cmd.TargetFrame = targetFrame;
+            }
+
+            if (!string.IsNullOrEmpty(iconName))
+            {
+                cmd.ImageURL = "../stdicons/" + iconName + ".gif";
+                cmd.DisabledImageURL = "../stdicons/" + iconName + "_disabled.gif";
+            }
+
+            return cmd;
+        }
+
+        public IFlyoutItem CreateFlyout(
+            string label,
+            string tooltip,
+            string description,
+            string imageUrl,
+            string disabledImageUrl,
+            params IUIItem[] subItems)
+        {
+            IFlyoutItem flyout = new FlyoutItemType()
+            {
+                Function = UIItemFunctionType.Flyout,
+                Description = description,
+                DisabledImageURL = disabledImageUrl,
+                ImageURL = imageUrl,
+                Label = label,
+                SubItem = new System.ComponentModel.BindingList<UIItemType>(),
+                Tooltip = tooltip
+            };
+            flyout.AddItems(subItems);
+            return flyout;
+        }
+
+        public ICommandItem CreateCommandItem(string cmdName)
+        {
+            return new CommandItemType() { Function = UIItemFunctionType.Command, Command = cmdName };
+        }
+
+        public ISeparatorItem CreateSeparator()
+        {
+            return new SeparatorItemType() { Function = UIItemFunctionType.Separator };
+        }
+
+        public void ExportCustomCommands(string file, string[] cmdNames)
+        {
+            WebLayoutCustomCommandList list = new WebLayoutCustomCommandList();
+
+            List<CommandType> commands = new List<CommandType>();
+
+            foreach (var name in cmdNames)
+            {
+                var cmd = (CommandType)GetCommandByName(name);
+                if (cmd != null)
+                    commands.Add(cmd);
+            }
+
+            list.Commands = commands.ToArray();
+
+            using (var fs = File.OpenWrite(file))
+            {
+                new XmlSerializer(typeof(WebLayoutCustomCommandList)).Serialize(fs, list);
+            }
+        }
+
+        public ImportedCommandResult[] ImportCustomCommands(string file)
+        {
+            List<ImportedCommandResult> clashes = new List<ImportedCommandResult>();
+
+            using (var fs = File.OpenRead(file))
+            {
+                var list = (WebLayoutCustomCommandList)(new XmlSerializer(typeof(WebLayoutCustomCommandList)).Deserialize(fs));
+                foreach (var importCmd in list.Commands)
+                {
+                    int counter = 0;
+                    string oldName = importCmd.Name;
+                    string newName = oldName;
+
+                    ICommand cmd = this.GetCommandByName(newName);
+                    while (cmd != null)
+                    {
+                        counter++;
+                        newName = oldName + counter;
+                        cmd = this.GetCommandByName(newName);
+                    }
+
+                    this.commandSetField.Add(importCmd);
+
+                    clashes.Add(new ImportedCommandResult() { OriginalName = oldName, ImportedName = newName });
+                }
+            }
+
+            return clashes.ToArray();
+        }
+
+        [XmlIgnore]
+        ICommandSet IWebLayout.CommandSet
+        {
+            get { return this; }
+        }
+
+        void ICommandSet.Clear()
+        {
+            this.CommandSet.Clear();
+        }
+
+        [XmlIgnore]
+        int ICommandSet.CommandCount
+        {
+            get { return this.CommandSet.Count; }
+        }
+
+        [XmlIgnore]
+        IEnumerable<ICommand> ICommandSet.Commands
+        {
+            get
+            {
+                foreach (var cmd in this.CommandSet)
+                {
+                    yield return cmd;
+                }
+            }
+        }
+
+        public event CommandEventHandler CustomCommandAdded;
+
+        public event CommandEventHandler CustomCommandRemoved;
+
+        void ICommandSet.AddCommand(ICommand cmd)
+        {
+            var c = cmd as CommandType;
+            if (c != null)
+            {
+                this.CommandSet.Add(c);
+                OnPropertyChanged("CommandSet"); //NOXLATE
+                if (cmd is IInvokeUrlCommand || cmd is IInvokeScriptCommand || cmd is ISearchCommand)
+                {
+                    var handler = this.CustomCommandAdded;
+                    if (handler != null)
+                        handler(cmd);
+                }
+            }
+        }
+
+        void ICommandSet.RemoveCommand(ICommand cmd)
+        {
+            var c = cmd as CommandType;
+            if (c != null)
+            {
+                this.CommandSet.Remove(c);
+                OnPropertyChanged("CommandSet"); //NOXLATE
+                if (cmd is IInvokeUrlCommand || cmd is IInvokeScriptCommand || cmd is ISearchCommand)
+                {
+                    var handler = this.CustomCommandRemoved;
+                    if (handler != null)
+                        handler(cmd);
+                }
+            }
+        }
+
+        [XmlIgnore]
+        string IWebLayout.Title
+        {
+            get
+            {
+                return this.Title;
+            }
+            set
+            {
+                this.Title = value;
+            }
+        }
+
+        [XmlIgnore]
+        IMap IWebLayout.Map
+        {
+            get { return this.Map; }
+        }
+
+        [XmlIgnore]
+        ITaskPane IWebLayout.TaskPane
+        {
+            get { return this.TaskPane; }
+        }
+
+        [XmlIgnore]
+        IToolbar IWebLayout.ToolBar
+        {
+            get { return this.ToolBar; }
+        }
+
+        [XmlIgnore]
+        IInformationPane IWebLayout.InformationPane
+        {
+            get { return this.InformationPane; }
+        }
+
+        [XmlIgnore]
+        IContextMenu IWebLayout.ContextMenu
+        {
+            get { return this.ContextMenu; }
+        }
+
+        [XmlIgnore]
+        IStatusBar IWebLayout.StatusBar
+        {
+            get { return this.StatusBar; }
+        }
+
+        [XmlIgnore]
+        IZoomControl IWebLayout.ZoomControl
+        {
+            get { return this.ZoomControl; }
+        }
+    }
+
+    partial class TaskPaneType : ITaskPane
+    {
+        [XmlIgnore]
+        ITaskBar ITaskPane.TaskBar
+        {
+            get
+            {
+                return this.TaskBar;
+            }
+        }
+    }
+
+    partial class MapType : IMap
+    {
+        [XmlIgnore]
+        IMapView IMap.InitialView
+        {
+            get
+            {
+                return this.InitialView;
+            }
+            set
+            {
+                this.InitialView = (MapViewType)value;
+            }
+        }
+    }
+
+    partial class MapViewType : IMapView
+    {
+    }
+
+    partial class ToolBarType : IToolbar
+    {
+        [XmlIgnore]
+        public int ItemCount
+        {
+            get { return this.Button.Count; }
+        }
+
+        [XmlIgnore]
+        public IEnumerable<IUIItem> Items
+        {
+            get
+            {
+                foreach (var item in this.Button)
+                {
+                    yield return item;
+                }
+            }
+        }
+
+        public void AddItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.Button.Add(it);
+                it.Parent = this;
+                OnPropertyChanged("Button"); //NOXLATE
+            }
+        }
+
+        public void RemoveItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.Button.Remove(it);
+                it.Parent = null;
+                OnPropertyChanged("Button"); //NOXLATE
+            }
+        }
+
+        public bool MoveUp(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.Button.IndexOf(it);
+                if (isrc > 0)
+                {
+                    var idst = isrc - 1;
+                    var src = this.Button[isrc];
+                    var dst = this.Button[idst];
+
+                    this.Button[isrc] = dst;
+                    this.Button[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
+        public bool MoveDown(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.Button.IndexOf(it);
+                if (isrc < this.Button.Count - 1)
+                {
+                    var idst = isrc + 1;
+                    var src = this.Button[isrc];
+                    var dst = this.Button[idst];
+
+                    this.Button[isrc] = dst;
+                    this.Button[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public int GetIndex(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                return this.Button.IndexOf(it);
+            }
+            return -1;
+        }
+
+        public void Insert(IUIItem item, int index)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                it.Parent = this;
+                this.Button.Insert(index, it);
+            }
+        }
+    }
+
+    partial class InformationPaneType : IInformationPane
+    {
+    }
+
+    partial class ContextMenuType : IContextMenu
+    {
+        [XmlIgnore]
+        public int ItemCount
+        {
+            get { return this.MenuItem.Count; }
+        }
+
+        [XmlIgnore]
+        public IEnumerable<IUIItem> Items
+        {
+            get
+            {
+                foreach (var item in this.MenuItem)
+                {
+                    yield return item;
+                }
+            }
+        }
+
+        public void AddItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.MenuItem.Add(it);
+                it.Parent = this;
+                OnPropertyChanged("MenuItem"); //NOXLATE
+            }
+        }
+
+        public void RemoveItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.MenuItem.Remove(it);
+                it.Parent = null;
+                OnPropertyChanged("MenuItem"); //NOXLATE
+            }
+        }
+
+        public bool MoveUp(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.MenuItem.IndexOf(it);
+                if (isrc > 0)
+                {
+                    var idst = isrc - 1;
+                    var src = this.MenuItem[isrc];
+                    var dst = this.MenuItem[idst];
+
+                    this.MenuItem[isrc] = dst;
+                    this.MenuItem[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public bool MoveDown(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.MenuItem.IndexOf(it);
+                if (isrc < this.MenuItem.Count - 1)
+                {
+                    var idst = isrc + 1;
+                    var src = this.MenuItem[isrc];
+                    var dst = this.MenuItem[idst];
+
+                    this.MenuItem[isrc] = dst;
+                    this.MenuItem[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public int GetIndex(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                return this.MenuItem.IndexOf(it);
+            }
+            return -1;
+        }
+
+        public void Insert(IUIItem item, int index)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                it.Parent = this;
+                this.MenuItem.Insert(index, it);
+            }
+        }
+    }
+
+    partial class TaskBarType : ITaskBar
+    {
+        [XmlIgnore]
+        public int ItemCount
+        {
+            get { return this.MenuButton.Count; }
+        }
+
+        [XmlIgnore]
+        public IEnumerable<IUIItem> Items
+        {
+            get
+            {
+                foreach (var item in this.MenuButton)
+                {
+                    yield return item;
+                }
+            }
+        }
+
+        public void AddItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.MenuButton.Add(it);
+                it.Parent = this;
+                OnPropertyChanged("MenuButton"); //NOXLATE
+            }
+        }
+
+        public void RemoveItem(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                this.MenuButton.Remove(it);
+                it.Parent = null;
+                OnPropertyChanged("MenuButton"); //NOXLATE
+            }
+        }
+
+        public bool MoveUp(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.MenuButton.IndexOf(it);
+                if (isrc > 0)
+                {
+                    var idst = isrc - 1;
+                    var src = this.MenuButton[isrc];
+                    var dst = this.MenuButton[idst];
+
+                    this.MenuButton[isrc] = dst;
+                    this.MenuButton[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public bool MoveDown(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.MenuButton.IndexOf(it);
+                if (isrc < this.MenuButton.Count - 1)
+                {
+                    var idst = isrc + 1;
+                    var src = this.MenuButton[isrc];
+                    var dst = this.MenuButton[idst];
+
+                    this.MenuButton[isrc] = dst;
+                    this.MenuButton[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public int GetIndex(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                return this.MenuButton.IndexOf(it);
+            }
+            return -1;
+        }
+
+        public void Insert(IUIItem item, int index)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                it.Parent = this;
+                this.MenuButton.Insert(index, it);
+            }
+        }
+
+        [XmlIgnore]
+        ITaskButton ITaskBar.Home
+        {
+            get { return this.Home; }
+        }
+
+        [XmlIgnore]
+        ITaskButton ITaskBar.Forward
+        {
+            get { return this.Forward; }
+        }
+
+        [XmlIgnore]
+        ITaskButton ITaskBar.Back
+        {
+            get { return this.Back; }
+        }
+
+        [XmlIgnore]
+        ITaskButton ITaskBar.Tasks
+        {
+            get { return this.Tasks; }
+        }
+    }
+
+    partial class TaskButtonType : ITaskButton
+    {
+    }
+
+    partial class StatusBarType : IStatusBar
+    {
+    }
+
+    partial class ZoomControlType : IZoomControl
+    {
+    }
+
+    partial class CommandType : ICommand
+    {
+    }
+
+    partial class ResourceReferenceType : IResourceReference
+    {
+    }
+
+    partial class PrintCommandType : IPrintCommand
+    {
+        public void Clear()
+        {
+            this.PrintLayout.Clear();
+        }
+
+        [XmlIgnore]
+        IEnumerable<IResourceReference> IPrintCommand.PrintLayout
+        {
+            get
+            {
+                foreach (var refer in this.PrintLayout)
+                {
+                    yield return refer;
+                }
+            }
+        }
+
+        public IResourceReference CreatePrintLayout(string resourceId)
+        {
+            return new ResourceReferenceType() { ResourceId = resourceId };
+        }
+
+        public void AddPrintLayout(IResourceReference reference)
+        {
+            var r = reference as ResourceReferenceType;
+            if (r != null)
+            {
+                this.PrintLayout.Add(r);
+                OnPropertyChanged("PrintLayout"); //NOXLATE
+            }
+        }
+
+        public void RemovePrintLayout(IResourceReference reference)
+        {
+            var r = reference as ResourceReferenceType;
+            if (r != null)
+            {
+                this.PrintLayout.Remove(r);
+                OnPropertyChanged("PrintLayout"); //NOXLATE
+            }
+        }
+    }
+
+    partial class SeparatorItemType : ISeparatorItem
+    {
+    }
+
+    partial class BasicCommandType : IBasicCommand
+    {
+    }
+
+    partial class TargetedCommandType : ITargetedCommand
+    {
+    }
+
+    partial class FlyoutItemType : IFlyoutItem
+    {
+        [XmlIgnore]
+        public int ItemCount
+        {
+            get { return this.SubItem.Count; }
+        }
+
+        [XmlIgnore]
+        public IEnumerable<IUIItem> Items
+        {
+            get
+            {
+                foreach (var item in this.SubItem)
+                {
+                    yield return item;
+                }
+            }
+        }
+
+        public void AddItem(IUIItem item)
+        {
+            var i = item as UIItemType;
+            if (i != null)
+            {
+                this.SubItem.Add(i);
+                i.Parent = this;
+                OnPropertyChanged("SubItem"); //NOXLATE
+            }
+        }
+
+        public void RemoveItem(IUIItem item)
+        {
+            var i = item as UIItemType;
+            if (i != null)
+            {
+                this.SubItem.Remove(i);
+                i.Parent = null;
+                OnPropertyChanged("SubItem"); //NOXLATE
+            };
+        }
+
+        public bool MoveUp(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.SubItem.IndexOf(it);
+                if (isrc > 0)
+                {
+                    var idst = isrc - 1;
+                    var src = this.SubItem[isrc];
+                    var dst = this.SubItem[idst];
+
+                    this.SubItem[isrc] = dst;
+                    this.SubItem[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public bool MoveDown(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                var isrc = this.SubItem.IndexOf(it);
+                if (isrc < this.SubItem.Count - 1)
+                {
+                    var idst = isrc + 1;
+                    var src = this.SubItem[isrc];
+                    var dst = this.SubItem[idst];
+
+                    this.SubItem[isrc] = dst;
+                    this.SubItem[idst] = src;
+
+                    OnPropertyChanged("Button"); //NOXLATE
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public int GetIndex(IUIItem item)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                return this.SubItem.IndexOf(it);
+            }
+            return -1;
+        }
+
+        public void Insert(IUIItem item, int index)
+        {
+            var it = item as UIItemType;
+            if (it != null)
+            {
+                it.Parent = this;
+                this.SubItem.Insert(index, it);
+            }
+        }
+    }
+
+    partial class UIItemType : IUIItem
+    {
+        [XmlIgnore]
+        public IMenu Parent
+        {
+            get;
+            set;
+        }
+    }
+
+    partial class CommandItemType : ICommandItem
+    {
+    }
+
+    partial class InvokeURLCommandType : IInvokeUrlCommand, ILayerSet
+    {
+        [XmlIgnore]
+        ILayerSet IInvokeUrlCommand.LayerSet
+        {
+            get
+            {
+                return this;
+            }
+        }
+
+        [XmlIgnore]
+        IEnumerable<IParameterPair> IInvokeUrlCommand.AdditionalParameter
+        {
+            get
+            {
+                foreach (var pair in this.AdditionalParameter)
+                {
+                    yield return pair;
+                }
+            }
+        }
+
+        public IParameterPair CreateParameter(string name, string value)
+        {
+            return new ParameterPairType() { Key = name, Value = value };
+        }
+
+        public void AddParameter(IParameterPair param)
+        {
+            var p = param as ParameterPairType;
+            if (p != null)
+            {
+                this.AdditionalParameter.Add(p);
+                OnPropertyChanged("AdditionalParameter"); //NOXLATE
+            }
+        }
+
+        public void RemoveParameter(IParameterPair param)
+        {
+            var p = param as ParameterPairType;
+            if (p != null)
+            {
+                this.AdditionalParameter.Remove(p);
+                OnPropertyChanged("AdditionalParameter"); //NOXLATE
+            }
+        }
+
+        [XmlIgnore]
+        public BindingList<string> Layer
+        {
+            get
+            {
+                return this.LayerSet;
+            }
+        }
+    }
+
+    partial class ParameterPairType : IParameterPair
+    {
+    }
+
+    partial class SearchCommandType : ISearchCommand, IResultColumnSet
+    {
+        IResultColumn IResultColumnSet.CreateColumn(string name, string property)
+        {
+            return new ResultColumnType() { Name = name, Property = property };
+        }
+
+        [XmlIgnore]
+        IResultColumnSet ISearchCommand.ResultColumns
+        {
+            get
+            {
+                return this;
+            }
+        }
+
+        [XmlIgnore]
+        int ISearchCommand.MatchLimit
+        {
+            get
+            {
+                int i;
+                if (!int.TryParse(this.MatchLimit, out i))
+                {
+                    i = 100;
+                    this.MatchLimit = i.ToString();
+                }
+                return i;
+            }
+            set
+            {
+                this.MatchLimit = value.ToString();
+            }
+        }
+
+        public void Clear()
+        {
+            this.ResultColumns.Clear();
+        }
+
+        [XmlIgnore]
+        public IEnumerable<IResultColumn> Column
+        {
+            get
+            {
+                foreach (var col in this.ResultColumns)
+                {
+                    yield return col;
+                }
+            }
+        }
+
+        public void AddResultColumn(IResultColumn col)
+        {
+            var c = col as ResultColumnType;
+            if (c != null)
+            {
+                this.ResultColumns.Add(c);
+                OnPropertyChanged("ResultColumns"); //NOXLATE
+            }
+        }
+
+        public void RemoveResultColumn(IResultColumn col)
+        {
+            var c = col as ResultColumnType;
+            if (c != null)
+            {
+                this.ResultColumns.Remove(c);
+                OnPropertyChanged("ResultColumns"); //NOXLATE
+            }
+        }
+    }
+
+    partial class ResultColumnType : IResultColumn
+    {
+    }
+
+    partial class InvokeScriptCommandType : IInvokeScriptCommand
+    {
+    }
+}
\ No newline at end of file



More information about the mapguide-commits mailing list