예제 #1
0
        public void Download(OnlineScriptViewModel toDownload, Dispatcher dispatcher, Action<Iron7Server.SimpleScriptDetail> successfulAction)
        {
            this.successfulAction = successfulAction;
            this.toDownload = toDownload;
            this.dispatcher = dispatcher;
            childWindow = new Views.StyledChildWindow();

            var backgroundThread = new System.Threading.Thread(DownloadProc);
            backgroundThread.Start();

            childWindow.Closed += (sender, args) =>
            {
                cancelRequested = true;
                try
                {
                    if (myRequest != null)
                        myRequest.Abort();
                }
                catch
                {
                    // ignore problems :/
                }
            };

            childWindow.Show("copying script " + toDownload.Title);
            childWindow.ShowCancelButton();
        }
예제 #2
0
        public void Upload(AccountViewModel account, ItemViewModel toUpload, Dispatcher dispatcher)
        {
            this.account = account;
            this.toUpload = toUpload;
            this.dispatcher = dispatcher;
            childWindow = new Views.StyledChildWindow();

            var backgroundThread = new System.Threading.Thread(UploadProc);
            backgroundThread.Start();

            childWindow.Closed += (sender, args) =>
            {
                cancelRequested = true;
                try
                {
                    if (myRequest != null)
                        myRequest.Abort();
                }
                catch
                {
                    // ignore problems :/
                }
            };

            childWindow.Show("uploading script '" + toUpload.Title + "'");
            childWindow.ShowCancelButton();
        }