This commit is contained in:
Kathy Ruffing 2011-05-19 13:26:37 +00:00
parent c6821188c5
commit 4405463e8e
4 changed files with 116 additions and 75 deletions

View File

@ -196,11 +196,11 @@ namespace VEPROMS.CSLA.Library
public Layout(XmlNode xmlNode) : base(xmlNode) { } public Layout(XmlNode xmlNode) : base(xmlNode) { }
public Layout() : base() { } public Layout() : base() { }
#region TopRow #region TopRow
private LazyLoad<int?> _TopRow; private LazyLoad<float?> _TopRow;
[Category("Layout")] [Category("Layout")]
[DisplayName("Top Row on Printed Page")] [DisplayName("Top Row on Printed Page")]
[Description("Top Row on Printed Page")] [Description("Top Row on Printed Page")]
public int? TopRow public float? TopRow
{ {
get get
{ {
@ -209,11 +209,11 @@ namespace VEPROMS.CSLA.Library
} }
#endregion #endregion
#region FooterLength #region FooterLength
private LazyLoad<int?> _FooterLength; private LazyLoad<float?> _FooterLength;
[Category("Location")] [Category("Location")]
[DisplayName("Number of lines required for footer")] [DisplayName("Number of lines required for footer")]
[Description("Number of lines required for footer")] [Description("Number of lines required for footer")]
public int? FooterLength public float? FooterLength
{ {
get get
{ {
@ -222,11 +222,11 @@ namespace VEPROMS.CSLA.Library
} }
#endregion #endregion
#region LeftMargin #region LeftMargin
private LazyLoad<int?> _LeftMargin; private LazyLoad<float?> _LeftMargin;
[Category("Location")] [Category("Location")]
[DisplayName("Size of left margin")] [DisplayName("Size of left margin")]
[Description("Size of left margin")] [Description("Size of left margin")]
public int? LeftMargin public float? LeftMargin
{ {
get get
{ {
@ -235,11 +235,11 @@ namespace VEPROMS.CSLA.Library
} }
#endregion #endregion
#region PageLength #region PageLength
private LazyLoad<int?> _PageLength; private LazyLoad<float?> _PageLength;
[Category("Location")] [Category("Location")]
[DisplayName("Length of Page")] [DisplayName("Length of Page")]
[Description("Length of Page")] [Description("Length of Page")]
public int? PageLength public float? PageLength
{ {
get get
{ {
@ -248,11 +248,11 @@ namespace VEPROMS.CSLA.Library
} }
#endregion #endregion
#region PageWidth #region PageWidth
private LazyLoad<int?> _PageWidth; private LazyLoad<float?> _PageWidth;
[Category("Location")] [Category("Location")]
[DisplayName("Width of Page")] [DisplayName("Width of Page")]
[Description("Width of Page")] [Description("Width of Page")]
public int? PageWidth public float? PageWidth
{ {
get get
{ {
@ -309,11 +309,11 @@ namespace VEPROMS.CSLA.Library
public Top(XmlNode xmlNode) : base(xmlNode) { } public Top(XmlNode xmlNode) : base(xmlNode) { }
public Top() : base() { } public Top() : base() { }
#region Margin #region Margin
private LazyLoad<int?> _Margin; private LazyLoad<float?> _Margin;
[Category("Continue Msg")] [Category("Continue Msg")]
[DisplayName("Margin for top msg")] [DisplayName("Margin for top msg")]
[Description("Margin for top msg")] [Description("Margin for top msg")]
public int? Margin public float? Margin
{ {
get get
{ {
@ -356,11 +356,11 @@ namespace VEPROMS.CSLA.Library
public Bottom(XmlNode xmlNode) : base(xmlNode) { } public Bottom(XmlNode xmlNode) : base(xmlNode) { }
public Bottom() : base() { } public Bottom() : base() { }
#region Margin #region Margin
private LazyLoad<int?> _Margin; private LazyLoad<float?> _Margin;
[Category("Continue Msg")] [Category("Continue Msg")]
[DisplayName("Margin for bottom msg")] [DisplayName("Margin for bottom msg")]
[Description("Margin for bottom msg")] [Description("Margin for bottom msg")]
public int? Margin public float? Margin
{ {
get get
{ {

View File

@ -95,22 +95,22 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _Token, "@Token"); return LazyLoad(ref _Token, "@Token");
} }
} }
private LazyLoad<int?> _Row; private LazyLoad<float?> _Row;
[Category("Location")] [Category("Location")]
[DisplayName("Vertical Position")] [DisplayName("Vertical Position")]
[Description("Vertical Position")] [Description("Vertical Position")]
public int? Row public float? Row
{ {
get get
{ {
return LazyLoad(ref _Row, "@Row"); return LazyLoad(ref _Row, "@Row");
} }
} }
private LazyLoad<int?> _Col; private LazyLoad<float?> _Col;
[Category("Location")] [Category("Location")]
[DisplayName("Horizontal Position")] [DisplayName("Horizontal Position")]
[Description("Horizontal Position")] [Description("Horizontal Position")]
public int? Col public float? Col
{ {
get get
{ {

View File

@ -71,11 +71,12 @@ namespace VEPROMS.CSLA.Library
public class VE_Font : vlnFormatItem public class VE_Font : vlnFormatItem
{ {
public VE_Font(XmlNode xmlNode) : base(xmlNode) { } public VE_Font(XmlNode xmlNode) : base(xmlNode) { }
public VE_Font(string family, int size, E_Style style) public VE_Font(string family, int size, E_Style style, float CPI)
{ {
_Family = new LazyLoad<string>(family); _Family = new LazyLoad<string>(family);
_Size = new LazyLoad<int?>(size); _Size = new LazyLoad<int?>(size);
_Style = new LazyLoad<E_Style?>(style); _Style = new LazyLoad<E_Style?>(style);
_CPI = new LazyLoad<float?>(CPI);
} }
private LazyLoad<string> _Family; private LazyLoad<string> _Family;
private Font _WindowsFont; private Font _WindowsFont;
@ -134,6 +135,22 @@ namespace VEPROMS.CSLA.Library
// _Style.Value = value; // _Style.Value = value;
//} //}
} }
private LazyLoad<float?> _CPI;
public float? CPI
{
get
{
return LazyLoad(ref _CPI, "Font/@CPI");
}
}
public float CharsToTwips
{
get
{
return (72 / (CPI ?? 12));
}
}
public override string ToString() public override string ToString()
{ {
return string.Format("{0}, {1} pt, {2}", Family, Size, Style); return string.Format("{0}, {1} pt, {2}", Family, Size, Style);
@ -1143,8 +1160,8 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _UIMark, "@UIMark"); return LazyLoad(ref _UIMark, "@UIMark");
} }
} }
private LazyLoad<int?> _CheckOffWidAdjust; private LazyLoad<float?> _CheckOffWidAdjust;
public int? CheckOffWidAdjust public float? CheckOffWidAdjust
{ {
get get
{ {
@ -1565,8 +1582,8 @@ namespace VEPROMS.CSLA.Library
{ {
public SectionNumber(XmlNode xmlNode) : base(xmlNode) { } public SectionNumber(XmlNode xmlNode) : base(xmlNode) { }
public SectionNumber() : base() { } public SectionNumber() : base() { }
private LazyLoad<int?> _Pos; private LazyLoad<float?> _Pos;
public int? Pos public float? Pos
{ {
get get
{ {
@ -1597,8 +1614,8 @@ namespace VEPROMS.CSLA.Library
{ {
public SectionHeader(XmlNode xmlNode) : base(xmlNode) { } public SectionHeader(XmlNode xmlNode) : base(xmlNode) { }
public SectionHeader() : base() { } public SectionHeader() : base() { }
private LazyLoad<int?> _Pos; private LazyLoad<float?> _Pos;
public int? Pos public float? Pos
{ {
get get
{ {
@ -2365,8 +2382,8 @@ namespace VEPROMS.CSLA.Library
return (_Separator == null) ?_Separator = new Separator(SelectSingleNode("Separator")):_Separator; return (_Separator == null) ?_Separator = new Separator(SelectSingleNode("Separator")):_Separator;
} }
} }
private LazyLoad<int?> _LastLineToStartStep; private LazyLoad<float?> _LastLineToStartStep;
public int? LastLineToStartStep public float? LastLineToStartStep
{ {
get get
{ {
@ -2381,32 +2398,32 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _LineDrawingOption, "@LineDrawingOption"); return LazyLoad(ref _LineDrawingOption, "@LineDrawingOption");
} }
} }
private LazyLoad<int?> _ColS; private LazyLoad<float?> _ColS;
public int? ColS public float? ColS
{ {
get get
{ {
return LazyLoad(ref _ColS, "@ColS"); return LazyLoad(ref _ColS, "@ColS");
} }
} }
private LazyLoad<int?> _ColT; private LazyLoad<float?> _ColT;
public int? ColT public float? ColT
{ {
get get
{ {
return LazyLoad(ref _ColT, "@ColT"); return LazyLoad(ref _ColT, "@ColT");
} }
} }
private LazyLoad<int?> _ColAbs; private LazyLoad<float?> _ColAbs;
public int? ColAbs public float? ColAbs
{ {
get get
{ {
return LazyLoad(ref _ColAbs, "@ColAbs"); return LazyLoad(ref _ColAbs, "@ColAbs");
} }
} }
private LazyLoad<int?> _WidT; private LazyLoad<float?> _WidT;
public int? WidT public float? WidT
{ {
get get
{ {
@ -2461,8 +2478,8 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _WidSTablePrint, "@WidSTablePrint"); return LazyLoad(ref _WidSTablePrint, "@WidSTablePrint");
} }
} }
private LazyLoad<int?> _AdjRNOCol; private LazyLoad<float?> _AdjRNOCol;
public int? AdjRNOCol public float? AdjRNOCol
{ {
get get
{ {
@ -2835,16 +2852,16 @@ namespace VEPROMS.CSLA.Library
public class TopOfPage : vlnFormatItem public class TopOfPage : vlnFormatItem
{ {
public TopOfPage(XmlNode xmlNode) : base(xmlNode) { } public TopOfPage(XmlNode xmlNode) : base(xmlNode) { }
private LazyLoad<int?> _Row; private LazyLoad<float?> _Row;
public int? Row public float? Row
{ {
get get
{ {
return LazyLoad(ref _Row, "@Row"); return LazyLoad(ref _Row, "@Row");
} }
} }
private LazyLoad<int?> _Col; private LazyLoad<float?> _Col;
public int? Col public float? Col
{ {
get get
{ {
@ -2888,16 +2905,16 @@ namespace VEPROMS.CSLA.Library
public class StepSectionEditData : vlnFormatItem public class StepSectionEditData : vlnFormatItem
{ {
public StepSectionEditData(XmlNode xmlNode) : base(xmlNode) { } public StepSectionEditData(XmlNode xmlNode) : base(xmlNode) { }
private LazyLoad<int?> _ColSScreenAdj; private LazyLoad<float?> _ColSScreenAdj;
public int? ColSScreenAdj public float? ColSScreenAdj
{ {
get get
{ {
return LazyLoad(ref _ColSScreenAdj, "@ColSScreenAdj"); return LazyLoad(ref _ColSScreenAdj, "@ColSScreenAdj");
} }
} }
private LazyLoad<int?> _ScrnAdjRNOText; private LazyLoad<float?> _ScrnAdjRNOText;
public int? ScrnAdjRNOText public float? ScrnAdjRNOText
{ {
get get
{ {
@ -2918,8 +2935,8 @@ namespace VEPROMS.CSLA.Library
public class StepSectionPrintData : vlnFormatItem public class StepSectionPrintData : vlnFormatItem
{ {
public StepSectionPrintData(XmlNode xmlNode) : base(xmlNode) { } public StepSectionPrintData(XmlNode xmlNode) : base(xmlNode) { }
private LazyLoad<int?> _ImmStepHdrCol; private LazyLoad<float?> _ImmStepHdrCol;
public int? ImmStepHdrCol public float? ImmStepHdrCol
{ {
get get
{ {
@ -3140,16 +3157,16 @@ namespace VEPROMS.CSLA.Library
public class TableOfContentsData : vlnFormatItem public class TableOfContentsData : vlnFormatItem
{ {
public TableOfContentsData(XmlNode xmlNode) : base(xmlNode) { } public TableOfContentsData(XmlNode xmlNode) : base(xmlNode) { }
private LazyLoad<int?> _TofCSecNumPos; private LazyLoad<float?> _TofCSecNumPos;
public int? TofCSecNumPos public float? TofCSecNumPos
{ {
get get
{ {
return LazyLoad(ref _TofCSecNumPos, "@TofCSecNumPos"); return LazyLoad(ref _TofCSecNumPos, "@TofCSecNumPos");
} }
} }
private LazyLoad<int?> _TofCSecTitlePos; private LazyLoad<float?> _TofCSecTitlePos;
public int? TofCSecTitlePos public float? TofCSecTitlePos
{ {
get get
{ {
@ -3164,8 +3181,8 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _TofCSecTitleLen, "@TofCSecTitleLen"); return LazyLoad(ref _TofCSecTitleLen, "@TofCSecTitleLen");
} }
} }
private LazyLoad<int?> _TofCPageNumPos; private LazyLoad<float?> _TofCPageNumPos;
public int? TofCPageNumPos public float? TofCPageNumPos
{ {
get get
{ {
@ -3214,40 +3231,40 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _Index, "@Index"); return LazyLoad(ref _Index, "@Index");
} }
} }
private LazyLoad<int?> _SecNumPositionAdj; private LazyLoad<float?> _SecNumPositionAdj;
public int? SecNumPositionAdj public float? SecNumPositionAdj
{ {
get get
{ {
return LazyLoad(ref _SecNumPositionAdj, "@SecNumPositionAdj"); return LazyLoad(ref _SecNumPositionAdj, "@SecNumPositionAdj");
} }
} }
private LazyLoad<int?> _SecTitlePositionAdj; private LazyLoad<float?> _SecTitlePositionAdj;
public int? SecTitlePositionAdj public float? SecTitlePositionAdj
{ {
get get
{ {
return LazyLoad(ref _SecTitlePositionAdj, "@SecTitlePositionAdj"); return LazyLoad(ref _SecTitlePositionAdj, "@SecTitlePositionAdj");
} }
} }
private LazyLoad<int?> _ColSByLevel; private LazyLoad<float?> _ColSByLevel;
public int? ColSByLevel public float? ColSByLevel
{ {
get get
{ {
return LazyLoad(ref _ColSByLevel, "@ColSByLevel"); return LazyLoad(ref _ColSByLevel, "@ColSByLevel");
} }
} }
private LazyLoad<int?> _TofCPositionAdj; private LazyLoad<float?> _TofCPositionAdj;
public int? TofCPositionAdj public float? TofCPositionAdj
{ {
get get
{ {
return LazyLoad(ref _TofCPositionAdj, "@TofCPositionAdj"); return LazyLoad(ref _TofCPositionAdj, "@TofCPositionAdj");
} }
} }
private LazyLoad<int?> _WidSAdjByLevel; private LazyLoad<float?> _WidSAdjByLevel;
public int? WidSAdjByLevel public float? WidSAdjByLevel
{ {
get get
{ {
@ -4387,48 +4404,48 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _Index, "@Index"); return LazyLoad(ref _Index, "@Index");
} }
} }
private LazyLoad<int?> _Start; private LazyLoad<float?> _Start;
public int? Start public float? Start
{ {
get get
{ {
return LazyLoad(ref _Start, "@Start"); return LazyLoad(ref _Start, "@Start");
} }
} }
private LazyLoad<int?> _End; private LazyLoad<float?> _End;
public int? End public float? End
{ {
get get
{ {
return LazyLoad(ref _End, "@End"); return LazyLoad(ref _End, "@End");
} }
} }
private LazyLoad<int?> _TxtStart; private LazyLoad<float?> _TxtStart;
public int? TxtStart public float? TxtStart
{ {
get get
{ {
return LazyLoad(ref _TxtStart, "@TxtStart"); return LazyLoad(ref _TxtStart, "@TxtStart");
} }
} }
private LazyLoad<int?> _TxtWidth; private LazyLoad<float?> _TxtWidth;
public int? TxtWidth public float? TxtWidth
{ {
get get
{ {
return LazyLoad(ref _TxtWidth, "@TxtWidth"); return LazyLoad(ref _TxtWidth, "@TxtWidth");
} }
} }
private LazyLoad<int?> _Height; private LazyLoad<float?> _Height;
public int? Height public float? Height
{ {
get get
{ {
return LazyLoad(ref _Height, "@Height"); return LazyLoad(ref _Height, "@Height");
} }
} }
private LazyLoad<int?> _TabPos; private LazyLoad<float?> _TabPos;
public int? TabPos public float? TabPos
{ {
get get
{ {

View File

@ -369,6 +369,15 @@ namespace VEPROMS.CSLA.Library
} }
return ll.Value; return ll.Value;
} }
public float? LazyLoad(ref LazyLoad<float?> ll, string xPath)
{
if (ll == null)
{
XmlNode xn = SelectSingleNode(xPath);
ll = new LazyLoad<float?>(RetrieveFloat(xPath, xn));
}
return ll.Value;
}
protected int? RetrieveInt(string xPath, XmlNode xn) protected int? RetrieveInt(string xPath, XmlNode xn)
{ {
int? value = null; int? value = null;
@ -384,6 +393,21 @@ namespace VEPROMS.CSLA.Library
} }
return value; return value;
} }
protected float? RetrieveFloat(string xPath, XmlNode xn)
{
float? value = null;
if (xn != null)
{
float fValue = 0;
if (!float.TryParse(xn.InnerText, out fValue))
{
Console.WriteLine(string.Format("'{0}'\r\n'{1}'\r\n'{2}' could not be converted to float?", MyFormat.FullName, MyPath + "/" + xPath, xn.InnerText));
throw (new Exception(string.Format("{0} = '{1}' could not be converted to float?", xPath, xn.InnerText)));
}
value = fValue;
}
return value;
}
public Nullable<T> LazyLoad<T>(ref LazyLoad<Nullable<T>> ll, string xPath) public Nullable<T> LazyLoad<T>(ref LazyLoad<Nullable<T>> ll, string xPath)
where T:struct where T:struct
{ {