public void Notify(IChildControl child, params object[] args) { int pageIdx = GetPageControlIndex(child); var button = this.pageList.Items[pageIdx] as ToolStripButton; var warning = (bool)args[0]; bool wasChange; if (warning) { wasChange = (button.Image == null); button.Image = this.imageList1.Images[0]; } else { wasChange = (button.Image != null); button.Image = null; } if (wasChange) { this.totalWarnings = warning ? this.totalWarnings + 1 : this.totalWarnings - 1; } this.lbWarningMsg.Visible = (this.totalWarnings > 0); }
public bool Remove(IChildControl item) { var rsltSelf = this.children.Remove(item); var rsltItem = item.RemoveFromParent(this); return(rsltSelf || rsltSelf); }
public void AddAfter(IChildControl child, IChildControl prevChild) { if (child is null) { throw new ArgumentNullException(nameof(child)); } if (prevChild is null) { this.children.AddLast(child); return; } LinkedListNode <IChildControl> node; while (!((node = this.children.Last) is null)) { if (object.ReferenceEquals(node.Value, prevChild)) { this.children.AddAfter(node, prevChild); return; } } this.children.AddLast(child); }
public void Add(IChildControl item) { if (item is null) { throw new ArgumentNullException(nameof(item)); } item.RemoveFromParent(); this.children.AddLast(item); }
private int GetPageControlIndex(IChildControl control) { int result = -1; for (int i = 0; i < this.pageControls.Length; i++) { var pageControl = this.pageControls[i] as IChildControl; if (pageControl == control) { result = i; break; } } return(result); }
public bool Contains(IChildControl item) { return(this.children.Contains(item)); }
public void OnOpenChildForm() { IChildControl TransfersOnTheWayControl = applicationController.Resolve <IChildControl>(); TransfersOnTheWayControl.Run(); }
public void Notify(IChildControl child, params object[] args) { var enableLinkButtons = (bool?)args[0]; UpdateLinksButtons(enableLinkButtons, false, true, false, false); }