/// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose(bool disposing) { if (disposing) { if (components != null) { components.Dispose(); } foreach (ActionData ad in _components.Values) { ad.Detach(DesignMode); } if (components != null) { _components.Clear(); _components = null; } if (_shortcuts != null) { _shortcuts.Dispose(); _shortcuts = null; } } base.Dispose(disposing); }
public Action() { /// <summary> /// Required for Windows.Forms Class Composition Designer support /// </summary> InitializeComponent(); _shortcuts = new ShortcutKeysCollection(this); }
public Action(System.ComponentModel.IContainer container) { /// <summary> /// Required for Windows.Forms Class Composition Designer support /// </summary> container.Add(this); InitializeComponent(); _shortcuts = new ShortcutKeysCollection(this); }
/// <summary> /// Gets an array of objects containing the specified collection. /// </summary> /// <param name="editValue">The collection to edit</param> /// <returns>An array containing the collection objects.</returns> protected override object[] GetItems(object editValue) { ShortcutKeysCollection coll = editValue as ShortcutKeysCollection; Debug.Assert(editValue != null && coll != null); ShortcutKeys [] res = new ShortcutKeys[coll.Count]; if (coll.Count > 0) { coll.CopyTo(res, 0); } return(res); }
/// <summary> /// Sets the specified array as the items of the collection. /// </summary> /// <param name="editValue">The collection to edit.</param> /// <param name="value">An array of objects to set as the collection items.</param> /// <returns>The newly created collection object or, otherwise, the collection indicated by the editValue parameter.</returns> protected override object SetItems( object editValue, object[] value ) { ShortcutKeysCollection coll = editValue as ShortcutKeysCollection; Debug.Assert(editValue != null && coll != null); coll.Clear(); foreach (object o in value) { coll.Add((ShortcutKeys)o); } return(coll); }
public ShortcutKeysCollection(ShortcutKeysCollection collection) { this.AddRange(collection); }