public object AddNew()
        {
            TransitionRow newRow = new TransitionRow();

            List.Add(newRow);

            return(newRow);
        }
        protected override void OnInsertComplete(int index, object value)
        {
            TransitionRow newRow = (TransitionRow)value;

            newRow.EditCancelled += new EventHandler(EditCancelledHandler);

            OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));

            base.OnInsertComplete(index, value);
        }
        /// <summary>
        /// Creates a TransitionRow with the specified event, guard,
        /// and target and adds it to the TransitionRowCollection.
        /// </summary>
        /// <param name="event">
        /// The event that raised the transition.
        /// </param>
        /// <param name="guard">
        /// The guard to evaluate whether or not the transition should fire.
        /// </param>
        /// <param name="target">
        /// The target state of the transition.
        /// </param>
        /// <returns>
        /// The position into which the TransitionRow was inserted into the
        /// TransitionRowCollection.
        /// </returns>
        public int Add(string @event, string guard, string target)
        {
            TransitionRow newRow = new TransitionRow();

            newRow.Event  = @event;
            newRow.Guard  = guard;
            newRow.Target = target;

            return(Add(newRow));
        }
        protected override void OnRemoveComplete(int index, object value)
        {
            TransitionRow oldRow = (TransitionRow)value;

            oldRow.EditCancelled -= new EventHandler(EditCancelledHandler);

            OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index));

            base.OnRemoveComplete(index, value);
        }
        protected override void OnSetComplete(int index, object oldValue, object newValue)
        {
            if (oldValue != newValue)
            {
                TransitionRow oldRow = (TransitionRow)oldValue;
                TransitionRow newRow = (TransitionRow)newValue;

                oldRow.EditCancelled -= new EventHandler(EditCancelledHandler);
                newRow.EditCancelled += new EventHandler(EditCancelledHandler);

                OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));
            }

            base.OnSetComplete(index, oldValue, newValue);
        }
 /// <summary>
 /// Adds a TransitionRow to the TransitionRowCollection.
 /// </summary>
 /// <param name="row">
 /// The TransitionRow to add to the TransitionRowCollection.
 /// </param>
 /// <returns>
 /// The position into which the TransitionRow was inserted into the
 /// TransitionRowCollection.
 /// </returns>
 public int Add(TransitionRow row)
 {
     return(List.Add(row));
 }