public void Add(SideBarItem value) { if (value == null) { return; } this._owner.Controls.Add(value); }
public void Remove(SideBarItem value) { if (value == null) { return; } this._owner.Controls.Remove(value); }
public override void Initialize(IComponent component) { base.Initialize(component); this._owner = component as SideBarItem; //subscribe the selection changed event ISelectionService selserv = (ISelectionService)this.GetService(typeof(ISelectionService)); selserv.SelectionChanged += new EventHandler(selserv_SelectionChanged); }
/// <summary> /// removes the specified control from the collection. only SideBaritems are contained /// </summary> /// <param name="value">the SideBaritem to be removed</param> public override void Remove(Control value) { SideBarItem item = value as SideBarItem; if (item == null || !this.Contains(item)) { return; } base.Remove(value); item.Owner = null; this._owner.DoLayout(); }
// adds the specified SideBaritem to the collection private void AddInternal(SideBarItem item) { if (item == null) { throw new ArgumentException("Only SideBarItems can be added"); } if (item.Owner != null) { throw new ArgumentException("SideBarItems can only be assigned to one SideBar"); } item.Owner = this._owner; base.Add(item); }
//add a new tab private void OnAddItem(object sender, EventArgs e) { MemberDescriptor controls = TypeDescriptor.GetProperties(base.Component)["Controls"]; IDesignerHost host = (IDesignerHost)this.GetService(typeof(IDesignerHost)); using (DesignerTransaction tabadd = host.CreateTransaction("SideBar Item added")) { base.RaiseComponentChanging(controls); SideBarItem item = (SideBarItem)host.CreateComponent(typeof(SideBarItem)); item.Caption = item.Name; this._owner.Controls.Add(item); base.RaiseComponentChanged(controls, null, null); tabadd.Commit(); } }
public void AddRange(SideBarItem[] pages) { if (pages==null) return; this._owner.Controls.AddRange(pages); }
public void Add(SideBarItem value) { if (value == null) return; this._owner.Controls.Add(value); }
public void Remove(SideBarItem value) { if (value==null) return; this._owner.Controls.Remove(value); }