Change the ReplaceSymbolChars list to an indexed list (like transitions)

This commit is contained in:
John Jenko 2017-06-01 15:09:59 +00:00
parent 4163b9d46f
commit 9bf88111f1

View File

@ -1982,7 +1982,7 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
return (_ReplaceSymbolCharList == null) ? _ReplaceSymbolCharList = new ReplaceSymbolCharList(SelectNodes("ReplaceSymbolChars/ReplaceChar")) : _ReplaceSymbolCharList; return (_ReplaceSymbolCharList == null) ? _ReplaceSymbolCharList = new ReplaceSymbolCharList(SelectNodes("ReplaceSymbolChars/ReplaceChar"),MyFormat) : _ReplaceSymbolCharList;
} }
set { _ReplaceSymbolCharList = value; } set { _ReplaceSymbolCharList = value; }
} }
@ -3010,10 +3010,18 @@ namespace VEPROMS.CSLA.Library
#endregion #endregion
#region ReplaceChar #region ReplaceChar
[TypeConverter(typeof(ExpandableObjectConverter))] [TypeConverter(typeof(ExpandableObjectConverter))]
public class ReplaceChar : vlnFormatItem public class ReplaceChar : vlnFormatItem, IVlnIndexedFormatItem
{ {
public ReplaceChar(XmlNode xmlNode) : base(xmlNode) { } public ReplaceChar(XmlNode xmlNode) : base(xmlNode) { }
public ReplaceChar() : base() { } public ReplaceChar() : base() { }
private LazyLoad<int?> _Index;
public int? Index
{
get
{
return LazyLoad(ref _Index, "@Index");
}
}
[Category("Strings")] [Category("Strings")]
private LazyLoad<string> _Unicode; private LazyLoad<string> _Unicode;
public string Unicode public string Unicode
@ -3072,24 +3080,34 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _Size, "@Size"); return LazyLoad(ref _Size, "@Size");
} }
} }
//public override string GetPDDisplayName() public override string GetPDDisplayName()
//{ return Unicode; } { return Unicode; }
//public override string GetPDDescription() public override string GetPDDescription()
//{ return string.Format("Replace '{0}' with '{1}'", Unicode, Replace); } { return string.Format("Replace '{0}' with '{1}'", Unicode, Replace); }
//public override string GetPDCategory() public override string GetPDCategory()
//{ return "Chars to Replace"; } { return "Chars to Replace"; }
//public override string ToString() public override string ToString()
//{ {
// return Replace; return Replace;
//} }
} }
#endregion #endregion
#region ReplaceSymbolCharList #region ReplaceSymbolCharList
[TypeConverter(typeof(vlnListConverter<ReplaceSymbolCharList, ReplaceChar>))] [TypeConverter(typeof(vlnIndexedListConverter<ReplaceSymbolCharList, ReplaceChar>))]
public class ReplaceSymbolCharList : vlnFormatList<ReplaceChar> public class ReplaceSymbolCharList : vlnIndexedFormatList<ReplaceChar>
{ {
public ReplaceSymbolCharList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } public ReplaceSymbolCharList(XmlNodeList xmlNodeList, IFormatOrFormatInfo myFormat) : base(xmlNodeList, myFormat) { }
public override vlnIndexedFormatList<ReplaceChar> InheritedList
{
get
{
IFormatOrFormatInfo parentFormat = MyFormat.MyIParent;
if (parentFormat != null)
return parentFormat.PlantFormat.FormatData.SectData.ReplaceSymbolCharList;
return null;
}
}
} }
#endregion #endregion
#region StepSectionLayoutData #region StepSectionLayoutData