internal StateVariablesViewer(IState rootState, FAName stateName) { this.stateName = stateName; this.rootState = rootState; this.leafStates = new List <IState>(); this.modelNames = new List <string>(); this.termViewers = new Dictionary <TermViewer, int>(); this.nameDisambiguator = new Dictionary <string, int>(); }
/// <summary> /// Sets the state to be viewed /// </summary> internal void SetState(IState state, FAName name) { if (state != rootState) { if (state != null) { rootState = state; StateVariablesViewer viewer = new StateVariablesViewer(state, name); viewer.Initialize(); this.propertyGrid1.SelectedObject = viewer; } else { rootState = null; this.propertyGrid1.SelectedObject = null; } } }
void PreorderLeaves(IState stateNode, FAName sn) { if (sn != null) { IPairState pstate = stateNode as IPairState; if (pstate != null) { PreorderLeaves(pstate.First, sn.left); PreorderLeaves(pstate.Second, sn.right); } else { string modelName = sn.ToString(); leafStates.Add(stateNode); modelNames.Add(modelName); } } }