public ImageCollection(MozItem item) { m_item = item; m_imageIndex = -1; m_focusImageIndex = -1; m_selectedImageIndex = -1; m_image = null; m_focusImage = null; m_selectedImage = null; }
public MozItemClickEventArgs(MozItem mozItem, MouseButtons button) { this.m_mozItem = mozItem; this.m_button = button; }
public MozItemEventArgs(MozItem mozItem) { this.m_mozItem = mozItem; }
/// <summary> /// Initializes a new instance of the MozItemEventArgs class with default settings /// </summary> public MozItemClickEventArgs() { m_mozItem = null; m_button = MouseButtons.Left; }
public bool Contains(MozItem mozItem) { if (mozItem == null) { throw new ArgumentNullException("mozItem"); } return (this.IndexOf(mozItem) != -1); }
/// <summary> /// Initializes a new instance of the MozItemEventArgs class with default settings /// </summary> public MozItemEventArgs() { m_mozItem = null; }
private void MozItem_GotFocus(object sender, MozItemEventArgs e) { //Check if item is selected if (e.MozItem.state != MozItemState.Selected) { // if not set its state to focus e.MozItem.state = MozItemState.Focus; m_mouseOverItem = e.MozItem; if (ItemGotFocus != null) ItemGotFocus(this,e); } }
public void MoveToTop(MozItem value) { this.Move(value, 0); }
public void MoveToBottom(MozItem value) { this.Move(value, this.Count); }
public void Move(MozItem value, int index) { if (value == null) { throw new ArgumentNullException("value"); } if (index < 0) { index = 0; } else if (index > this.Count) { index = this.Count; } if (!this.Contains(value) || this.IndexOf(value) == index) { return; } this.List.Remove(value); if (index > this.Count) { this.List.Add(value); } else { this.List.Insert(index, value); } if (this.owner != null && !this.owner.deserializing) { this.owner.MatchControlCollToMozItemsColl(); } }
public void Remove(MozItem value) { if (value == null) { throw new ArgumentNullException("value"); } this.List.Remove(value); if (this.owner != null && !this.owner.deserializing) { this.owner.Controls.Remove(value); this.owner.OnMozItemRemoved(new MozItemEventArgs(value)); } }
public int IndexOf(MozItem mozItem) { if (mozItem == null) { throw new ArgumentNullException("mozItem"); } for (int i=0; i<this.Count; i++) { if (this[i] == mozItem) { return i; } } return -1; }
private void MozItem_LostFocus(object sender, MozItemEventArgs e) { // check if item is selected if (e.MozItem.state != MozItemState.Selected) { // if not set its state to normal e.MozItem.state = MozItemState.Normal; m_mouseOverItem = null; if (ItemLostFocus != null) ItemLostFocus(this,e); } }
public void AddRange(MozItem[] mozItems) { if (mozItems == null) { throw new ArgumentNullException("mozItems"); } for (int i=0; i<mozItems.Length; i++) { this.Add(mozItems[i]); } }