// Constructor, copy from existing PLM. public Plm(Plm source) : base() { PlmID = source.PlmID; PosX = source.PosX; PosY = source.PosY; MainVariable = source.MainVariable; MyPlmType = source.MyPlmType; MyScrollPlmData = null; }
// Constructor. public Plm() : base() { PlmID = 0; PosX = 0; PosY = 0; MainVariable = 0; MyPlmType = null; MyScrollPlmData = null; }
// Constructor, copy from existing scroll PLM data. public ScrollPlmData(ScrollPlmData source) : base() { Entries = new List <int> (); MyPlms = new HashSet <Plm> (); foreach (int i in source.Entries) { Entries.Add(i); } }
private bool ForceAddScrollPlmData() { if (ActivePlm.PlmID == Plm.ScrollID && ActivePlm.MyScrollPlmData == null) { ScrollPlmData newData = new ScrollPlmData(); newData.MyPlms.Add(ActivePlm); ScrollPlmDatas.Add(newData); ActivePlm.MyScrollPlmData = null; ChangesMade = true; return(true); } return(false); }
public void SetScrollPlmData(ScrollPlmData target, out ScrollPlmData deleteData) { if (target == MyScrollPlmData) { deleteData = null; return; } deleteData = MyScrollPlmData?.UnreferenceMe(this) == 0 ? MyScrollPlmData : null; MyScrollPlmData = null; if (target?.ReferenceMe(this) ?? false) { MyScrollPlmData = target; } }
public bool Connect(List <Data> ScrollPlmDatas, List <PlmType> PlmTypes) { MyPlmType = PlmTypes.Find(x => x.PlmID == PlmID); if (MyPlmType == null) { MyPlmType = PlmTypes [0]; } if (PlmID == ScrollID) { MyScrollPlmData = (ScrollPlmData)ScrollPlmDatas.Find(x => x.StartAddressLR == MainVariable); if (MyScrollPlmData != null) { MyScrollPlmData.MyPlms.Add(this); } return(MyScrollPlmData != null); } else { MyScrollPlmData = null; } return(true); }