C2018-039: Upgrade – User Control of Format
This commit is contained in:
@@ -11,9 +11,56 @@ namespace VEPROMS.CSLA.Library
|
||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
public class PlantFormat
|
||||
{
|
||||
public PlantFormat(IFormatOrFormatInfo format)
|
||||
public PlantFormat(IFormatOrFormatInfo format, string config)
|
||||
{
|
||||
_MyFormat = format;
|
||||
string str = null;
|
||||
if (format is Format) str = (format as Format).Config;
|
||||
else if (format is FormatInfo) str = (format as FormatInfo).Config;
|
||||
if (str != null && str != "") _FormatConfig = FormatConfig.Get(str);
|
||||
}
|
||||
private FormatConfig _FormatConfig;
|
||||
public FormatConfig FormatConfig
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_FormatConfig == null)
|
||||
{
|
||||
_FormatConfig = GetFormatConfig(_MyFormat);
|
||||
}
|
||||
return _FormatConfig;
|
||||
}
|
||||
set { _FormatConfig = value; }
|
||||
}
|
||||
// when IgnoreUCF is true, get the original data, i.e. don't apply any UCF changes to it
|
||||
private static bool _IgnoreUCF = false;
|
||||
public static bool IgnoreUCF
|
||||
{
|
||||
get { return PlantFormat._IgnoreUCF; }
|
||||
set { PlantFormat._IgnoreUCF = value; }
|
||||
}
|
||||
// flags that the User Control of Format setting for using additional UCF checkoffs is active
|
||||
private static bool _DoingUCFCheckOffs = false;
|
||||
public static bool DoingUCFCheckOffs
|
||||
{
|
||||
get { return PlantFormat._DoingUCFCheckOffs; }
|
||||
set { PlantFormat._DoingUCFCheckOffs = value; }
|
||||
}
|
||||
// flags the value that should be used (true/false) for using additional UCF checkoffs (used with DoingUCFCheckOffs)
|
||||
private static bool _DoingUCFCheckOffsUse = false;
|
||||
public static bool DoingUCFCheckOffsUse
|
||||
{
|
||||
get { return PlantFormat._DoingUCFCheckOffsUse; }
|
||||
set { PlantFormat._DoingUCFCheckOffsUse = value; }
|
||||
}
|
||||
public static FormatConfig GetFormatConfig(IFormatOrFormatInfo format)
|
||||
{
|
||||
FormatConfig fc = null;
|
||||
string str = null;
|
||||
if (format is Format) str = (format as Format).Config;
|
||||
else if (format is FormatInfo) str = (format as FormatInfo).Config;
|
||||
if (str != null && str != "") fc = FormatConfig.Get(str);
|
||||
return fc;
|
||||
}
|
||||
private IFormatOrFormatInfo _MyFormat;
|
||||
public IFormatOrFormatInfo MyFormat
|
||||
@@ -58,12 +105,76 @@ namespace VEPROMS.CSLA.Library
|
||||
return _DocStyles;
|
||||
}
|
||||
}
|
||||
public bool HasPageListToken(string token)
|
||||
{;
|
||||
string xpath = string.Format("/PlantFormat/PageStyles/PageStyle/Item[@Token = '{0}']", token);
|
||||
XmlNodeList nl = XmlDoc.SelectNodes(xpath);
|
||||
return nl.Count > 0;
|
||||
}
|
||||
public bool HasPageListToken(string token)
|
||||
{
|
||||
string xpath = string.Format("/PlantFormat/PageStyles/PageStyle/Item[@Token = '{0}']", token);
|
||||
XmlNodeList nl = XmlDoc.SelectNodes(xpath);
|
||||
return nl.Count > 0;
|
||||
}
|
||||
private FormatConfig.ReplaceStrData _UCFandOrigReplaceStrData = null;
|
||||
public FormatConfig.ReplaceStrData UCFandOrigReplaceStrData
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_UCFandOrigReplaceStrData != null) return _UCFandOrigReplaceStrData;
|
||||
_UCFandOrigReplaceStrData = GetMergedReplaceList(this);
|
||||
return _UCFandOrigReplaceStrData;
|
||||
}
|
||||
}
|
||||
private FormatConfig.ReplaceStrData GetMergedReplaceList(PlantFormat OriginalPlantFormat)
|
||||
{
|
||||
// need to compare the original format list with the list as it is stored for working with property grid.
|
||||
FormatConfig.ReplaceStrData retlist = new FormatConfig.ReplaceStrData(); // merged list
|
||||
List<string> inoriglist = new List<string>(); // use this list to find new items in formatconfig (see below)
|
||||
foreach (ReplaceStr origrepstr in OriginalPlantFormat.FormatData.SectData.ReplaceStrList)
|
||||
{
|
||||
// In the format config list (UCF), find the 'ReplaceWord'. This is the 'key' for defining whether the
|
||||
// replace word has been overwridden by UCF data. If it exists, use it:
|
||||
FormatConfig.ReplaceStr usethisone = null;
|
||||
bool deleted = false;
|
||||
// States for replacewords: 0 = no change, -1 deleted, 1 added, 2 modified
|
||||
if (FormatConfig != null)
|
||||
{
|
||||
foreach (FormatConfig.ReplaceStr ucfrepstr in FormatConfig.PlantFormat.FormatData.ReplaceStrData)
|
||||
{
|
||||
if (ucfrepstr.ReplaceWord == origrepstr.ReplaceWord)
|
||||
{
|
||||
if (ucfrepstr.State == -1) deleted = true;
|
||||
else usethisone = ucfrepstr;
|
||||
ucfrepstr.State = 2;
|
||||
inoriglist.Add(origrepstr.ReplaceWord);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!deleted && usethisone == null)
|
||||
{
|
||||
usethisone = new FormatConfig.ReplaceStr();
|
||||
usethisone.Flag = (FormatConfig.E_ReplaceFlagsUCF)origrepstr.Flag;
|
||||
usethisone.State = 0; // no change
|
||||
usethisone.ReplaceWith = origrepstr.ReplaceWith;
|
||||
usethisone.ReplaceWord = origrepstr.ReplaceWord;
|
||||
}
|
||||
if (!deleted) retlist.Add(usethisone);
|
||||
}
|
||||
// now add in any ucf only replacements, any that are not in the inoriglist
|
||||
if (FormatConfig != null)
|
||||
{
|
||||
foreach (FormatConfig.ReplaceStr ucfrepstr in FormatConfig.PlantFormat.FormatData.ReplaceStrData)
|
||||
{
|
||||
if (!inoriglist.Contains(ucfrepstr.ReplaceWord))
|
||||
{
|
||||
FormatConfig.ReplaceStr newone = new FormatConfig.ReplaceStr();
|
||||
newone.Flag = (FormatConfig.E_ReplaceFlagsUCF)ucfrepstr.Flag;
|
||||
newone.State = 1;
|
||||
newone.ReplaceWith = ucfrepstr.ReplaceWith;
|
||||
newone.ReplaceWord = ucfrepstr.ReplaceWord;
|
||||
retlist.Add(newone);
|
||||
}
|
||||
}
|
||||
}
|
||||
return (retlist);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region VE_Font
|
||||
@@ -71,12 +182,20 @@ namespace VEPROMS.CSLA.Library
|
||||
public class VE_Font : vlnFormatItem
|
||||
{
|
||||
public VE_Font(XmlNode xmlNode) : base(xmlNode) { }
|
||||
private string _ffam = null;
|
||||
private int _fsize = 0;
|
||||
private E_Style _fstyle = E_Style.None;
|
||||
private float _fcpi = 0;
|
||||
public VE_Font(string family, int size, E_Style style, float CPI)
|
||||
{
|
||||
_Family = new LazyLoad<string>(family);
|
||||
_Size = new LazyLoad<int?>(size);
|
||||
_Style = new LazyLoad<E_Style?>(style);
|
||||
_CPI = new LazyLoad<float?>(CPI);
|
||||
_ffam = family;
|
||||
_fsize = size;
|
||||
_fstyle = style;
|
||||
_fcpi = CPI;
|
||||
}
|
||||
private LazyLoad<string> _Family;
|
||||
private static Dictionary<string, Font> _WinFontLookup = new Dictionary<string, Font>();
|
||||
@@ -127,10 +246,15 @@ namespace VEPROMS.CSLA.Library
|
||||
style |= FontStyle.Underline;
|
||||
}
|
||||
// for now - check size to be 0 and set to 10 if so, error in fmtxml?
|
||||
if (Family == null) // Need to get inherited font
|
||||
_WindowsFont = GetFont("Arial", 10, FontStyle.Regular);
|
||||
else
|
||||
_WindowsFont = GetFont(Family, Size == 0 ? 10 : (float)Size, style);
|
||||
if (Family == null) // Need to get inherited font
|
||||
_WindowsFont = GetFont("Arial", 10, FontStyle.Regular);
|
||||
else
|
||||
{
|
||||
//if (_ffam != null)
|
||||
// _WindowsFont = GetFont(_ffam, (float)_fsize, style); // this needs work.
|
||||
//else
|
||||
_WindowsFont = GetFont(Family, Size == 0 ? 10 : (float)Size, style);
|
||||
}
|
||||
}
|
||||
return _WindowsFont;
|
||||
}
|
||||
@@ -1107,13 +1231,13 @@ namespace VEPROMS.CSLA.Library
|
||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
public class ProcData : vlnFormatItem
|
||||
{
|
||||
public ProcData(XmlNode xmlNode): base(xmlNode) {}
|
||||
public ProcData(XmlNode xmlNode) : base(xmlNode) { }
|
||||
private ProcedureSuffixList _ProcedureSuffixList;
|
||||
public ProcedureSuffixList ProcedureSuffixList
|
||||
{
|
||||
get
|
||||
{
|
||||
return _ProcedureSuffixList == null? _ProcedureSuffixList = new ProcedureSuffixList(SelectNodes("ProcedureSuffix/string")): _ProcedureSuffixList;
|
||||
return _ProcedureSuffixList == null ? _ProcedureSuffixList = new ProcedureSuffixList(SelectNodes("ProcedureSuffix/string")) : _ProcedureSuffixList;
|
||||
}
|
||||
set { _ProcedureSuffixList = value; }
|
||||
}
|
||||
@@ -1122,7 +1246,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
get
|
||||
{
|
||||
return _ChangeBarData == null? _ChangeBarData = new ChangeBarData(SelectSingleNode("ChangeBarData")):_ChangeBarData;
|
||||
return _ChangeBarData == null ? _ChangeBarData = new ChangeBarData(SelectSingleNode("ChangeBarData")) : _ChangeBarData;
|
||||
}
|
||||
}
|
||||
private CheckOffData _CheckOffData;
|
||||
@@ -1130,7 +1254,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
get
|
||||
{
|
||||
return _CheckOffData == null? _CheckOffData = new CheckOffData(SelectSingleNode("CheckOffData")):_CheckOffData;
|
||||
return _CheckOffData == null ? _CheckOffData = new CheckOffData(SelectSingleNode("CheckOffData")) : _CheckOffData;
|
||||
}
|
||||
}
|
||||
private PSI _PSI;
|
||||
@@ -1141,29 +1265,47 @@ namespace VEPROMS.CSLA.Library
|
||||
return _PSI == null ? _PSI = new PSI(SelectSingleNode("PSI")) : _PSI;
|
||||
}
|
||||
}
|
||||
private LazyLoad<bool> _CheckOffUCF;
|
||||
public bool CheckOffUCF
|
||||
{
|
||||
get
|
||||
{
|
||||
// The following line is used in UCF: this needs to be able to control a change in setting in UCF versus its use:
|
||||
// This is a special case since the original format, using the value in BaseAll, is always 'false'. And the value
|
||||
// should never be set in original volian plant format files, if the additional UCF checkoffs are to be used, this must
|
||||
// be set in the UCF user interface.
|
||||
if (PlantFormat.DoingUCFCheckOffs) return PlantFormat.DoingUCFCheckOffsUse;
|
||||
|
||||
if (PlantFormat.IgnoreUCF) return LazyLoad(ref _CheckOffUCF, "@CheckOffUCF");
|
||||
bool? localvalue = null; // comes to here if in edit or print - use any UCF data before going to original format.
|
||||
FormatConfig fc = PlantFormat.GetFormatConfig(MyFormat);
|
||||
if (fc != null) localvalue = fc.PlantFormat.FormatData.Flags.CheckOffUCF;
|
||||
return localvalue ?? LazyLoad(ref _CheckOffUCF, "@CheckOffUCF");
|
||||
}
|
||||
}
|
||||
private LazyLoad<int?> _TitleLength;
|
||||
public int? TitleLength
|
||||
{
|
||||
get
|
||||
{
|
||||
get
|
||||
{
|
||||
return LazyLoad(ref _TitleLength, "@TitleLength");
|
||||
}
|
||||
}
|
||||
}
|
||||
private LazyLoad<int?> _CoverTitleLength;
|
||||
public int? CoverTitleLength
|
||||
{
|
||||
get
|
||||
{
|
||||
get
|
||||
{
|
||||
return LazyLoad(ref _CoverTitleLength, "@CoverTitleLength");
|
||||
}
|
||||
}
|
||||
}
|
||||
private LazyLoad<string> _ProcedureSuffixFlags;
|
||||
public string ProcedureSuffixFlags
|
||||
{
|
||||
get
|
||||
{
|
||||
get
|
||||
{
|
||||
return LazyLoad(ref _ProcedureSuffixFlags, "@ProcedureSuffixFlags");
|
||||
}
|
||||
return LazyLoad(ref _ProcedureSuffixFlags, "@ProcedureSuffixFlags");
|
||||
}
|
||||
}
|
||||
private LazyLoad<bool> _CapitalizeTitle;
|
||||
public bool CapitalizeTitle
|
||||
@@ -1503,22 +1645,146 @@ namespace VEPROMS.CSLA.Library
|
||||
public class CheckOffData : vlnFormatItem
|
||||
{
|
||||
public CheckOffData(XmlNode xmlNode) : base(xmlNode) { }
|
||||
private CheckOffList _CheckOffList;
|
||||
private CheckOffList _CheckOffList = null;
|
||||
public CheckOffList CheckOffList
|
||||
{
|
||||
get
|
||||
{
|
||||
return _CheckOffList == null? _CheckOffList = new CheckOffList(SelectNodes("CheckOffList/CheckOff"),MyFormat):_CheckOffList;
|
||||
if (_CheckOffList != null) return _CheckOffList;
|
||||
|
||||
// Get a list of checkoffs that should be included:
|
||||
// if !UseCheckOffUCF (Baseall has it as false. User can change setting in UCF to true)
|
||||
// if !IgnoreUCF, i.e. use UCF changes, return original lists with only active items (Inactive = false)
|
||||
// if IgnoreUCF, return original lists with all items
|
||||
// if UseCheckOffUCF is true use the merged lists from current format and baseall.xml and
|
||||
// do the same processing for IgnoreUCF described above.
|
||||
|
||||
// UseCheckOffUCF is false or there is no FormatConfig (UCF) data:
|
||||
FormatConfig fc = PlantFormat.GetFormatConfig(MyFormat);
|
||||
if (!MyFormat.PlantFormat.FormatData.ProcData.CheckOffUCF || fc==null)
|
||||
{
|
||||
_CheckOffList = new CheckOffList(SelectNodes("CheckOffList/CheckOff"), MyFormat);
|
||||
// If Ignoring the UCF data, just return the entire list. Also, return entire list if there is no UCF data (fc == null)
|
||||
if (!PlantFormat.IgnoreUCF || fc == null) return _CheckOffList;
|
||||
// If not ignoring UCF settings, only return those that are active
|
||||
foreach (FormatConfig.CheckOff co in fc.PlantFormat.FormatData.CheckOffList)
|
||||
{
|
||||
foreach (CheckOff coo in _CheckOffList)
|
||||
{
|
||||
if ((int)coo.Index == Convert.ToInt32(co.Index) && !(bool)co.Active)
|
||||
{
|
||||
_CheckOffList.Remove(coo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return _CheckOffList;
|
||||
}
|
||||
// UseCheckOfffUCF is true:
|
||||
// merge the checkoff list from the current format and the checkoff list from the base format
|
||||
_CheckOffList = new CheckOffList(SelectNodes("CheckOffList/CheckOff"), MyFormat);
|
||||
CheckOffList retlist2 = new CheckOffList(SelectNodes("../CheckOffDataUCF/CheckOffList/CheckOff"), MyFormat);
|
||||
if (retlist2 != null && retlist2.Count > 0) foreach (CheckOff co in retlist2) _CheckOffList.Add(co);
|
||||
if (PlantFormat.IgnoreUCF) return _CheckOffList;
|
||||
|
||||
// if applying UCF, then remove those that are inactive:
|
||||
foreach (FormatConfig.CheckOff co in fc.PlantFormat.FormatData.CheckOffList)
|
||||
{
|
||||
foreach (CheckOff coo in _CheckOffList)
|
||||
{
|
||||
if ((int)coo.Index == Convert.ToInt32(co.Index) && !(bool)co.Active)
|
||||
{
|
||||
_CheckOffList.Remove(coo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return _CheckOffList;
|
||||
}
|
||||
}
|
||||
public void ClearCheckOffAndHeaderLists()
|
||||
{
|
||||
_CheckOffList = null;
|
||||
_CheckOffHeaderList = null;
|
||||
}
|
||||
private CheckOffHeaderList _CheckOffHeaderList;
|
||||
public CheckOffHeaderList CheckOffHeaderList
|
||||
{
|
||||
get
|
||||
{
|
||||
return _CheckOffHeaderList == null? _CheckOffHeaderList = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"),MyFormat): _CheckOffHeaderList;
|
||||
if (_CheckOffHeaderList != null) return _CheckOffHeaderList;
|
||||
FormatConfig fc = PlantFormat.GetFormatConfig(MyFormat);
|
||||
if (!MyFormat.PlantFormat.FormatData.ProcData.CheckOffUCF || fc == null)
|
||||
{
|
||||
_CheckOffHeaderList = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"), MyFormat);
|
||||
// Depending on the IgnoreUCF flag, either return this list with UCF Inactive flags set or return the
|
||||
// list as is.
|
||||
if (PlantFormat.IgnoreUCF || fc == null) return _CheckOffHeaderList;
|
||||
// If not ignoring UCF settings, only return those that are active
|
||||
foreach (FormatConfig.CheckOffHeader coh in fc.PlantFormat.FormatData.CheckOffHeaderList)
|
||||
{
|
||||
foreach (CheckOffHeader coo in _CheckOffHeaderList)
|
||||
{
|
||||
if ((int)coo.Index == Convert.ToInt32(coh.Index) && !(bool)coh.Active)
|
||||
{
|
||||
_CheckOffHeaderList.Remove(coo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return _CheckOffHeaderList;
|
||||
}
|
||||
// merge the checkoff header lists from the current format and the list from the base
|
||||
_CheckOffHeaderList = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"), MyFormat);
|
||||
CheckOffHeaderList retlist2 = new CheckOffHeaderList(SelectNodes("../CheckOffDataUCF/CheckOffHeaderList/CheckOffHeader"), MyFormat);
|
||||
if (retlist2 != null && retlist2.Count > 0) foreach (CheckOffHeader co in retlist2) _CheckOffHeaderList.Add(co);
|
||||
if (PlantFormat.IgnoreUCF) return _CheckOffHeaderList;
|
||||
|
||||
// if applying UCF, then remove those that are inactive.
|
||||
foreach (FormatConfig.CheckOffHeader coh in fc.PlantFormat.FormatData.CheckOffHeaderList)
|
||||
{
|
||||
foreach (CheckOffHeader cooh in _CheckOffHeaderList)
|
||||
{
|
||||
if ((int)cooh.Index == Convert.ToInt32(coh.Index) && !(bool)coh.Active)
|
||||
{
|
||||
_CheckOffHeaderList.Remove(cooh);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return _CheckOffHeaderList;
|
||||
}
|
||||
}
|
||||
public void CheckOffHeaderListRefresh(bool CheckOffUCF)
|
||||
{
|
||||
if (!CheckOffUCF)
|
||||
{
|
||||
_CheckOffHeaderList = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"), MyFormat);
|
||||
// Depending on the IgnoreUCF flag, either return this list with UCF Inactive flags set or return the
|
||||
// list as is.
|
||||
FormatConfig fc = PlantFormat.GetFormatConfig(MyFormat);
|
||||
if (PlantFormat.IgnoreUCF || fc == null) return;
|
||||
// If not ignoring UCF settings, only return those that are active
|
||||
foreach (FormatConfig.CheckOffHeader coh in fc.PlantFormat.FormatData.CheckOffHeaderList)
|
||||
{
|
||||
foreach (CheckOffHeader coo in _CheckOffHeaderList)
|
||||
{
|
||||
if ((int)coo.Index == Convert.ToInt32(coh.Index) && !(bool)coh.Active)
|
||||
{
|
||||
_CheckOffHeaderList.Remove(coo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
// if coming from the UCF dialog, then check for the 'ignoreUCF' this will flag whether to only
|
||||
// merge the checkoff header lists from the current format and the list from the base
|
||||
CheckOffHeaderList retlist = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"), MyFormat);
|
||||
CheckOffHeaderList retlist2 = new CheckOffHeaderList(SelectNodes("../CheckOffDataUCF/CheckOffHeaderList/CheckOffHeader"), MyFormat);
|
||||
if (retlist2 != null && retlist2.Count > 0) foreach (CheckOffHeader co in retlist2) retlist.Add(co);
|
||||
_CheckOffHeaderList = retlist;
|
||||
}
|
||||
private LazyLoad<bool> _CheckOffHeaderInPagelist;
|
||||
public bool CheckOffHeaderInPagelist
|
||||
{
|
||||
@@ -1619,57 +1885,6 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
//#region RightCheckOffBox
|
||||
//[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
//public class RightCheckOffBox : vlnFormatItem, IVlnIndexedFormatItem
|
||||
//{
|
||||
// public RightCheckOffBox(XmlNode xmlNode) : base(xmlNode) { }
|
||||
// public RightCheckOffBox() : base() { }
|
||||
// private LazyLoad<int?> _Index;
|
||||
// public int? Index
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return LazyLoad(ref _Index, "@Index");
|
||||
// }
|
||||
// }
|
||||
// private LazyLoad<int?> _RightCheckOffBoxChar;
|
||||
// public int? RightCheckOffBoxChar
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return LazyLoad(ref _RightCheckOffBoxChar, "@RightCheckOffBoxChar");
|
||||
// }
|
||||
// }
|
||||
// public override string GetPDDisplayName()
|
||||
// { return string.Format("[{0}]", Index); }
|
||||
// public override string GetPDDescription()
|
||||
// { return string.Format("[{0}] - {1}", Index, RightCheckOffBoxChar); }
|
||||
// public override string GetPDCategory()
|
||||
// { return "RightCheckOffBox Data"; }
|
||||
// public override string ToString()
|
||||
// {
|
||||
// return RightCheckOffBoxChar.ToString();
|
||||
// }
|
||||
//}
|
||||
//#endregion
|
||||
//#region RightCheckOffBoxList
|
||||
//[TypeConverter(typeof(vlnIndexedListConverter<RightCheckOffBoxList, RightCheckOffBox>))]
|
||||
//public class RightCheckOffBoxList : vlnIndexedFormatList<RightCheckOffBox>
|
||||
//{
|
||||
// public RightCheckOffBoxList(XmlNodeList xmlNodeList,IFormatOrFormatInfo myFormat) : base(xmlNodeList,myFormat) { }
|
||||
// public override vlnIndexedFormatList<RightCheckOffBox> InheritedList
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// IFormatOrFormatInfo parentFormat = MyFormat.MyIParent;
|
||||
// if (parentFormat != null)
|
||||
// return parentFormat.PlantFormat.FormatData.ProcData.CheckOffData.RightCheckOffBoxList;
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//#endregion
|
||||
#region CheckOff
|
||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
public class CheckOff : vlnFormatItem,IVlnIndexedFormatItem
|
||||
@@ -3531,7 +3746,11 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
get
|
||||
{
|
||||
return LazyLoad(ref _CompressSteps, "@CompressSteps");
|
||||
if (PlantFormat.IgnoreUCF) return LazyLoad(ref _CompressSteps, "@CompressSteps");
|
||||
bool? localvalue = null;
|
||||
FormatConfig fc = PlantFormat.GetFormatConfig(MyFormat);
|
||||
if (fc != null) localvalue = fc.PlantFormat.FormatData.Flags.CompressSteps;
|
||||
return localvalue ?? LazyLoad(ref _CompressSteps, "@CompressSteps");
|
||||
}
|
||||
}
|
||||
private LazyLoad<bool> _DoSTExtraAtTop;
|
||||
@@ -3718,7 +3937,11 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
get
|
||||
{
|
||||
return LazyLoad(ref _PartialStepCompression, "@PartialStepCompression");
|
||||
if (PlantFormat.IgnoreUCF) return LazyLoad(ref _PartialStepCompression, "@PartialStepCompression");
|
||||
bool? localvalue = null;
|
||||
FormatConfig fc = PlantFormat.GetFormatConfig(MyFormat);
|
||||
if (fc != null) localvalue = fc.PlantFormat.FormatData.Flags.PartialStepCompression;
|
||||
return localvalue ?? LazyLoad(ref _PartialStepCompression, "@PartialStepCompression");
|
||||
}
|
||||
}
|
||||
private LazyLoad<bool> _VirtualDotInHLSTab;
|
||||
@@ -5072,11 +5295,41 @@ namespace VEPROMS.CSLA.Library
|
||||
return LazyLoad(ref _Quoted, "@Quoted");
|
||||
}
|
||||
}
|
||||
private VE_Font GetUCFFontAsVE_Font()
|
||||
{
|
||||
// if formatconfig & step list, then go through to see if index exists, if so and if there is a font, use it:
|
||||
if (MyFormat.PlantFormat.FormatConfig != null && MyFormat.PlantFormat.FormatConfig.PlantFormat != null && MyFormat.PlantFormat.FormatConfig.PlantFormat.FormatData != null && MyFormat.PlantFormat.FormatConfig.PlantFormat.FormatData.StepData != null)
|
||||
{
|
||||
foreach (FormatConfig.Step stp in MyFormat.PlantFormat.FormatConfig.PlantFormat.FormatData.StepData)
|
||||
{
|
||||
if (Convert.ToInt32(stp.Index) == (int)Index && stp.FontDesc != null && stp.FontDesc.Font != null && stp.FontDesc.Font != "")
|
||||
{
|
||||
System.Drawing.FontConverter cvt = new System.Drawing.FontConverter();
|
||||
System.Drawing.Font windowsFont = cvt.ConvertFromString(stp.FontDesc.Font) as System.Drawing.Font;
|
||||
|
||||
E_Style myStyle = E_Style.None;
|
||||
if (windowsFont.Bold) myStyle |= E_Style.Bold;
|
||||
if (windowsFont.Underline) myStyle |= E_Style.Underline;
|
||||
if (windowsFont.Italic) myStyle |= E_Style.Italics;
|
||||
return (new VE_Font(windowsFont.Name, (int)windowsFont.Size, myStyle, windowsFont.SizeInPoints));
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private VE_Font _Font;
|
||||
public VE_Font Font
|
||||
{
|
||||
get
|
||||
{
|
||||
if (PlantFormat.IgnoreUCF) return (_Font == null) ?_Font = new VE_Font(base.XmlNode): _Font;
|
||||
if (_Font != null) return (_Font);
|
||||
VE_Font vef = GetUCFFontAsVE_Font();
|
||||
if (vef != null)
|
||||
{
|
||||
_Font = vef;
|
||||
return vef;
|
||||
}
|
||||
return (_Font == null) ?_Font = new VE_Font(base.XmlNode): _Font;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user