C2018-039: Upgrade – User Control of Format

This commit is contained in:
Kathy Ruffing 2018-12-12 15:29:56 +00:00
parent e2392f5fec
commit ddf01e9f9a
7 changed files with 1083 additions and 2 deletions

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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 {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Admin {
get {
object obj = ResourceManager.GetObject("Admin", resourceCulture);
@ -67,6 +70,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap EnvelopeHS {
get {
object obj = ResourceManager.GetObject("EnvelopeHS", resourceCulture);
@ -74,6 +80,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap GoToParentFolderHS {
get {
object obj = ResourceManager.GetObject("GoToParentFolderHS", resourceCulture);
@ -81,6 +90,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap GotoShortcutsHS {
get {
object obj = ResourceManager.GetObject("GotoShortcutsHS", resourceCulture);
@ -88,6 +100,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap GotoTrans {
get {
object obj = ResourceManager.GetObject("GotoTrans", resourceCulture);
@ -95,6 +110,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Help_Image {
get {
object obj = ResourceManager.GetObject("Help_Image", resourceCulture);
@ -102,6 +120,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap HelpAbout_Image {
get {
object obj = ResourceManager.GetObject("HelpAbout_Image", resourceCulture);
@ -109,6 +130,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap HelpDoc_Image {
get {
object obj = ResourceManager.GetObject("HelpDoc_Image", resourceCulture);
@ -116,6 +140,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap InsertAfter {
get {
object obj = ResourceManager.GetObject("InsertAfter", resourceCulture);
@ -123,6 +150,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ProtectFormHS {
get {
object obj = ResourceManager.GetObject("ProtectFormHS", resourceCulture);
@ -130,6 +160,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ProtectFormHS1 {
get {
object obj = ResourceManager.GetObject("ProtectFormHS1", resourceCulture);
@ -137,6 +170,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap PushpinStick {
get {
object obj = ResourceManager.GetObject("PushpinStick", resourceCulture);
@ -144,6 +180,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap PushpinUnStick {
get {
object obj = ResourceManager.GetObject("PushpinUnStick", resourceCulture);
@ -151,6 +190,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
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 {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap RenameFolderHS {
get {
object obj = ResourceManager.GetObject("RenameFolderHS", resourceCulture);
@ -165,6 +210,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Save {
get {
object obj = ResourceManager.GetObject("Save", resourceCulture);
@ -172,6 +220,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap SaveAllHS {
get {
object obj = ResourceManager.GetObject("SaveAllHS", resourceCulture);
@ -179,6 +230,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap SaveAs {
get {
object obj = ResourceManager.GetObject("SaveAs", resourceCulture);
@ -186,6 +240,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Separator {
get {
object obj = ResourceManager.GetObject("Separator", resourceCulture);
@ -193,6 +250,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap UnProtectFormHS {
get {
object obj = ResourceManager.GetObject("UnProtectFormHS", resourceCulture);
@ -200,6 +260,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon veproms {
get {
object obj = ResourceManager.GetObject("veproms", resourceCulture);
@ -207,6 +270,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ViewThumbnailsHS {
get {
object obj = ResourceManager.GetObject("ViewThumbnailsHS", resourceCulture);
@ -214,6 +280,9 @@ namespace VEPROMS.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap VolianWeb_Image {
get {
object obj = ResourceManager.GetObject("VolianWeb_Image", resourceCulture);

View File

@ -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;
}
}
}
}

View File

@ -98,5 +98,8 @@
<Setting Name="VisioPath" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="UCFImportOpt" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<style>
body {
background-color: lightblue;
}
h1 {
color: white;
text-align: center;
font-size: 30px;
}
td {
font-family: verdana;
font-size: 14px;
padding: 2px;
}
th {
font-family: verdana;
font-size: 14px;
}
</style>
</head>
<body>
<h1>User Control of Format Details</h1>
<h4><xsl:value-of select="FormatConfig/@Name"/> - <xsl:value-of select="FormatConfig/@Description"/></h4>
<xsl:for-each select="//FormatData/*">
<xsl:apply-templates select="."/>
</xsl:for-each>
<xsl:for-each select="//DocStyles">
<xsl:apply-templates select="."/>
</xsl:for-each>
</body>
</html>
</xsl:template>
<xsl:template match="Flags">
<xsl:if test="*">
<table border="1">
<tr bgcolor="#9acd32">
<th>Flag</th>
<th>Value</th>
</tr>
<xsl:for-each select="*">
<tr>
<td bgcolor="honeydew"><xsl:value-of select="name()"/></td>
<td bgcolor="lemonchiffon" align="right"><xsl:value-of select="."/></td>
</tr>
</xsl:for-each>
</table>
<p/>
</xsl:if>
</xsl:template>
<xsl:template match="CheckOffHeaderList">
<table border="1">
<tr bgcolor="#9acd32">
<th>Check Off Heading</th>
<th>Active</th>
</tr>
<xsl:for-each select="CheckOffHeader">
<tr>
<td bgcolor="honeydew">
<xsl:value-of select="@CheckOffHeading"/>
</td>
<td bgcolor="lemonchiffon" align="right">
<xsl:value-of select="Active"/>
</td>
</tr>
</xsl:for-each>
</table>
<p/>
</xsl:template>
<xsl:template match="CheckOffList">
<table border="1">
<tr bgcolor="#9acd32">
<th>Check Off Type</th>
<th>Active</th>
</tr>
<xsl:for-each select="CheckOff">
<tr>
<td bgcolor="honeydew"><xsl:value-of select="@MenuItem"/></td>
<td bgcolor="lemonchiffon" align="right"><xsl:value-of select="Active"/></td>
</tr>
</xsl:for-each>
</table>
<p/>
</xsl:template>
<xsl:template match="CheckOffXOffAdj">
<table border="1">
<tr bgcolor="#9acd32">
<th>Check Off X Offset Adjust (Inches)</th>
</tr>
<tr>
<td bgcolor="lemonchiffon" align="right">
<xsl:value-of select="."/>
</td>
</tr>
</table>
<p/>
</xsl:template>
<xsl:template match="ReplaceStrData">
<table border="1">
<tr bgcolor="#9acd32">
<th>Replace Word</th>
<th>Replace With</th>
<th>State</th>
<th>Flag</th>
</tr>
<xsl:for-each select="ReplaceStr">
<tr>
<td bgcolor="honeydew"><xsl:value-of select="@ReplaceWord"/></td>
<td bgcolor="lemonchiffon" align="right"><xsl:value-of select="@ReplaceWith"/></td>
<td bgcolor="lemonchiffon" align="right">
<xsl:choose>
<xsl:when test="@State = 1">
<xsl:text>Add</xsl:text>
</xsl:when>
<xsl:when test="@State = 2">
<xsl:text>Modify</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>Delete</xsl:text>
</xsl:otherwise>
</xsl:choose></td>
<td bgcolor="lemonchiffon" align="right"><xsl:value-of select="@Flag"/></td>
</tr>
</xsl:for-each>
</table>
<p/>
</xsl:template>
<xsl:template match="StepData">
<table border="1">
<tr bgcolor="#9acd32">
<th>Step Type</th>
<th>Font</th>
</tr>
<xsl:for-each select="Step">
<tr>
<td bgcolor="honeydew"><xsl:value-of select="@Type"/></td>
<style>
td {
font-family: <xsl:value-of select="FontDesc/@Family"/>;
}
</style>
<td bgcolor="lemonchiffon" align="right"><xsl:value-of select="FontDesc/@Font"/></td>
</tr>
<style>
td {
font-family: verdana;
font-size: 14px;
padding: 2px;
}
</style>
</xsl:for-each>
</table>
<p/>
</xsl:template>
<xsl:decimal-format name="coerce" NaN=" " />
<xsl:template match="DocStyles">
<table border="1">
<tr bgcolor="#9acd32">
<th>Document Style</th>
<th>Page Length</th>
<th>Left Margin</th>
</tr>
<xsl:for-each select="DocStyle">
<tr>
<td bgcolor="honeydew"><xsl:value-of select="@Name"/></td>
<td bgcolor="lemonchiffon" align="right"><xsl:value-of select="format-number(Layout/@PageLength div 72,'##.00','coerce')"/></td>
<td bgcolor="lemonchiffon" align="right"><xsl:value-of select="format-number(Layout/@LeftMargin div 72,'##.00','coerce')"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
<xsl:template match="/">
<xsl:for-each select="//FormatData/*|//DocStyles/*">
<xsl:if test="*">
<xsl:value-of select="name()"/>
<xsl:if test="position() != last()">,</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

View File

@ -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; }

View File

@ -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 = "<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()
{
return GenericSerializer<FormatConfig>.StringSerialize(this);
}
public static FormatConfig Get(string xml)
{
return GenericSerializer<FormatConfig>.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<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);
}
}
#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<ReplaceStr>.StringSerialize(this);
}
public override string ToString()
{
return ReplaceWord;
}
public static ReplaceStr Get(string xml)
{
return GenericSerializer<ReplaceStr>.StringDeserialize(xml);
}
}
#endregion ReplaceStr
#region CheckOffHeaders (list)
[Serializable]
[TypeConverter(typeof(ExpandableObjectConverter))]
[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();
}
}
#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<CheckOffHeader>.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<CheckOff>
{
[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<CheckOffList>.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<CheckOff>.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<Step>
{
[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<StepData>.StringSerialize(this);
}
public override string ToString()
{
return "Step Count = " + base.Count.ToString();
}
public static StepData Get(string xml)
{
return GenericSerializer<StepData>.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<Step>.StringSerialize(this);
}
public override string ToString()
{
return Type;
}
public static Step Get(string xml)
{
return 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
{
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<FontDesc>.StringSerialize(this);
}
public override string ToString()
{
return "FontDescription";
}
public static FontDesc Get(string xml)
{
return GenericSerializer<FontDesc>.StringDeserialize(xml);
}
}
#endregion Font
#region DocStyles
[Serializable]
[TypeConverter(typeof(ExpandableObjectConverter))]
[Editor(typeof(PropGridCollEditor), typeof(System.Drawing.Design.UITypeEditor))]
public class DocStyles : List<DocStyle>
{
[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<DocStyles>.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<DocStyle>.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<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)
{
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
}
}