public Schematix.FSM.HistoryElem AddToHistory(String name) { Schematix.FSM.HistoryElem newElem = new Schematix.FSM.HistoryElem(graph.Clone(), name); graph_history.add(newElem); UpdateHistory(); return(newElem); }
/// <summary> /// Отменить действие /// </summary> /// <returns></returns> public My_Graph UnDo() { Schematix.FSM.My_Graph graph = null; int index = history.IndexOf(elem); if (index <= 0) { graph = elem.Graph; } if (index > 0) { elem = history.ElementAt <HistoryElem>(index - 1); graph = elem.Graph; } return(graph.Clone()); }
/// <summary> /// Повторить действие /// </summary> /// <returns></returns> public My_Graph ReDo() { Schematix.FSM.My_Graph graph = null; int index = history.IndexOf(elem); if (index == history.Count - 1) { elem = history.Last <HistoryElem>(); } else { if (index == -1) { elem = history.First <HistoryElem>(); } else { elem = history.ElementAt <HistoryElem>(index + 1); } } graph = elem.Graph; return(graph.Clone()); }