CSLA Config cleanup
This commit is contained in:
@@ -1,15 +1,10 @@
|
||||
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
|
||||
{
|
||||
@@ -28,13 +23,6 @@ namespace VEPROMS.CSLA.Library
|
||||
get { return false; }
|
||||
}
|
||||
#endregion
|
||||
#region XML
|
||||
private XMLProperties _Xp;
|
||||
private XMLProperties Xp
|
||||
{
|
||||
get { return _Xp; }
|
||||
}
|
||||
#endregion
|
||||
#region Attributes
|
||||
[XmlAttribute("Name")]
|
||||
private string _Name;
|
||||
@@ -69,27 +57,14 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
#endregion Elements
|
||||
#region Constructors
|
||||
private Format _Format;
|
||||
private FormatInfo _FormatInfo;
|
||||
public FormatConfig(string xml)
|
||||
{
|
||||
if (xml == string.Empty) xml = "<FormatConfig/>";
|
||||
}
|
||||
public FormatConfig(FormatInfo fi)
|
||||
{
|
||||
_FormatInfo = fi;
|
||||
}
|
||||
public FormatConfig(Format f)
|
||||
{
|
||||
_Format = f;
|
||||
}
|
||||
public FormatConfig()
|
||||
{
|
||||
PlantFormat = new PlantFormatx();
|
||||
}
|
||||
#endregion Constructors
|
||||
#region Serialize
|
||||
public string ConvertToString()
|
||||
private readonly Format _Format;
|
||||
private readonly FormatInfo _FormatInfo;
|
||||
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<FormatConfig>.StringSerialize(this);
|
||||
}
|
||||
@@ -131,11 +106,8 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return "Plant Format";
|
||||
}
|
||||
}
|
||||
public override string ToString() => "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
|
||||
@@ -202,11 +174,8 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
ReplaceStrData = new ReplaceStrData();
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return "Format Data";
|
||||
}
|
||||
}
|
||||
public override string ToString() => "Format Data";
|
||||
}
|
||||
#endregion FormatData
|
||||
#region Flags
|
||||
[Serializable]
|
||||
@@ -242,27 +211,15 @@ namespace VEPROMS.CSLA.Library
|
||||
[Editor(typeof(PropGridCollEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public class ReplaceStrData : List<ReplaceStr>
|
||||
{
|
||||
[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<ReplaceStrData>.StringSerialize(this);
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return "Replace Words List Count = " + base.Count.ToString();
|
||||
}
|
||||
public static ReplaceStrData Get(string xml)
|
||||
{
|
||||
return GenericSerializer<ReplaceStrData>.StringDeserialize(xml);
|
||||
}
|
||||
}
|
||||
[Browsable(false)]
|
||||
public new int Capacity => base.Capacity;
|
||||
[Browsable(false)]
|
||||
public new int Count => base.Count;
|
||||
public new ReplaceStr this[int index] => (ReplaceStr)base[index];
|
||||
public string ConvertToString() => GenericSerializer<ReplaceStrData>.StringSerialize(this);
|
||||
public override string ToString() => $"Replace Words List Count = {base.Count}";
|
||||
public static ReplaceStrData Get(string xml) => GenericSerializer<ReplaceStrData>.StringDeserialize(xml);
|
||||
}
|
||||
#endregion ReplaceStrData
|
||||
#region ReplaceStr
|
||||
|
||||
@@ -303,19 +260,10 @@ namespace VEPROMS.CSLA.Library
|
||||
public ReplaceStr()
|
||||
{
|
||||
}
|
||||
public string ConvertToString()
|
||||
{
|
||||
return GenericSerializer<ReplaceStr>.StringSerialize(this);
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return ReplaceWord;
|
||||
}
|
||||
public static ReplaceStr Get(string xml)
|
||||
{
|
||||
return GenericSerializer<ReplaceStr>.StringDeserialize(xml);
|
||||
}
|
||||
}
|
||||
public string ConvertToString() => GenericSerializer<ReplaceStr>.StringSerialize(this);
|
||||
public override string ToString() => ReplaceWord;
|
||||
public static ReplaceStr Get(string xml) => GenericSerializer<ReplaceStr>.StringDeserialize(xml);
|
||||
}
|
||||
#endregion ReplaceStr
|
||||
#region CheckOffHeaders (list)
|
||||
[Serializable]
|
||||
@@ -323,23 +271,14 @@ namespace VEPROMS.CSLA.Library
|
||||
[Editor(typeof(PropGridCollEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public class CheckOffHeaderList : List<CheckOffHeader>
|
||||
{
|
||||
[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<CheckOffHeaderList>.StringSerialize(this);
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return "CheckOffHeader Count = " + base.Count.ToString();
|
||||
}
|
||||
}
|
||||
[Browsable(false)]
|
||||
public new int Capacity => base.Capacity;
|
||||
[Browsable(false)]
|
||||
public new int Count { get { return base.Count; } }
|
||||
public new CheckOffHeader this[int index] => (CheckOffHeader)base[index];
|
||||
public string ConvertToString() => GenericSerializer<CheckOffHeaderList>.StringSerialize(this);
|
||||
public override string ToString() => $"CheckOffHeader Count = {base.Count}";
|
||||
}
|
||||
#endregion CheckOffHeaders
|
||||
#region CheckOffHeader
|
||||
[Serializable]
|
||||
@@ -382,15 +321,9 @@ namespace VEPROMS.CSLA.Library
|
||||
public CheckOffHeader()
|
||||
{
|
||||
}
|
||||
public string ConvertToString()
|
||||
{
|
||||
return GenericSerializer<CheckOffHeader>.StringSerialize(this);
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return CheckOffHeading;
|
||||
}
|
||||
}
|
||||
public string ConvertToString() => GenericSerializer<CheckOffHeader>.StringSerialize(this);
|
||||
public override string ToString() => CheckOffHeading;
|
||||
}
|
||||
#endregion CheckOffHeader
|
||||
#region CheckOffs (list)
|
||||
[Serializable]
|
||||
@@ -399,22 +332,13 @@ namespace VEPROMS.CSLA.Library
|
||||
public class CheckOffList : List<CheckOff>
|
||||
{
|
||||
[Browsable(false)]
|
||||
public int Capacity { get { return base.Capacity; } }
|
||||
public new 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<CheckOffList>.StringSerialize(this);
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return "CheckOff Count = " + base.Count.ToString();
|
||||
}
|
||||
}
|
||||
public new int Count { get { return base.Count; } }
|
||||
public new CheckOff this[int index] => (CheckOff)base[index];
|
||||
public string ConvertToString() => GenericSerializer<CheckOffList>.StringSerialize(this);
|
||||
public override string ToString() => $"CheckOff Count = {base.Count}";
|
||||
}
|
||||
#endregion CheckOffs
|
||||
#region CheckOff
|
||||
[Serializable]
|
||||
@@ -457,15 +381,9 @@ namespace VEPROMS.CSLA.Library
|
||||
public CheckOff()
|
||||
{
|
||||
}
|
||||
public string ConvertToString()
|
||||
{
|
||||
return GenericSerializer<CheckOff>.StringSerialize(this);
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return MenuItem;
|
||||
}
|
||||
}
|
||||
public string ConvertToString() => GenericSerializer<CheckOff>.StringSerialize(this);
|
||||
public override string ToString() => MenuItem;
|
||||
}
|
||||
#endregion CheckOff
|
||||
#region ShwRplWds
|
||||
[Serializable]
|
||||
@@ -508,15 +426,9 @@ namespace VEPROMS.CSLA.Library
|
||||
public ShwRplWds()
|
||||
{
|
||||
}
|
||||
public string ConvertToString()
|
||||
{
|
||||
return GenericSerializer<ShwRplWds>.StringSerialize(this);
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return MenuItem;
|
||||
}
|
||||
}
|
||||
public string ConvertToString() => GenericSerializer<ShwRplWds>.StringSerialize(this);
|
||||
public override string ToString() => MenuItem;
|
||||
}
|
||||
#endregion ShwRplWds
|
||||
#region StepData (list)
|
||||
[Serializable]
|
||||
@@ -525,26 +437,14 @@ namespace VEPROMS.CSLA.Library
|
||||
public class StepData : List<Step>
|
||||
{
|
||||
[Browsable(false)]
|
||||
public int Capacity { get { return base.Capacity; } }
|
||||
public new 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<StepData>.StringSerialize(this);
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return "Step Count = " + base.Count.ToString();
|
||||
}
|
||||
public static StepData Get(string xml)
|
||||
{
|
||||
return GenericSerializer<StepData>.StringDeserialize(xml);
|
||||
}
|
||||
}
|
||||
public new int Count { get { return base.Count; } }
|
||||
public new Step this[int index] => (Step)base[index];
|
||||
public string ConvertToString() => GenericSerializer<StepData>.StringSerialize(this);
|
||||
public override string ToString() => $"Step Count = {base.Count}";
|
||||
public static StepData Get(string xml) => GenericSerializer<StepData>.StringDeserialize(xml);
|
||||
}
|
||||
#endregion StepData
|
||||
#region Step
|
||||
[Serializable]
|
||||
@@ -577,28 +477,16 @@ namespace VEPROMS.CSLA.Library
|
||||
public Step()
|
||||
{
|
||||
}
|
||||
public string ConvertToString()
|
||||
{
|
||||
return GenericSerializer<Step>.StringSerialize(this);
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return Type;
|
||||
}
|
||||
public static Step Get(string xml)
|
||||
{
|
||||
return GenericSerializer<Step>.StringDeserialize(xml);
|
||||
}
|
||||
}
|
||||
public string ConvertToString() => GenericSerializer<Step>.StringSerialize(this);
|
||||
public override string ToString() => Type;
|
||||
public static Step Get(string xml) => GenericSerializer<Step>.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
|
||||
@@ -633,19 +521,10 @@ namespace VEPROMS.CSLA.Library
|
||||
public FontDesc()
|
||||
{
|
||||
}
|
||||
public string ConvertToString()
|
||||
{
|
||||
return GenericSerializer<FontDesc>.StringSerialize(this);
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return "FontDescription";
|
||||
}
|
||||
public static FontDesc Get(string xml)
|
||||
{
|
||||
return GenericSerializer<FontDesc>.StringDeserialize(xml);
|
||||
}
|
||||
}
|
||||
public string ConvertToString() => GenericSerializer<FontDesc>.StringSerialize(this);
|
||||
public override string ToString() => "FontDescription";
|
||||
public static FontDesc Get(string xml) => GenericSerializer<FontDesc>.StringDeserialize(xml);
|
||||
}
|
||||
#endregion Font
|
||||
#region DocStyles
|
||||
[Serializable]
|
||||
@@ -654,22 +533,13 @@ namespace VEPROMS.CSLA.Library
|
||||
public class DocStyles : List<DocStyle>
|
||||
{
|
||||
[Browsable(false)]
|
||||
public int Capacity { get { return base.Capacity; } }
|
||||
public new 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<DocStyles>.StringSerialize(this);
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return "Section Type Count = " + base.Count.ToString();
|
||||
}
|
||||
}
|
||||
public new int Count { get { return base.Count; } }
|
||||
public new DocStyle this[int index] => (DocStyle)base[index];
|
||||
public string ConvertToString() => GenericSerializer<DocStyles>.StringSerialize(this);
|
||||
public override string ToString() => $"Section Type Count = {base.Count}";
|
||||
}
|
||||
#endregion DocStyles
|
||||
#region DocStyle
|
||||
[Serializable]
|
||||
@@ -702,15 +572,9 @@ namespace VEPROMS.CSLA.Library
|
||||
public DocStyle()
|
||||
{
|
||||
}
|
||||
public string ConvertToString()
|
||||
{
|
||||
return GenericSerializer<DocStyle>.StringSerialize(this);
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
public string ConvertToString() => GenericSerializer<DocStyle>.StringSerialize(this);
|
||||
public override string ToString() => Name;
|
||||
}
|
||||
#endregion DocStyle
|
||||
#region Layout
|
||||
[Serializable]
|
||||
@@ -752,18 +616,12 @@ namespace VEPROMS.CSLA.Library
|
||||
public Layout()
|
||||
{
|
||||
}
|
||||
public string ConvertToString()
|
||||
{
|
||||
return GenericSerializer<Layout>.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)
|
||||
public string ConvertToString() => GenericSerializer<Layout>.StringSerialize(this);
|
||||
public override string ToString() => "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());
|
||||
@@ -780,12 +638,9 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
|
||||
public XmlSchema GetSchema()
|
||||
{
|
||||
return (null);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
public XmlSchema GetSchema() => (null);
|
||||
#endregion
|
||||
}
|
||||
#endregion Layout
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user