public static void downloadFileUsingAscxDownload(string sFileToDownload, String sTargetFileOrFolder,
                                                         Callbacks.dMethod_String dCallbackWhenCompleted)
        {
            O2Thread.mtaThread(
                () =>
            {
                var windowTitle = string.Format("{0} : {1}", "Download File", sFileToDownload);
                O2Messages.openControlInGUISync(typeof(ascx_DownloadFile), O2DockState.Float, windowTitle);

                O2Messages.getAscx(windowTitle,
                                   guiControl =>
                {
                    if (guiControl != null && guiControl is ascx_DownloadFile)
                    {
                        //var downloadFile = (IControl_DownloadFile)guiControl;
                        //O2Messages.openAscxGui(typeof (ascx_DownloadFile), O2DockState.Float, "Download File");
                        var adfDownloadFile = (ascx_DownloadFile)guiControl;
                        // Exec.openNewWindowWithControl("DownloadFile");
                        adfDownloadFile.invokeOnThread(
                            delegate
                        {
                            adfDownloadFile.setDownloadDetails(sFileToDownload, sTargetFileOrFolder);
                            adfDownloadFile.setAutoCloseOnDownload(true);
                            adfDownloadFile.setCallBackWhenCompleted(dCallbackWhenCompleted);
                            adfDownloadFile.downloadFile();
                            return(null);
                        });
                    }
                });
            });
        }
Beispiel #2
0
 public void openGui()
 {
     DI.log.info("Opening GUI");
     if (O2AscxGUI.launch())
     {
         O2AscxGUI.setLogViewerDockState(O2DockState.DockBottom);
         O2Messages.openControlInGUISync(typeof(ascx_CirCreator), O2DockState.Document, cirAnalysisControlName);
         //DI.log.info("after launch");
         //O2AscxGUI.logInfo("from Test_CirCreatorAscxControl");  // this is actually a hack since there is still a bug in the thread invocation which makes sometimes the getGuiAscx below to fail
     }
 }
Beispiel #3
0
 public void openGui()
 {
     DI.log.info("Opening GUI");
     // first set up GUI
     if (O2AscxGUI.launch())
     {
         O2AscxGUI.setLogViewerDockState(O2DockState.DockBottom);
         cirDataViewer = (ascx_CirDataViewer)O2Messages.openControlInGUISync(typeof(ascx_CirDataViewer), O2DockState.Document, cirDataViewerControlName);
         Assert.That(cirDataViewer != null, "cirDataViewer was null");
         // Then create CirData and fire global O2Message showCirDataStats
         createCirDataObject();
     }
 }
 public static void viewCirFunctionSignatureOnNewForm(ICirFunction cirFunction)
 {
     O2Thread.mtaThread(
         () =>
     {
         var windowName = string.Format("Function Viewer: {0}", cirFunction.FunctionSignature);
         O2Messages.openControlInGUISync(typeof(ascx_FunctionCalls), O2DockState.Float, windowName);
         O2Messages.getAscx(windowName,
                            ascxControl =>
                            ((ascx_FunctionCalls)ascxControl).viewCirFunction(cirFunction));
     }
         );
 }
Beispiel #5
0
 public static Thread openInFloatWindow(List <IO2Finding> o2Findings, string windowTitle)
 {
     return(O2Thread.mtaThread(() =>
     {
         O2Messages.openControlInGUISync(typeof(ascx_FindingsViewer), O2DockState.Float, windowTitle);
         O2Messages.getAscx(windowTitle, guiControl =>
         {
             if (guiControl != null && guiControl is ascx_FindingsViewer)
             {
                 var findingsViewer = (ascx_FindingsViewer)guiControl;
                 findingsViewer.loadO2Findings(o2Findings);
             }
         });
     }));
 }
Beispiel #6
0
 public static void openInFloatWindow(IO2Finding o2Finding)
 {
     O2Thread.mtaThread(
         () =>
     {
         var windowName = "Finding Editor for: " + o2Finding;
         O2Messages.openControlInGUISync(typeof(ascx_FindingEditor), O2DockState.Float,
                                         windowName);
         O2Messages.getAscx(windowName, guiControl =>
         {
             if (guiControl != null &&
                 guiControl is ascx_FindingEditor)
             {
                 var findingEditor =
                     (ascx_FindingEditor)guiControl;
                 findingEditor.loadO2Finding(
                     o2Finding, false);
             }
         });
     });
 }
Beispiel #7
0
        private static void openO2FindingOnNewGuiWindow(IO2Finding o2FindingToOpen)
        {
            O2Thread.mtaThread(() =>
            {
                var findingEditorControlName = string.Format("Findings Editor for: {0}               ({1})", o2FindingToOpen, Guid.NewGuid());
                O2Messages.openControlInGUISync(typeof(ascx_FindingEditor), O2DockState.Float,
                                                findingEditorControlName);
                O2Messages.getAscx(findingEditorControlName, controlObject =>
                {
                    if (controlObject != null && controlObject is ascx_FindingEditor)
                    {
                        var findingEditor = (ascx_FindingEditor)controlObject;
                        findingEditor.loadO2Finding(o2FindingToOpen);
                    }
                });
                // can't use this because we can't  serialized O2Finding (since it has interfaces on it)

                /*
                 * var serializedO2Finding = OzasmtUtils.createSerializedXmlStringFromO2Finding(o2FindingToOpen);
                 * O2Messages.executeOnAscx(findingEditorControlName, "loadSerializedO2Finding",
                 *                       new[] {serializedO2Finding});
                 * */
            });
        }