Пример #1
0
 /// <summary>
 /// 添加一个状态
 /// </summary>
 /// <param name="state">目标状态</param>
 public void AddState(ListStateNodeStruct <T> state)
 {
     if (stateList == null)
     {
         stateList = new List <ListStateNodeStruct <T> >();
     }
     stateList.Add(state);
 }
Пример #2
0
 /// <summary>
 /// 在指定位置插入一个状态
 /// </summary>
 /// <param name="index">目标位置</param>
 /// <param name="state">插入状态</param>
 public void InsertState(int index, ListStateNodeStruct <T> state)
 {
     stateList.Insert(index, state);
 }
Пример #3
0
        /// <summary>
        /// 在指定状态后插入一个状态
        /// </summary>
        /// <param name="value">前一个状态值</param>
        /// <param name="state">插入状态</param>
        public void InsertState(T value, ListStateNodeStruct <T> state)
        {
            int index = stateList.IndexOf(stateList.Where(p => p.StateValue.Equals(value)).First());

            InsertState(index, state);
        }