public void addPath(char startState, int weight, char targetState) { _automata.AddPath(startState, weight, targetState); var stateNameAndClass = new KeyValuePair <char, AutomataGraph.State>(startState, _automata.States[startState]); AutomataChanged?.Invoke(stateNameAndClass, new PropertyChangedEventArgs("State")); }
public void Load(string filename) { try { AutomataGraph newAutomata = new AutomataGraph(); newAutomata.Read(filename); _automata.StateChanged -= AutomataChanged; _automata = newAutomata; _automata.StateChanged += AutomataChanged; AutomataChanged?.Invoke(filename, new PropertyChangedEventArgs("Refresh")); foreach (KeyValuePair <char, AutomataGraph.State> entry in _automata.States) { AutomataChanged?.Invoke(entry, new PropertyChangedEventArgs("State")); } } catch (Exception e) { var t = e.ToString(); } }