Kathy 146e1fb968 New Table of Contents flags & MaxWidth for PSIs (for current page)
Improve message when format is changed and not certain if section type is valid. (part of B2016-165)
vcb1: Added MaxWidthCurPage for PSI text widths (use for current page)
vcb1: Table of Contents values for subsections line spacing and grouping section numbers
Table of Contents to handle single space subsections & Grouping section names remove group title
Use MaxWidthCurPage to handle max width, but don’t account for multiple lines when printing content
2016-07-25 15:04:23 +00:00

161 lines
3.6 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Xml;
namespace VEPROMS.CSLA.Library
{
#region PageStyles
[TypeConverter(typeof(vlnListConverter<PageStyles, PageStyle>))]
public class PageStyles : vlnFormatList<PageStyle>
{
public PageStyles(XmlNodeList xmlNodeList) : base(xmlNodeList) { }
}
#endregion
#region PageStyle
public class PageStyle : vlnFormatItem
{
#region Constructor
public PageStyle(XmlNode xmlNode) : base(xmlNode) { }
public PageStyle() : base() { }
#endregion
#region Business Methods
private LazyLoad<string> _Name;
[DisplayName("Name")]
[Description("Page Style Name")]
public string Name
{
get
{
return LazyLoad(ref _Name, "@Name");
}
}
private LazyLoad<int?> _Index;
[DisplayName("Index")]
[Description("Page Style Index")]
public int? Index
{
get
{
return LazyLoad(ref _Index, "@Index");
}
}
private PageItems _PageItems;
public PageItems PageItems
{
get
{
return (_PageItems == null)? _PageItems = new PageItems(SelectNodes("Item")): _PageItems;
}
}
#endregion
#region Override ToString
public override string ToString()
{
return string.Format("{0:D2} - {1}", Index, Name);
}
#endregion
}
#endregion
#region PageItems
[TypeConverter(typeof(vlnListConverter<PageItems, PageItem>))]
public class PageItems : vlnFormatList<PageItem>
{
public PageItems(XmlNodeList xmlNodeList) : base(xmlNodeList) { }
}
#endregion
#region PageItem
public class PageItem : vlnFormatItem
{
#region Constructor
public PageItem(XmlNode xmlNode) : base(xmlNode) { }
public PageItem() : base() { }
#endregion
#region Business Methods
private VE_Font _Font;
[Category("Font")]
[DisplayName("Font")]
[Description("Font")]
public VE_Font Font
{
get
{
return (_Font == null) ?_Font = new VE_Font(XmlNode): _Font;
}
}
private LazyLoad<string> _Token;
[Category("Content")]
[DisplayName("Content")]
[Description("Item Content")]
public string Token
{
get
{
return LazyLoad(ref _Token, "@Token");
}
}
private LazyLoad<float?> _Row;
[Category("Location")]
[DisplayName("Vertical Position")]
[Description("Vertical Position")]
public float? Row
{
get
{
return LazyLoad(ref _Row, "@Row");
}
}
private LazyLoad<float?> _Col;
[Category("Location")]
[DisplayName("Horizontal Position")]
[Description("Horizontal Position")]
public float? Col
{
get
{
return LazyLoad(ref _Col, "@Col");
}
}
private LazyLoad<E_Justify?> _Justify;
public E_Justify? Justify
{
get
{
return LazyLoad<E_Justify>(ref _Justify, "@Justify");
}
}
private LazyLoad<int?> _MaxWidth;
public int? MaxWidth
{
get
{
return (LazyLoad(ref _MaxWidth, "@MaxWidth"));
}
}
// MaxWidth, above, flagged that, if there was more than 1 line, the topmargin would be adjusted by however
// many lines the PSI item contained (for wst alarms). The MaxWidthCurPage is used when that adjustment
// should not be made, the length of the PSI item is only relevant for the current page.
// (see AdjustTopMarginForMultiLinePageListItems variable and how it is used)
private LazyLoad<int?> _MaxWidthCurPage;
public int? MaxWidthCurPage
{
get
{
return (LazyLoad(ref _MaxWidthCurPage, "@MaxWidthCurPage"));
}
}
#endregion
#region Override ToString
public override string ToString()
{
//return string.Format("({0:D5},{1:D5}) - {2}",Row,Col,Token);
return Token;
}
public override string GetPDDisplayName()
{ return string.Format("({0},{1})",Row,Col); }
#endregion
}
#endregion
}