diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Designer/DataFormats/Designer/DesignerXMLDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.Designer/DataFormats/Designer/DesignerXMLDataFormat.cs new file mode 100644 index 00000000..4d3b8f7b --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.Designer/DataFormats/Designer/DesignerXMLDataFormat.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using UniversalEditor.ObjectModels.Markup; +using UniversalEditor.DataFormats.Markup.XML; + +namespace UniversalEditor.DataFormats.Designer +{ + public class DesignerXMLDataFormat : XMLDataFormat + { + protected override void BeforeLoadInternal(Stack objectModels) + { + base.BeforeLoadInternal(objectModels); + objectModels.Push(new MarkupObjectModel()); + } + protected override void AfterLoadInternal(Stack objectModels) + { + base.AfterLoadInternal(objectModels); + + MarkupObjectModel mom = (objectModels.Pop() as MarkupObjectModel); + DesignerObjectModel dsn = (objectModels.Pop() as DesignerObjectModel); + } + + protected override void BeforeSaveInternal(Stack objectModels) + { + base.BeforeSaveInternal(objectModels); + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Component.cs b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Component.cs new file mode 100644 index 00000000..87185713 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Component.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Designer +{ + public class Component + { + public class ComponentCollection + : System.Collections.ObjectModel.Collection + { + + } + + private Guid mvarID = Guid.Empty; + public Guid ID { get { return mvarID; } set { mvarID = value; } } + + private string mvarTitle = String.Empty; + public string Title { get { return mvarTitle; } set { mvarTitle = value; } } + + private Property.PropertyCollection mvarProperties = new Property.PropertyCollection(); + public Property.PropertyCollection Properties { get { return mvarProperties; } } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/ComponentInstance.cs b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/ComponentInstance.cs new file mode 100644 index 00000000..28b43734 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/ComponentInstance.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Designer +{ + public class ComponentInstance + { + public class ComponentInstanceCollection + : System.Collections.ObjectModel.Collection + { + + } + + private Guid mvarID = Guid.Empty; + public Guid ID { get { return mvarID; } set { mvarID = value; } } + + private Component mvarComponent = null; + public Component Component { get { return mvarComponent; } set { mvarComponent = value; } } + + private ConnectionValue.ConnectionValueCollection mvarConnectionValues = new ConnectionValue.ConnectionValueCollection(); + public ConnectionValue.ConnectionValueCollection ConnectionValues { get { return mvarConnectionValues; } } + + private PropertyValue.PropertyValueCollection mvarPropertyValues = new PropertyValue.PropertyValueCollection(); + public PropertyValue.PropertyValueCollection PropertyValues { get { return mvarPropertyValues; } } + + private Measurement mvarX = new Measurement(0, MeasurementUnit.Pixel); + /// + /// The distance between the left edge of the design and the left edge of the component. + /// + public Measurement X { get { return mvarX; } set { mvarX = value; } } + + private Measurement mvarY = new Measurement(0, MeasurementUnit.Pixel); + /// + /// The distance between the top edge of the design and the top edge of the component. + /// + public Measurement Y { get { return mvarY; } set { mvarY = value; } } + + private Measurement mvarZ = new Measurement(0, MeasurementUnit.Pixel); + /// + /// The distance between the left edge of the design and the left edge of the component. + /// + public Measurement Z { get { return mvarZ; } set { mvarZ = value; } } + + private Measurement mvarWidth = new Measurement(0, MeasurementUnit.Pixel); + /// + /// The width of the component. + /// + public Measurement Width { get { return mvarWidth; } set { mvarWidth = value; } } + + private Measurement mvarHeight = new Measurement(0, MeasurementUnit.Pixel); + /// + /// The height of the component. + /// + public Measurement Height { get { return mvarHeight; } set { mvarHeight = value; } } + + private Measurement mvarDepth = new Measurement(0, MeasurementUnit.Pixel); + /// + /// The depth of the component. + /// + public Measurement Depth { get { return mvarDepth; } set { mvarDepth = value; } } + + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Connection.cs b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Connection.cs new file mode 100644 index 00000000..a3067b96 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Connection.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Designer +{ + public class Connection + { + public class ConnectionCollection + : System.Collections.ObjectModel.Collection + { + + } + + private Guid mvarID = Guid.Empty; + public Guid ID { get { return mvarID; } set { mvarID = value; } } + + private string mvarTitle = String.Empty; + public string Title { get { return mvarTitle; } set { mvarTitle = value; } } + + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/ConnectionValue.cs b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/ConnectionValue.cs new file mode 100644 index 00000000..f7da7193 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/ConnectionValue.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Designer +{ + public class ConnectionValue + { + public class ConnectionValueCollection + : System.Collections.ObjectModel.Collection + { + } + + private Connection mvarSourceConnection = null; + public Connection SourceConnection { get { return mvarSourceConnection; } set { mvarSourceConnection = value; } } + + private Connection mvarDestinationConnection = null; + public Connection DestinationConnection { get { return mvarDestinationConnection; } set { mvarDestinationConnection = value; } } + + public ConnectionValue(Connection source, Connection destination) + { + mvarSourceConnection = source; + mvarDestinationConnection = destination; + } + + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Design.cs b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Design.cs new file mode 100644 index 00000000..c08bf91d --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Design.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Designer +{ + public class Design + { + public class DesignCollection + : System.Collections.ObjectModel.Collection + { + + } + + private ComponentInstance.ComponentInstanceCollection mvarComponentInstances = new ComponentInstance.ComponentInstanceCollection(); + public ComponentInstance.ComponentInstanceCollection ComponentInstances { get { return mvarComponentInstances; } } + + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/DesignerObjectModel.cs b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/DesignerObjectModel.cs new file mode 100644 index 00000000..1acbaab5 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/DesignerObjectModel.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Designer +{ + public class DesignerObjectModel : ObjectModel + { + + public override void Clear() + { + throw new NotImplementedException(); + } + + public override void CopyTo(ObjectModel where) + { + throw new NotImplementedException(); + } + + private static ObjectModelReference _omr = null; + public override ObjectModelReference MakeReference() + { + if (_omr == null) + { + _omr = base.MakeReference(); + _omr.Title = "Designer"; + } + return _omr; + } + + private Design.DesignCollection mvarDesigns = new Design.DesignCollection(); + public Design.DesignCollection Designs { get { return mvarDesigns; } } + + private Library.LibraryCollection mvarLibraries = new Library.LibraryCollection(); + public Library.LibraryCollection Libraries { get { return mvarLibraries; } } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Library.cs b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Library.cs new file mode 100644 index 00000000..f5042568 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Library.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Designer +{ + public class Library + { + public class LibraryCollection + : System.Collections.ObjectModel.Collection + { + + } + + private Guid mvarID = Guid.Empty; + public Guid ID { get { return mvarID; } set { mvarID = value; } } + + private string mvarTitle = String.Empty; + public string Title { get { return mvarTitle; } set { mvarTitle = value; } } + + private Component.ComponentCollection mvarComponents = new Component.ComponentCollection(); + public Component.ComponentCollection Components { get { return mvarComponents; } set { mvarComponents = value; } } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Measurement.cs b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Measurement.cs new file mode 100644 index 00000000..b23f5882 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Measurement.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Designer +{ + public enum MeasurementUnit + { + Percentage, + Pixel, + Unknown + } + public struct Measurement + { + private MeasurementUnit mvarUnit; + public MeasurementUnit Unit { get { return mvarUnit; } } + + private double mvarValue; + public double Value { get { return mvarValue; } set { mvarValue = value; } } + + private bool mvarIsNotEmpty; + public bool IsEmpty { get { return !mvarIsNotEmpty; } } + + public Measurement(string value) + { + if (value.EndsWith("px")) + { + string v = value.Substring(0, value.Length - 2); + mvarValue = double.Parse(v); + mvarUnit = MeasurementUnit.Pixel; + } + else if (value.EndsWith("%")) + { + string v = value.Substring(0, value.Length - 1); + mvarValue = double.Parse(v); + mvarUnit = MeasurementUnit.Percentage; + } + throw new FormatException("The string could not be parsed as a valid Measurement."); + } + public Measurement(double value) + { + mvarIsNotEmpty = true; + mvarValue = value; + mvarUnit = MeasurementUnit.Pixel; + } + public Measurement(double value, MeasurementUnit unit) + { + mvarIsNotEmpty = true; + mvarValue = value; + mvarUnit = unit; + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Property.cs b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Property.cs new file mode 100644 index 00000000..15fbba8f --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/Property.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Designer +{ + public class Property + { + public class PropertyCollection + : System.Collections.ObjectModel.Collection + { + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/PropertyValue.cs b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/PropertyValue.cs new file mode 100644 index 00000000..7f375333 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.Designer/ObjectModels/Designer/PropertyValue.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UniversalEditor.ObjectModels.Designer +{ + public class PropertyValue + { + public class PropertyValueCollection + : System.Collections.ObjectModel.Collection + { + + } + + private Property mvarProperty = null; + public Property Property { get { return mvarProperty; } set { mvarProperty = value; } } + + private bool mvarIsSet = false; + public bool IsSet { get { return mvarIsSet; } set { mvarIsSet = value; } } + + private object mvarValue = null; + public object Value { get { return mvarValue; } set { mvarValue = value; } } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Designer/Properties/AssemblyInfo.cs b/CSharp/Plugins/UniversalEditor.Plugins.Designer/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..10919dde --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.Designer/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("UniversalEditor.Plugins.Designer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("City of Orlando")] +[assembly: AssemblyProduct("UniversalEditor.Plugins.Designer")] +[assembly: AssemblyCopyright("Copyright © City of Orlando 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("e641ae35-1fc1-49e5-a7d2-f489d903a8a8")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Designer/UniversalEditor.Plugins.Designer.csproj b/CSharp/Plugins/UniversalEditor.Plugins.Designer/UniversalEditor.Plugins.Designer.csproj new file mode 100644 index 00000000..34b7b969 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Plugins.Designer/UniversalEditor.Plugins.Designer.csproj @@ -0,0 +1,47 @@ + + + + + Debug + AnyCPU + {899E3DD6-EA65-4168-AAE3-867A4F9650A6} + Library + Properties + UniversalEditor + UniversalEditor.Plugins.Designer + v3.5 + 512 + + + true + full + false + ..\..\Output\Debug\Plugins\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\Output\Release\Plugins\ + TRACE + prompt + 4 + + + + + + + + + + + \ No newline at end of file