protected override void OnControlRemoved(ControlEventArgs e) { base.OnControlRemoved(e); JMImageItem xpanderPanel = e.Control as JMImageItem; xpanderPanel.Click -= new EventHandler(xpanderPanel_Click); }
int IList.Add(object value) { JMImageItem xpanderPanel = value as JMImageItem; if (xpanderPanel == null) { throw new ArgumentException(); } this.Add(xpanderPanel); return(this.IndexOf(xpanderPanel)); }
protected override void OnControlAdded(ControlEventArgs e) { base.OnControlAdded(e); JMImageItem xpanderPanel = e.Control as JMImageItem; if (xpanderPanel != null) { xpanderPanel.Parent = this; xpanderPanel.Dock = DockStyle.Top; xpanderPanel.Height = itemheight; xpanderPanel.Click += new EventHandler(xpanderPanel_Click); } else { throw new InvalidOperationException("只能添加JMImageItem对象"); } }
protected override Object CreateInstance(Type ItemType) { JMImageItem xpanderPanel = (JMImageItem)base.CreateInstance(ItemType); return(xpanderPanel); }
/// <summary> /// Inserts an XPanderPanel to the collection at the specified index. /// </summary> /// <param name="index">The zero-based index at which value should be inserted. </param> /// <param name="xpanderPanel">The XPanderPanel to insert into the Collection.</param> public void Insert(int index, JMImageItem xpanderPanel) { ((IList)this).Insert(index, (object)xpanderPanel); }
/// <summary> /// Returns the index of the specified XPanderPanel in the collection. /// </summary> /// <param name="xpanderPanel">The xpanderPanel to find the index of.</param> /// <returns>The index of the xpanderPanel, or -1 if the xpanderPanel is not in the <see ref="ControlCollection">ControlCollection</see> instance.</returns> public int IndexOf(JMImageItem xpanderPanel) { return(this.m_controlCollection.IndexOf(xpanderPanel)); }
/// <summary> /// Removes the first occurrence of a specific XPanderPanel from the XPanderPanelCollection /// </summary> /// <param name="value">The XPanderPanel to remove from the XPanderPanelCollection</param> public void Remove(JMImageItem xpanderPanel) { this.m_controlCollection.Remove(xpanderPanel); }
/// <summary> /// Adds a XPanderPanel to the collection. /// </summary> /// <param name="xpanderPanel">The XPanderPanel to add.</param> public void Add(JMImageItem xpanderPanel) { this.m_controlCollection.Add(xpanderPanel); m_xpanderPanelList.Invalidate(); }