Beispiel #1
0
 public void Add(SideBarItem value)
 {
     if (value == null)
     {
         return;
     }
     this._owner.Controls.Add(value);
 }
Beispiel #2
0
 public void Remove(SideBarItem value)
 {
     if (value == null)
     {
         return;
     }
     this._owner.Controls.Remove(value);
 }
Beispiel #3
0
        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);
        }
Beispiel #4
0
            /// <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();
            }
Beispiel #5
0
 // 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);
 }
Beispiel #6
0
        //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);
 }