diff --git a/PROMS/VEPROMS User Interface/Properties/Resources.Designer.cs b/PROMS/VEPROMS User Interface/Properties/Resources.Designer.cs index bb9f057f..3038e973 100644 --- a/PROMS/VEPROMS User Interface/Properties/Resources.Designer.cs +++ b/PROMS/VEPROMS User Interface/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4216 +// Runtime Version:4.0.30319.34209 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -19,7 +19,7 @@ namespace VEPROMS.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -60,6 +60,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap Admin { get { object obj = ResourceManager.GetObject("Admin", resourceCulture); @@ -67,6 +70,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap EnvelopeHS { get { object obj = ResourceManager.GetObject("EnvelopeHS", resourceCulture); @@ -74,6 +80,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap GoToParentFolderHS { get { object obj = ResourceManager.GetObject("GoToParentFolderHS", resourceCulture); @@ -81,6 +90,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap GotoShortcutsHS { get { object obj = ResourceManager.GetObject("GotoShortcutsHS", resourceCulture); @@ -88,6 +100,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap GotoTrans { get { object obj = ResourceManager.GetObject("GotoTrans", resourceCulture); @@ -95,6 +110,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap Help_Image { get { object obj = ResourceManager.GetObject("Help_Image", resourceCulture); @@ -102,6 +120,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap HelpAbout_Image { get { object obj = ResourceManager.GetObject("HelpAbout_Image", resourceCulture); @@ -109,6 +130,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap HelpDoc_Image { get { object obj = ResourceManager.GetObject("HelpDoc_Image", resourceCulture); @@ -116,6 +140,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap InsertAfter { get { object obj = ResourceManager.GetObject("InsertAfter", resourceCulture); @@ -123,6 +150,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap ProtectFormHS { get { object obj = ResourceManager.GetObject("ProtectFormHS", resourceCulture); @@ -130,6 +160,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap ProtectFormHS1 { get { object obj = ResourceManager.GetObject("ProtectFormHS1", resourceCulture); @@ -137,6 +170,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap PushpinStick { get { object obj = ResourceManager.GetObject("PushpinStick", resourceCulture); @@ -144,6 +180,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap PushpinUnStick { get { object obj = ResourceManager.GetObject("PushpinUnStick", resourceCulture); @@ -151,6 +190,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap Red_V_txt_NB_bur_1984 { get { object obj = ResourceManager.GetObject("Red_V_txt_NB_bur_1984", resourceCulture); @@ -158,6 +200,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap RenameFolderHS { get { object obj = ResourceManager.GetObject("RenameFolderHS", resourceCulture); @@ -165,6 +210,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap Save { get { object obj = ResourceManager.GetObject("Save", resourceCulture); @@ -172,6 +220,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap SaveAllHS { get { object obj = ResourceManager.GetObject("SaveAllHS", resourceCulture); @@ -179,6 +230,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap SaveAs { get { object obj = ResourceManager.GetObject("SaveAs", resourceCulture); @@ -186,6 +240,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap Separator { get { object obj = ResourceManager.GetObject("Separator", resourceCulture); @@ -193,6 +250,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap UnProtectFormHS { get { object obj = ResourceManager.GetObject("UnProtectFormHS", resourceCulture); @@ -200,6 +260,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// internal static System.Drawing.Icon veproms { get { object obj = ResourceManager.GetObject("veproms", resourceCulture); @@ -207,6 +270,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap ViewThumbnailsHS { get { object obj = ResourceManager.GetObject("ViewThumbnailsHS", resourceCulture); @@ -214,6 +280,9 @@ namespace VEPROMS.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap VolianWeb_Image { get { object obj = ResourceManager.GetObject("VolianWeb_Image", resourceCulture); diff --git a/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs b/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs index 6a594e91..4c5a906f 100644 --- a/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs +++ b/PROMS/VEPROMS User Interface/Properties/Settings.Designer.cs @@ -398,5 +398,17 @@ namespace VEPROMS.Properties { this["VisioPath"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int UCFImportOpt { + get { + return ((int)(this["UCFImportOpt"])); + } + set { + this["UCFImportOpt"] = value; + } + } } } diff --git a/PROMS/VEPROMS User Interface/Properties/Settings.settings b/PROMS/VEPROMS User Interface/Properties/Settings.settings index 7095609a..0aa63f53 100644 --- a/PROMS/VEPROMS User Interface/Properties/Settings.settings +++ b/PROMS/VEPROMS User Interface/Properties/Settings.settings @@ -98,5 +98,8 @@ + + 0 + \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/UCFDetails.xsl b/PROMS/VEPROMS User Interface/UCFDetails.xsl new file mode 100644 index 00000000..8c2c3785 --- /dev/null +++ b/PROMS/VEPROMS User Interface/UCFDetails.xsl @@ -0,0 +1,190 @@ + + + + + + + + + + +

User Control of Format Details

+

-

+ + + + + + + + + +
+ + + + + + + + + + + + + + +
FlagValue
+

+ + + + + + + + + + + + + + + +
Check Off HeadingActive
+ + + +
+

+ + + + + + + + + + + + + + +
Check Off TypeActive
+

+ + + + + + + + + + + +
Check Off X Offset Adjust (Inches)
+ +
+

+ + + + + + + + + + + + + + + + + + +
Replace WordReplace WithStateFlag
+ + + Add + + + Modify + + + Delete + +
+

+ + + + + + + + + + + + + + + + +
Step TypeFont
+

+ + + + + + + + + + + + + + + + +
Document StylePage LengthLeft Margin
+
+ + \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/UCFSummary.xsl b/PROMS/VEPROMS User Interface/UCFSummary.xsl new file mode 100644 index 00000000..c390b319 --- /dev/null +++ b/PROMS/VEPROMS User Interface/UCFSummary.xsl @@ -0,0 +1,16 @@ + + + + + + + + + , + + + + + + \ No newline at end of file diff --git a/PROMS/VEPROMS.CSLA.Library/Config/DynamicProperties.cs b/PROMS/VEPROMS.CSLA.Library/Config/DynamicProperties.cs index 8d99b1ef..61bc8b2c 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/DynamicProperties.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/DynamicProperties.cs @@ -2,6 +2,9 @@ using System; using System.Collections.Generic; using System.Text; using System.ComponentModel; +using System.Xml; +using System.Xml.Serialization; +using System.Xml.Schema; namespace VEPROMS.CSLA.Library { @@ -44,7 +47,10 @@ namespace VEPROMS.CSLA.Library if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(info)); } + [NonSerialized] private bool _IsDirty = false; + [XmlIgnore] + [Browsable(false)] public bool IsDirty { get { return _IsDirty; } diff --git a/PROMS/VEPROMS.CSLA.Library/Config/FormatConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/FormatConfig.cs new file mode 100644 index 00000000..c17b1f9e --- /dev/null +++ b/PROMS/VEPROMS.CSLA.Library/Config/FormatConfig.cs @@ -0,0 +1,785 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; +using System.ComponentModel; +using DescriptiveEnum; +using System.Xml; +using System.Xml.Serialization; +using System.Xml.Schema; +using System.Windows.Forms; +using Volian.Base.Library; +using System.Drawing; + +namespace VEPROMS.CSLA.Library +{ + #region FormatConfig + // FormatConfig is the data structure that holds the UCF (User Control Of Format) data. It is stored in the database as xml in the + // Formats table's Config field. This uses Xml Serialization to translate the data from these data structures back/forth from the + // xml stored in the database. Note that fields that the user can change have an associate 'Orig' field which contains the original + // data from the format this is derived from. This is used for the 'Reset' to the original value. + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + public class FormatConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged + { + #region DynamicTypeDescriptor + internal override bool IsReadOnly + { + get { return false; } + } + #endregion + #region XML + private XMLProperties _Xp; + private XMLProperties Xp + { + get { return _Xp; } + } + #endregion + #region Attributes + [XmlAttribute("Name")] + private string _Name; + [Category(" Identification")] + [DisplayName(" Name")] + [Description("Names user control of format")] + [XmlIgnore] // ignore it when doing serialization + public string Name + { + get { return _Name; } + set { _Name = value; } + } + [XmlAttribute("Description")] + private string _Description; + [Category(" Identification")] + [Description("Describes user control of format")] + [XmlIgnore] // ignore it when doing serialization + public string Description + { + get { return _Description; } + set { _Description = value; } + } + #endregion Attributes + #region Elements + private PlantFormatx _PlantFormat; + [DisplayName("Plant Format")] + [Description("Format values and settings that be modified for the selected format")] + public PlantFormatx PlantFormat + { + get { return _PlantFormat; } + set { _PlantFormat = value; } + } + #endregion Elements + #region Constructors + private Format _Format; + private FormatInfo _FormatInfo; + public FormatConfig(string xml) + { + if (xml == string.Empty) xml = ""; + } + public FormatConfig(FormatInfo fi) + { + _FormatInfo = fi; + } + public FormatConfig(Format f) + { + _Format = f; + } + public FormatConfig() + { + PlantFormat = new PlantFormatx(); + } + #endregion Constructors + #region Serialize + public string ConvertToString() + { + return GenericSerializer.StringSerialize(this); + } + public static FormatConfig Get(string xml) + { + return GenericSerializer.StringDeserialize(xml); + } + public override string ToString() + { + return "PlantFormat"; + } + #endregion + #endregion FormatConfig + #region PlantFormat + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + [Category("Data")] + public class PlantFormatx + { + [XmlElement] + private FormatData _FormatData = new FormatData(); + [DisplayName("Step Settings")] + [Description("Values used when formatting of steps (edit and print)")] + public FormatData FormatData + { + get { return _FormatData; } + set { _FormatData = value; } + } + [XmlElement] + private DocStyles _DocStyles; + [DisplayName("Section Type Settings")] + [Description("Values used when printing sections")] + public DocStyles DocStyles + { + get { return _DocStyles; } + set { _DocStyles = value; } + } + public PlantFormatx() + { + + } + public override string ToString() + { + return "Plant Format"; + } + } + #endregion PlantFormat + #region FormatData + // FormatData maps to the PlantFormat/Format data and contains properties & data objects that are implemented for the user to + // control of the format. NOTE that any additional format items must be added here or in docstyles. + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + public class FormatData + { + [XmlElement] + private Flags _Flags = new Flags(); + [Description("Various flags that affect editing and printing")] + public Flags Flags + { + get { return _Flags; } + set { _Flags = value; } + } + [XmlElement] + private CheckOffHeaderList _CheckOffHeaderList; + [DisplayName("CheckOff Headers List")] + [Description("CheckOff Headers Usage")] + public CheckOffHeaderList CheckOffHeaderList + { + get { return _CheckOffHeaderList; } + set { _CheckOffHeaderList = value; } + } + [XmlElement] + private CheckOffList _CheckOffList; + [DisplayName("CheckOff List")] + [Description("CheckOff Usage")] + public CheckOffList CheckOffList + { + get { return _CheckOffList; } + set { _CheckOffList = value; } + } + [XmlElement] + private float? _CheckOffXOffAdj; + //[XmlAttribute("CheckOffXOff")] + [DisplayName("CheckOff XOffset Adjust")] + [Description("Check Off X Offset Adjustment (in)")] + public float? CheckOffXOffAdj + { + get { return _CheckOffXOffAdj; } + set { _CheckOffXOffAdj = value; } + } + [XmlElement] + private ReplaceStrData _ReplaceStrData; + [DisplayName("Replace Words List")] + [Description("Replace Words with Other Text and/or attributes")] + public ReplaceStrData ReplaceStrData + { + get { return _ReplaceStrData; } + set { _ReplaceStrData = value; } + } + [XmlElement] + private StepData _StepData; + [DisplayName("Step List")] + [Description("List of step types for which formatting can be set")] + public StepData StepData + { + get { return _StepData; } + set { _StepData = value; } + } + public FormatData() + { + ReplaceStrData = new ReplaceStrData(); + } + public override string ToString() + { + return "Format Data"; + } + } + #endregion FormatData + #region Flags + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + public class Flags + { + private bool? _CheckOffUCF; + [DisplayName("UCF CheckOffs")] + [Description("Additional UCF Check Offs and Sign Offs")] + public bool? CheckOffUCF + { + get { return _CheckOffUCF; } + set { _CheckOffUCF = value; } + } + private bool? _PartialStepCompression; + [DisplayName("Partial Step Compression")] + [Description("Automatically compress last sub-steps to fit on page")] + public bool? PartialStepCompression + { + get { return _PartialStepCompression; } + set { _PartialStepCompression = value; } + } + private bool? _CompressSteps; + [DisplayName("Compress Steps")] + [Description("Automatically compress entire step to fit on page")] + public bool? CompressSteps + { + get { return _CompressSteps; } + set { _CompressSteps = value; } + } + public override string ToString() + { + return " "; + } + } + #endregion Flags + #region ReplaceStrData (list) + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + [Editor(typeof(PropGridCollEditor), typeof(System.Drawing.Design.UITypeEditor))] + public class ReplaceStrData : List + { + [Browsable(false)] + public int Capacity { get { return base.Capacity; } } + [Browsable(false)] + public int Count { get { return base.Count; } } + public ReplaceStr this[int index] + { + get { return (ReplaceStr)base[index]; } + } + public string ConvertToString() + { + return GenericSerializer.StringSerialize(this); + } + public override string ToString() + { + return "Replace Words List Count = " + base.Count.ToString(); + } + public static ReplaceStrData Get(string xml) + { + return GenericSerializer.StringDeserialize(xml); + } + } + #endregion ReplaceStrData + #region ReplaceStr + [Flags] + public enum E_ReplaceFlagsUCF : uint + { + High = 0x0001, // Do ReplaceWords in HIGH LEVEL STEPS + RNO = 0x0002, // Do ReplaceWords in RNOS + Caution = 0x0004, // Do ReplaceWords in CAUTIONS + Note = 0x0008, // Do ReplaceWords in NOTES + Table = 0x0010, // Do ReplaceWords in TABLES + Substep = 0x0020, // Do ReplaceWords in SUBSTEPS + Attach = 0x0040, // Do ReplaceWords in ATTACHMENTS + Bkgd = 0x0080, // Do ReplaceWords in BACKGROUNDS + DiffUnit = 0x0100, // Do ReplaceWords ONLY for different UNIT # + TOC = 0x0200, // Do in auto table-of-contents + StatTree = 0x0400, + HLSSetpnt = 0x0800, // Do ReplaceWords in HighLevelStep SETPoiNTs + Trans = 0x1000, // Do ReplaceWords in TRANSITIONS + Setpoint = 0x2000, // Do ReplaceWords in SETPOINTS + + // Case Sensitivity Flags - default is off (Case Sensitive Replace) + CaseInsens = 0x0000C000, // Do ReplaceWords for all words thatmatch, regardless of case, + // and replace with the ReplaceWith string as is + CaseInsensFirst = 0x4000, // Do ReplaceWords for all words thatexactly match the ReplaceWord, + // except the case of the first character may be different + CaseInsensAll = 0x8000, // Do ReplaceWords for all words that match the ReplaceWord, regardless of case + + Partials = 0x10000, // Do replace even on partial matches + Plackeep = 0x20000, // Do replace in PlaceKeepers + InSecTitle = 0x40000, + BeforeTrans = 0x80000 // Only do replace if the string occurs immediately before a transition. + } + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + public class ReplaceStr + { + private int _State = 0; // 0 = no change, -1 deleted, 1 added, 2 modified + [XmlAttribute("State")] + [Browsable(false)] // Don't show in the property grid + public int State + { + get { return _State; } + set { _State = value; } + } + private E_ReplaceFlagsUCF _Flag; + [Editor(typeof(FlagEnumUIEditor), typeof(System.Drawing.Design.UITypeEditor))] + [XmlAttribute("Flag")] + [DisplayName("Flags (Use In)")] // Note that [Description] is not used in collection items (that use collection editor) + public E_ReplaceFlagsUCF Flag + { + get { return (E_ReplaceFlagsUCF)_Flag; } + set { _Flag = value; } + } + private string _ReplaceWord; + [XmlAttribute("ReplaceWord")] + [DisplayName("Replace Word")] + public string ReplaceWord + { + get { return _ReplaceWord; } + set + { + if (this._ReplaceWith == null) _ReplaceWith = value; + _ReplaceWord = value; + } + } + private string _ReplaceWith; + [Editor(typeof(RtfEditor), typeof(System.Drawing.Design.UITypeEditor))] + + [XmlAttribute("ReplaceWith")] + [DisplayName("With")] + public string ReplaceWith + { + get { return _ReplaceWith; } + set { _ReplaceWith = value; } + } + public ReplaceStr() + { + } + public string ConvertToString() + { + return GenericSerializer.StringSerialize(this); + } + public override string ToString() + { + return ReplaceWord; + } + public static ReplaceStr Get(string xml) + { + return GenericSerializer.StringDeserialize(xml); + } + } + #endregion ReplaceStr + #region CheckOffHeaders (list) + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + [Editor(typeof(PropGridCollEditor), typeof(System.Drawing.Design.UITypeEditor))] + public class CheckOffHeaderList : List + { + [Browsable(false)] + public int Capacity { get { return base.Capacity; } } + [Browsable(false)] + public int Count { get { return base.Count; } } + public CheckOffHeader this[int index] + { + get { return (CheckOffHeader)base[index]; } + } + public string ConvertToString() + { + return GenericSerializer.StringSerialize(this); + } + public override string ToString() + { + return "CheckOffHeader Count = " + base.Count.ToString(); + } + } + #endregion CheckOffHeaders + #region CheckOffHeader + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + public class CheckOffHeader + { + private string _CheckOffHeading; + [XmlAttribute("CheckOffHeading")] + [Browsable(false)] + public string CheckOffHeading + { + get { return _CheckOffHeading; } + set { _CheckOffHeading = value; } + } + private string _Index; + [XmlAttribute("Index")] + [Browsable(false)] // Don't show in the property grid + public string Index + { + get { return _Index; } + set { _Index = value; } + } + + private bool? _Active; + [DisplayName("Active CheckOff Header")] + [Description("Allow use of this CheckOff Header")] + public bool? Active + { + get { return _Active; } + set { _Active = value; } + } + private bool? _OrigActive; + [XmlIgnore] + [Browsable(false)] + public bool? OrigActive + { + get { return _OrigActive; } + set { _OrigActive = value; } + } + public CheckOffHeader() + { + } + public string ConvertToString() + { + return GenericSerializer.StringSerialize(this); + } + public override string ToString() + { + return CheckOffHeading; + } + } + #endregion CheckOffHeader + #region CheckOffs (list) + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + [Editor(typeof(PropGridCollEditor), typeof(System.Drawing.Design.UITypeEditor))] + public class CheckOffList : List + { + [Browsable(false)] + public int Capacity { get { return base.Capacity; } } + [Browsable(false)] + public int Count { get { return base.Count; } } + public CheckOff this[int index] + { + get { return (CheckOff)base[index]; } + } + public string ConvertToString() + { + return GenericSerializer.StringSerialize(this); + } + public override string ToString() + { + return "CheckOff Count = " + base.Count.ToString(); + } + } + #endregion CheckOffs + #region CheckOff + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + public class CheckOff + { + private string _MenuItem; + [XmlAttribute("MenuItem")] + [Browsable(false)] + public string MenuItem + { + get { return _MenuItem; } + set { _MenuItem = value; } + } + private string _Index; + [XmlAttribute("Index")] + [Browsable(false)] // Don't show in the property grid + public string Index + { + get { return _Index; } + set { _Index = value; } + } + + private bool? _Active; + [DisplayName("Active CheckOff")] + [Description("Allow use of this CheckOff")] + public bool? Active + { + get { return _Active; } + set { _Active = value; } + } + private bool? _OrigActive; + [XmlIgnore] + [Browsable(false)] + public bool? OrigActive + { + get { return _OrigActive; } + set { _OrigActive = value; } + } + public CheckOff() + { + } + public string ConvertToString() + { + return GenericSerializer.StringSerialize(this); + } + public override string ToString() + { + return MenuItem; + } + } + #endregion CheckOff + #region StepData (list) + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + [Editor(typeof(PropGridCollEditor), typeof(System.Drawing.Design.UITypeEditor))] + public class StepData : List + { + [Browsable(false)] + public int Capacity { get { return base.Capacity; } } + [Browsable(false)] + public int Count { get { return base.Count; } } + public Step this[int index] + { + get { return (Step)base[index]; } + } + public string ConvertToString() + { + return GenericSerializer.StringSerialize(this); + } + public override string ToString() + { + return "Step Count = " + base.Count.ToString(); + } + public static StepData Get(string xml) + { + return GenericSerializer.StringDeserialize(xml); + } + } + #endregion StepData + #region Step + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + public class Step + { + private string _Index; + [XmlAttribute("Index")] + [Browsable(false)] // Don't show in the property grid + public string Index + { + get { return _Index; } + set { _Index = value; } + } + private string _Type; + [XmlAttribute("Type")] + [Browsable(false)] // Don't show in the property grid + public string Type + { + get { return _Type; } + set { _Type = value; } + } + private FontDesc _FontDesc; + [XmlElement("FontDesc")] + public FontDesc FontDesc + { + get { return _FontDesc; } + set { _FontDesc = value; } + } + public Step() + { + } + public string ConvertToString() + { + return GenericSerializer.StringSerialize(this); + } + public override string ToString() + { + return Type; + } + public static Step Get(string xml) + { + return GenericSerializer.StringDeserialize(xml); + } + } + #endregion Step + #region FontDesc + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + public class FontDesc + { + // The Font object allows the conversion from a windows font back/forth from a string. This is how the + // data is stored in the database, i.e. a string representing the font. + private Font _Font; + [XmlAttribute("Font")] + [Browsable(false)] + public string Font + { + get + { + System.Drawing.FontConverter cvt = new System.Drawing.FontConverter(); + return cvt.ConvertToString(_WindowsFont); + } + set + { + System.Drawing.FontConverter cvt = new System.Drawing.FontConverter(); + _WindowsFont = cvt.ConvertFromString(value ?? "Arial, 10pt") as System.Drawing.Font; + + } + } + private System.Drawing.Font _OrigWindowsFont; + [XmlIgnore] + [Browsable(false)] + public System.Drawing.Font OrigWindowsFont + { + get { return _OrigWindowsFont; } + set { _OrigWindowsFont = value; } + } + private System.Drawing.Font _WindowsFont; + [XmlIgnore] + public System.Drawing.Font WindowsFont + { + get { return _WindowsFont; } + set { _WindowsFont = value; } + } + public FontDesc() + { + } + public string ConvertToString() + { + return GenericSerializer.StringSerialize(this); + } + public override string ToString() + { + return "FontDescription"; + } + public static FontDesc Get(string xml) + { + return GenericSerializer.StringDeserialize(xml); + } + } + #endregion Font + #region DocStyles + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + [Editor(typeof(PropGridCollEditor), typeof(System.Drawing.Design.UITypeEditor))] + public class DocStyles : List + { + [Browsable(false)] + public int Capacity { get { return base.Capacity; } } + [Browsable(false)] + public int Count { get { return base.Count; } } + public DocStyle this[int index] + { + get { return (DocStyle)base[index]; } + } + public string ConvertToString() + { + return GenericSerializer.StringSerialize(this); + } + public override string ToString() + { + return "Section Type Count = " + base.Count.ToString(); + } + } + #endregion DocStyles + #region DocStyle + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + public class DocStyle + { + private string _Name; + [XmlAttribute("Name")] + [Browsable(false)] + public string Name + { + get { return _Name; } + set { _Name = value; } + } + private string _Index; + [Browsable(false)] + [XmlAttribute("Index")] + public string Index + { + get { return _Index; } + set { _Index = value; } + } + private Layout _Layout; + [XmlElement("Layout")] + public Layout Layout + { + get { return _Layout; } + set { _Layout = value; } + } + public DocStyle() + { + } + public string ConvertToString() + { + return GenericSerializer.StringSerialize(this); + } + public override string ToString() + { + return Name; + } + } + #endregion DocStyle + #region Layout + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + public class Layout : IXmlSerializable + { + private float? _PageLength; + [XmlAttribute("PageLength")] + [DisplayName("Page Length (in)")] + public float? PageLength + { + get { return _PageLength; } + set { _PageLength = value; } + } + private float? _OrigPageLength; + [XmlIgnore] + [Browsable(false)] + public float? OrigPageLength + { + get { return _OrigPageLength; } + set { _OrigPageLength = value; } + } + private float? _LeftMargin; + [XmlAttribute("LeftMargin")] + [DisplayName("Left Margin (in)")] + public float? LeftMargin + { + get { return _LeftMargin; } + set { _LeftMargin = value; } + } + private float? _OrigLeftMargin; + [XmlIgnore] + [Browsable(false)] + public float? OrigLeftMargin + { + get { return _OrigLeftMargin; } + set { _OrigLeftMargin = value; } + } + public Layout() + { + } + public string ConvertToString() + { + return GenericSerializer.StringSerialize(this); + } + public override string ToString() + { + return "Layout"; + } + #region IXmlSerializable members + // The read & write for these is necessary since they are within same xml element, and one may be empty, so + // no attribute should be listed in the xml. + public void WriteXml(XmlWriter writer) + { + if (LeftMargin != null) writer.WriteAttributeString("LeftMargin", LeftMargin.ToString()); + if (PageLength != null) writer.WriteAttributeString("PageLength", PageLength.ToString()); + } + + public void ReadXml(XmlReader reader) + { + if (reader.MoveToContent() == XmlNodeType.Element && reader.LocalName == "Layout") + { + string str = reader["PageLength"]; + if (str != null && str != "") PageLength = float.Parse(str); + str = reader["LeftMargin"]; + if (str != null && str != "") LeftMargin = float.Parse(str); + } + } + + public XmlSchema GetSchema() + { + return (null); + } + #endregion + } + #endregion Layout + } +}