예제 #1
0
 /// <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);
     }
 }
예제 #2
0
 /// <summary>
 /// Common code for initialising the instance
 /// </summary>
 private void Init()
 {
     _actions = new ActionCollection(this);
     if (!DesignMode)
     {
         Application.Idle += new EventHandler(OnIdle);
     }
 }
예제 #3
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)
        {
            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);
        }
예제 #4
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
            )
        {
            Debug.Assert(editValue != null && editValue is ActionCollection);
            ActionCollection coll = (ActionCollection)editValue;

            coll.Clear();
            foreach (object o in value)
            {
                coll.Add((Action)o);
            }
            return(coll);
        }
예제 #5
0
 /// <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);
 }
예제 #6
0
 public ActionEnumerator(ActionCollection mappings)
 {
     this._temp           = ((IEnumerable)(mappings));
     this._baseEnumerator = _temp.GetEnumerator();
 }