Example #1
0
        /// <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);
        }
Example #2
0
 public Action()
 {
     /// <summary>
     /// Required for Windows.Forms Class Composition Designer support
     /// </summary>
     InitializeComponent();
     _shortcuts = new ShortcutKeysCollection(this);
 }
Example #3
0
 public Action(System.ComponentModel.IContainer container)
 {
     /// <summary>
     /// Required for Windows.Forms Class Composition Designer support
     /// </summary>
     container.Add(this);
     InitializeComponent();
     _shortcuts = new ShortcutKeysCollection(this);
 }
Example #4
0
        /// <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);
        }
Example #5
0
        /// <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);
        }
Example #6
0
 public ShortcutKeysCollection(ShortcutKeysCollection collection)
 {
     this.AddRange(collection);
 }