public void CGAButtonClicked() { switch (currentState) { case MainWindoViewState.VIEW1STATE: if (this.newEvent == MainWindowButtonClickEvents.CON_TO_SITE_CLK) { this.nextState = MainWindoViewState.VIEW1STATE; } else if (this.newEvent == MainWindowButtonClickEvents.OPT_CLK) { this.nextState = MainWindoViewState.VIEW2STATE; } else if (this.newEvent == MainWindowButtonClickEvents.ABT_ME_CLK) { this.nextState = MainWindoViewState.VIEW3STATE; } else { //next state is null } if (this.nextState != this.currentState) { MainWindowEventArgs args = new MainWindowEventArgs(this.nextState, currentState); OnMainwindowStateChanged(args); } case MainWindoViewState.VIEW2STATE: } }
protected virtual void OnMainwindowStateChanging(MainWindowEventArgs e) { MainWindowButtonEventHandler handler = MainWindowButtonClick; if (handler != null) { handler(this, e); this.currentState = this.nextState; this.nextState = null; } }
public MainWindowVS() { currentState = MainWindoViewState.NULL; nextState = MainWindoViewState.NULL; }