/// <summary> /// Adds the contents of another ActionCollection to the end of the collection. /// </summary> /// <param name='value'>An ActionCollection containing the objects to add to the collection.</param> public void AddRange(ActionCollection value) { foreach (Action a in value) { this.Add(a); } }
/// <summary> /// Common code for initialising the instance /// </summary> private void Init() { _actions = new ActionCollection(this); if (!DesignMode) { Application.Idle += new EventHandler(OnIdle); } }
/// <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) { Debug.Assert(editValue != null && editValue is ActionCollection); ActionCollection coll = (ActionCollection)editValue; Action [] res = new Action[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 ) { Debug.Assert(editValue != null && editValue is ActionCollection); ActionCollection coll = (ActionCollection)editValue; coll.Clear(); foreach (object o in value) { coll.Add((Action)o); } return(coll); }
/// <summary> /// Initialises a new instance of ActionCollection based on another ActionCollection. /// </summary> /// <param name='value'>An ActionCollection from which the contents are copied</param> public ActionCollection(ActionCollection value) { this.AddRange(value); }
public ActionEnumerator(ActionCollection mappings) { this._temp = ((IEnumerable)(mappings)); this._baseEnumerator = _temp.GetEnumerator(); }