using System; using System.Collections.Generic; using System.Text; using System.ComponentModel; using System.Xml; namespace VEPROMS.CSLA.Library { #region PageStyles [TypeConverter(typeof(vlnListConverter))] public class PageStyles : vlnFormatList { 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 _Name; [DisplayName("Name")] [Description("Page Style Name")] public string Name { get { return LazyLoad(ref _Name, "@Name"); } } private LazyLoad _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))] public class PageItems : vlnFormatList { 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 _Token; [Category("Content")] [DisplayName("Content")] [Description("Item Content")] public string Token { get { return LazyLoad(ref _Token, "@Token"); } } private LazyLoad _Row; [Category("Location")] [DisplayName("Vertical Position")] [Description("Vertical Position")] public float? Row { get { return LazyLoad(ref _Row, "@Row"); } } private LazyLoad _Col; [Category("Location")] [DisplayName("Horizontal Position")] [Description("Horizontal Position")] public float? Col { get { return LazyLoad(ref _Col, "@Col"); } } private LazyLoad _Justify; public E_Justify? Justify { get { return LazyLoad(ref _Justify, "@Justify"); } } private LazyLoad _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 _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 }