Пример #1
0
        public CLIExecutor(Process executable, WaitDialogDescription dialogDesc, ProcessDataReceiverDelegate OnProcessUpdated, ProcessTerminatorDelegate OnProcessCanceled, ProcessTerminatorDelegate OnProcessExited)
        {
            this.executable        = executable;
            this.dialogDesc        = dialogDesc;
            this.OnProcessExited   = OnProcessExited;
            this.OnProcessUpdated  = OnProcessUpdated;
            this.OnProcessCanceled = OnProcessCanceled;

            IVsThreadedWaitDialogFactory dlgFactory = Package.GetGlobalService(typeof(SVsThreadedWaitDialogFactory)) as IVsThreadedWaitDialogFactory;

            if (dlgFactory != null)
            {
                dlgFactory.CreateInstance(out waitDialog);
            }
        }
Пример #2
0
        public Downloader(string src, string destFolder, WaitDialogDescription dialogDesc, DownloadHandlingDelegate OnDownloadCompleted, DownloadHandlingDelegate OnDownloadCanceled)
        {
            srcUri                   = new Uri(src);
            dest                     = GetLocalPathByUri(destFolder, srcUri);//Path.Combine(destFolder, Path.GetFileName(srcUri.AbsolutePath));
            this.dialogDesc          = dialogDesc;
            this.OnDownloadCompleted = OnDownloadCompleted;
            this.OnDownloadCanceled  = OnDownloadCanceled;

            webClient = new WebClient();

            IVsThreadedWaitDialogFactory dlgFactory = Package.GetGlobalService(typeof(SVsThreadedWaitDialogFactory)) as IVsThreadedWaitDialogFactory;

            if (dlgFactory != null)
            {
                dlgFactory.CreateInstance(out waitDialog);
            }
        }