From ec264b869dbfba80d76bcc38fb8b04242cf74c53 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 18 Nov 2021 19:26:58 +0000 Subject: [PATCH] C2021-004 get defined table shading options from format file --- .../Format/PlantFormat.cs | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index 1721c0b5..343fc323 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -530,6 +530,16 @@ namespace VEPROMS.CSLA.Library return _FontSizes == null ? _FontSizes = new FontSizes(SelectSingleNode("FontSizes")) : _FontSizes; } } + // C2021-004 This gets the list for additional shading options defined in the format (base) file + private ShadingOptionList _ShadingOptionList; + public ShadingOptionList ShadingOptionList + { + get + { + return (_ShadingOptionList == null) ? _ShadingOptionList = new ShadingOptionList(SelectNodes("MoreShadingOptions/ShadingOption")) : _ShadingOptionList; + } + set { _ShadingOptionList = value; } + } private SymbolList _SymbolList; public SymbolList SymbolList { @@ -890,6 +900,84 @@ namespace VEPROMS.CSLA.Library } } #endregion + #region ShadingOptions + // C2021-004 Additional shading color options defined in the format file + /* Example XML in base format file: + + + + **/ + [TypeConverter(typeof(ExpandableObjectConverter))] + public class ShadingOption : vlnFormatItem + { + public ShadingOption(XmlNode xmlNode) : base(xmlNode) { } + public ShadingOption() : base() { } + [Category("Ints")] + private LazyLoad _Alpha; + public int? Alpha + { + get + { + return LazyLoad(ref _Alpha, "@A"); + } + } + [Category("Ints")] + private LazyLoad _Red; + public int? Red + { + get + { + return LazyLoad(ref _Red, "@R"); + } + } + [Category("Ints")] + private LazyLoad _Green; + public int? Green + { + get + { + return LazyLoad(ref _Green, "@G"); + } + } + [Category("Ints")] + private LazyLoad _Blue; + public int? Blue + { + get + { + return LazyLoad(ref _Blue, "@B"); + } + } + [Category("Strings")] + private LazyLoad _Desc; + public string Desc + { + get + { + return LazyLoad(ref _Desc, "@Desc"); + } + } + public override string GetPDDisplayName() + { return Desc; } + public override string GetPDDescription() + { return string.Format("Shading Description '{0}' Alpha {1} Red {2} Green {3} Blue {4}", Desc, Alpha, Red, Green, Blue); } + public override string GetPDCategory() + { return "Additional Shading Options"; } + public override string ToString() + { + return Desc; + } + public string GetARBGstringForTableCells() + { + return string.Format("[A={0}, R={1}, G={2}, B={3}]", Alpha, Red, Green, Blue); + } + } + [TypeConverter(typeof(vlnListConverter))] + public class ShadingOptionList : vlnFormatList + { + public ShadingOptionList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } + } + #endregion #region Symbols [TypeConverter(typeof(ExpandableObjectConverter))] public class Symbol : vlnFormatItem