private void OnActivated(object item) { LoopValueItemField field = (LoopValueItemField)item; if (throwEvent && Activated != null) { Activated(this); } }
public LoopValueItemField Add(LoopValueItemField field) { field.Deleted += OnDeleted; field.Activated += OnActivated; Panel.Children.Add(field); if (throwEvent) { this.ValueListChangeHandler.AddNew(field.LoopValue); } if (throwEvent && Updated != null) { Updated(this); } onChange(); return(field); }
public void Remove(LoopValueItemField field) { Panel.Children.Remove(field); this.ValueListChangeHandler.AddDeleted(field.LoopValue); int index = 1; foreach (object pan in Panel.Children) { ((LoopValueItemField)pan).Index = index++; } if (throwEvent && Updated != null) { Updated(this); } onChange(); }
public void SetValue(object value) { if (this.Line == null) { if (throwEvent && Added != null) { Added(this); } } if (value is IList) { var liste = value as IList; throwEvent = false; for (int i = 0; i < liste.Count; i++) { TransformationTreeLoopValue item = new TransformationTreeLoopValue(ValueListChangeHandler.Items.Count + 1, liste[i]); LoopValueItemField field = this.Add(item); if (field != null) { this.ValueListChangeHandler.AddNew(field.LoopValue); } } throwEvent = true; if (liste.Count > 0 && throwEvent && Added != null) { Updated(this); } if (liste.Count > 0) { onChange(); } } else { TransformationTreeLoopValue item = new TransformationTreeLoopValue(ValueListChangeHandler.Items.Count + 1, value); this.Add(item); } }
public void Display(TransformationTreeItem item) { throwEvent = false; this.Clear(); this.Line = item; ValueListChangeHandler = new PersistentListChangeHandler <TransformationTreeLoopValue>(); if (item == null) { return; } ValueListChangeHandler.originalList = new List <TransformationTreeLoopValue>(item.valueListChangeHandler.Items); int index = 1; foreach (TransformationTreeLoopValue loopValue in ValueListChangeHandler.Items) { //loopValue.updatePeriod(Periodicity); LoopValueItemField itemField = new LoopValueItemField(loopValue); Add(itemField); index++; } throwEvent = true; }
private void OnDeleted(object item) { LoopValueItemField field = (LoopValueItemField)item; this.Remove(field); }
public LoopValueItemField Add(TransformationTreeLoopValue item) { LoopValueItemField field = new LoopValueItemField(item); return(this.Add(field));; }