265 lines
6.1 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 RelatedItem _RelatedItem;
public RelatedItem RelatedItem
{
get
{
return (_RelatedItem == null) ? _RelatedItem = new RelatedItem(SelectSingleNode("RelatedItem")) : _RelatedItem;
}
}
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<bool> _RepWords; // F2021-053: Do replace words in page list
public bool RepWords
{
get
{
return LazyLoad(ref _RepWords, "@RepWords");
}
}
private LazyLoad<bool> _ROLkUpMatch; // C2021-065 (BNPP Alarms format)
public bool ROLkUpMatch
{
get
{
return LazyLoad(ref _ROLkUpMatch, "@ROLkUpMatch");
}
}
private LazyLoad<bool> _ROLkUpInEditor; // C2021-018 (BNPP Alarms format)
public bool ROLkUpInEditor
{
get
{
return LazyLoad(ref _ROLkUpInEditor, "@ROLkUpInEditor");
}
}
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"));
}
}
private LazyLoad<int?> _FontShrinkAftLen; // F2021-066 & 070 (text len before shrinking font)
public int? FontShrinkAftLen
{
get
{
return (LazyLoad(ref _FontShrinkAftLen, "@FontShrinkAftLen"));
}
}
private LazyLoad<string> _FontTooSmallMsg; // F2021-066 message if can't shrink enough
public string FontTooSmallMsg
{
get
{
return LazyLoad(ref _FontTooSmallMsg, "@FontTooSmallMsg");
}
}
#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
#region RelatedItem
// RelatedItem was added to allow a PSI logical to have an associated PSI item, and if both are
// selected the RelatedItem data changes where the item prints. This was implemented for
// F2017-036 - VCS.
[TypeConverter(typeof(ExpandableObjectConverter))]
public class RelatedItem : vlnFormatItem
{
#region Constructor
public RelatedItem(XmlNode xmlNode) : base(xmlNode) { }
public RelatedItem() : base() { }
#endregion
#region Business Methods
private LazyLoad<string> _Token;
[Category("RelatedContent")]
[DisplayName("RelatedContent")]
[Description("Item RelatedContent")]
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");
}
}
#endregion
}
#endregion
}