void ToolboxCategory_MouseLeave(object sender, MouseEventArgs e) { m_lastMouseUp = null; m_mouseDownCausedExpand = false; IsExpanded = false; m_longPressTimer.Stop(); }
// Called by ToolboxItem when it receives a MouseDown internal void NotifyToolboxItemMouseDown(ToolboxItem toolboxItem) { m_lastMouseUp = toolboxItem; }
// Called by ToolboxItem when it receives a MouseUp internal void NotifyToolboxItemMouseUp(ToolboxItem toolboxItem) { if (!toolboxItem.IsEnabled) return; if (SelectedItem != toolboxItem || m_lastMouseUp == toolboxItem) { var item = ItemContainerGenerator.ItemFromContainer(toolboxItem); SelectItem(item); if (ToolboxOwner != null) ToolboxOwner.SetSelected(this); } IsExpanded = false; // close expander }
/// <summary> /// Adds a <see cref="ToolboxItem"/> with the specified value to the /// <see cref="ToolboxItemCollection"/> . /// </summary> /// <param name="value">The <see cref="ToolboxItem"/> to add.</param> /// <returns> /// The index at which the new element was inserted. /// </returns> /// <remarks><seealso cref="ToolboxItemCollection.AddRange"/></remarks> /// <history> /// [dineshc] 3/26/2003 Created /// </history> public int Add(ToolboxItem value) { return(List.Add(value)); }
/// <summary> /// Removes a specific <see cref="ToolboxItem"/> from the /// <see cref="ToolboxItemCollection"/> . /// </summary> /// <param name="value">The <see cref="ToolboxItem"/> to remove from the <see cref="ToolboxItemCollection"/> .</param> /// <remarks><exception cref="System.ArgumentException"><paramref name="value"/> is not found in the Collection. </exception></remarks> /// <history> /// [dineshc] 3/26/2003 Created /// </history> public void Remove(ToolboxItem value) { List.Remove(value); }
/// <summary> /// Inserts a <see cref="ToolboxItem"/> into the <see cref="ToolboxItemCollection"/> at the specified index. /// </summary> /// <param name="index">The zero-based index where <paramref name="value"/> should be inserted.</param> /// <param name=" value">The <see cref="ToolboxItem"/> to insert.</param> /// <remarks><seealso cref="ToolboxItemCollection.Add"/></remarks> /// <history> /// [dineshc] 3/26/2003 Created /// </history> public void Insert(int index, ToolboxItem value) { List.Insert(index, value); }
/// <summary> /// Returns the index of a <see cref="ToolboxItem"/> in /// the <see cref="ToolboxItemCollection"/> . /// </summary> /// <param name="value">The <see cref="ToolboxItem"/> to locate.</param> /// <returns> /// The index of the <see cref="ToolboxItem"/> of <paramref name="value"/> in the /// <see cref="ToolboxItemCollection"/>, if found; otherwise, -1. /// </returns> /// <remarks><seealso cref="ToolboxItemCollection.Contains"/></remarks> /// <history> /// [dineshc] 3/26/2003 Created /// </history> public int IndexOf(ToolboxItem value) { return(List.IndexOf(value)); }
/// <summary> /// Gets a value indicating whether the /// <see cref="ToolboxItemCollection"/> contains the specified <see cref="ToolboxItem"/>. /// </summary> /// <param name="value">The <see cref="ToolboxItem"/> to locate.</param> /// <returns> /// <see langword="true"/> if the <see cref="ToolboxItem"/> is contained in the collection; /// otherwise, <see langword="false"/>. /// </returns> /// <remarks><seealso cref="ToolboxItemCollection.IndexOf"/></remarks> /// <history> /// [dineshc] 3/26/2003 Created /// </history> public bool Contains(ToolboxItem value) { return(List.Contains(value)); }