Exemplo n.º 1
0
 public void raiseO2MDbgDebugMethodInfoRequest(string loadDllsFrom)
 {
     if (Method != null)
     {
         O2Messages.raiseO2MDbgDebugMethodInfoRequest(Method, loadDllsFrom);
     }
 }
        public static void downloadFileUsingAscxDownload(string sFileToDownload, String sTargetFileOrFolder,
                                                         Callbacks.dMethod_String dCallbackWhenCompleted)
        {
            O2Thread.mtaThread(
                () =>
            {
                var windowTitle = "{0} : {1}".format("Download File", sFileToDownload);
                O2Messages.openControlInGUISync(typeof(DownloadFile), O2DockState.Float, windowTitle);

                O2Messages.getAscx(windowTitle,
                                   guiControl =>
                {
                    if (guiControl != null && guiControl is DownloadFile)
                    {
                        //var downloadFile = (IControl_DownloadFile)guiControl;
                        //O2Messages.openAscxGui(typeof (DownloadFile), O2DockState.Float, "Download File");
                        var adfDownloadFile = (DownloadFile)guiControl;
                        // Exec.openNewWindowWithControl("DownloadFile");
                        adfDownloadFile.invokeOnThread(
                            delegate
                        {
                            adfDownloadFile.setDownloadDetails(sFileToDownload, sTargetFileOrFolder);
                            adfDownloadFile.setAutoCloseOnDownload(true);
                            adfDownloadFile.setCallBackWhenCompleted(dCallbackWhenCompleted);
                            adfDownloadFile.downloadFile();
                            return(default(object));
                        });
                    }
                });
            });
        }