public object AddNew() { StateRow newRow = new StateRow(); List.Add(newRow); return(newRow); }
/// <summary> /// Creates a StateRow based on the specified name and adds it to the /// StateRowCollection. /// </summary> /// <param name="name"> /// The state name. /// </param> /// <returns> /// The position into which the StateRow was inserted into the /// StareRowCollection. /// </returns> public int Add(string name) { StateRow newRow = new StateRow(); newRow.Name = name; return(Add(newRow)); }
/// <summary> /// Creates a StateRow based on the specified name and initial state /// and adds it to the StateRowCollection. /// </summary> /// <param name="name"> /// The state name. /// </param> /// <param name="initialState"> /// The state's initial state. /// </param> /// <returns> /// The position into which the StateRow was inserted into the /// StareRowCollection. /// </returns> public int Add(string name, string initialState) { StateRow newRow = new StateRow(); newRow.Name = name; newRow.InitialState = initialState; return(Add(newRow)); }
protected override void OnRemoveComplete(int index, object value) { StateRow oldRow = (StateRow)value; oldRow.EditCancelled -= new EventHandler(EditCancelledHandler); OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index)); base.OnRemoveComplete(index, value); }
protected override void OnInsertComplete(int index, object value) { StateRow newRow = (StateRow)value; newRow.EditCancelled += new EventHandler(EditCancelledHandler); OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index)); base.OnInsertComplete(index, value); }
/// <summary> /// Creates a StateRow based on the specified name, initial state, and /// history type and adds it to the StateRowCollection. /// </summary> /// <param name="name"> /// The state name. /// </param> /// <param name="initialState"> /// The state's initial state. /// </param> /// <param name="historyType"> /// The state's history type. /// </param> /// <returns> /// The position into which the StateRow was inserted into the /// StareRowCollection. /// </returns> public int Add(string name, string initialState, HistoryType historyType) { StateRow newRow = new StateRow(); newRow.Name = name; newRow.InitialState = initialState; newRow.HistoryType = historyType; return(Add(newRow)); }
protected override void OnSetComplete(int index, object oldValue, object newValue) { if (oldValue != newValue) { StateRow oldRow = (StateRow)oldValue; StateRow newRow = (StateRow)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 StateRow to the StateRowCollection. /// </summary> /// <param name="row"> /// The StateRow to add to the StateRowCollection. /// </param> /// <returns> /// The position into which the StateRow was inserted into the /// StareRowCollection. /// </returns> public int Add(StateRow row) { return(List.Add(row)); }