private void o2MessageQueue_onMessages(IO2Message o2Message) { //first thing to do is to make sure we are on the correct thread if (InvokeRequired) { Invoke(new EventHandler(delegate { o2MessageQueue_onMessages(o2Message); })); } else { if (o2Message is IM_GUIAction) { var mGuiAction = (IM_GUIAction)o2Message; DI.log.info("O2GuiWithDockPanel received IM_GUIAction of action: {0}", mGuiAction.GuiAction); switch (mGuiAction.GuiAction) { case (IM_GUIActions.openControlInGui): O2DockPanel.loadControl(mGuiAction.controlType, mGuiAction.o2DockState, mGuiAction.controlName); break; case (IM_GUIActions.setAscxDockStateAndOpenIfNotAvailable): // if setDockState fails is because the control is not loaded if (false == O2DockUtils.setDockState(mGuiAction.controlName, mGuiAction.o2DockState)) { O2AscxGUI.openAscxASync(mGuiAction.controlTypeString, mGuiAction.o2DockState, mGuiAction.controlName); } break; } return; } } }
private void lbAssessmentFilesThatNeedSourceCodePathFixing_DoubleClick(object sender, EventArgs e) { //ascx_SourceCodeFileReferences scfrSourceCodeFileReferences = (ascx_SourceCodeFileReferences)Exec.openNewWindowWithControl(typeof(ascx_SourceCodeFileReferences),"Fix Source Code File References"); var scfrSourceCodeFileReferences = (ascx_SourceCodeFileReferences) O2DockPanel.loadControl(typeof(ascx_SourceCodeFileReferences), true, "Fix Source Code File References"); scfrSourceCodeFileReferences.dCallbackToRefreshFilesMappings = checkIfSourceCodeReferencesAreValid; scfrSourceCodeFileReferences.loadAssessmentFile( (O2AssessmentData_OunceV6)lbAssessmentFilesThatNeedSourceCodePathFixing.SelectedItem); }
/// <summary> /// opens ascx control (Sync mode) /// </summary> /// <param name="ascxControlToLoad"></param> /// <param name="dockState"></param> /// <param name="guiWindowName"></param> public static Control openAscx(Type ascxControlToLoad, O2DockState dockState, String guiWindowName) { Control ascxControl = null; var sync = new AutoResetEvent(false); O2Thread.staThread(() => { ascxControl = O2DockPanel.loadControl(ascxControlToLoad, dockState, guiWindowName); sync.Set(); }); sync.WaitOne(); return(ascxControl); }
public static void openAscxASync(Type ascxControlToLoad, O2DockState dockState, String guiWindowName) { O2Thread.staThread(() => O2DockPanel.loadControl(ascxControlToLoad, dockState, guiWindowName)); }