/// <summary> /// /// </summary> /// <param name="theEvent"></param> public void Notify(object theEvent) { if (theEvent is EndExecution) { _State = ProjectFormState.IDLE; } if (theEvent is StartExecution) { if (userControlSessionTree.GetSelectedTag() is DvtkApplicationLayer.Script) { _State = ProjectFormState.EXECUTING_SCRIPT; } else if (userControlSessionTree.GetSelectedTag() is DvtkApplicationLayer.Emulator) { DvtkApplicationLayer.Emulator emulator = new DvtkApplicationLayer.Emulator(); emulator = (DvtkApplicationLayer.Emulator)userControlSessionTree.GetSelectedTag(); // switch(emulator.EmulatorType) { case DvtkApplicationLayer.Emulator.EmulatorTypes.PRINT_SCP: _State = ProjectFormState.EXECUTING_PRINT_SCP; break; case DvtkApplicationLayer.Emulator.EmulatorTypes.STORAGE_SCP: _State = ProjectFormState.EXECUTING_STORAGE_SCP; break; case DvtkApplicationLayer.Emulator.EmulatorTypes.STORAGE_SCU: _State = ProjectFormState.EXECUTING_STORAGE_SCU; break; } } else if (userControlSessionTree.GetSelectedTag() is DvtkApplicationLayer.MediaSession) { _State = ProjectFormState.EXECUTING_MEDIA_VALIDATION; } else { // Sanity check. throw new System.ApplicationException("Not supposed to get here."); } } if (this.ParentForm is MainForm) { ((MainForm)this.ParentForm).Notify(this, theEvent); } }
public void Notify(object theEvent) { if (theEvent is EndExecution) { _State = ProjectFormState.IDLE; } if (theEvent is StartExecution) { if (_SessionTreeViewManager.GetSelectedTreeNodeTag() is ScriptFileTag) { _State = ProjectFormState.EXECUTING_SCRIPT; } else if (_SessionTreeViewManager.GetSelectedTreeNodeTag() is EmulatorTag) { EmulatorTag theEmulatorTag = (EmulatorTag)_SessionTreeViewManager.GetSelectedTreeNodeTag(); switch(theEmulatorTag._EmulatorType) { case EmulatorTag.EmulatorType.PRINT_SCP: _State = ProjectFormState.EXECUTING_PRINT_SCP; break; case EmulatorTag.EmulatorType.STORAGE_SCP: _State = ProjectFormState.EXECUTING_STORAGE_SCP; break; case EmulatorTag.EmulatorType.STORAGE_SCU: _State = ProjectFormState.EXECUTING_STORAGE_SCU; break; } } else if (_SessionTreeViewManager.GetSelectedTreeNodeTag() is MediaSessionTag) { _State = ProjectFormState.EXECUTING_MEDIA_VALIDATION; } else { // Sanity check. throw new System.ApplicationException("Not supposed to get here."); } } if (this.ParentForm is MainForm) { ((MainForm)this.ParentForm).Notify(this, theEvent); } }