Exemplo n.º 1
0
        private void OnExecute(object sender, EventArgs e)
        {
            var pdlg = new ProgressDialog();

            pdlg.CancelAbortsThread = true;

            var worker = new ProgressDialog.DoBackgroundWork(ExecuteLoadProcedure);

            try
            {
                _ed.SyncSessionCopy();
                var result = pdlg.RunOperationAsync(this.ParentForm, worker, _ed, _lp);
                MessageBox.Show(Strings.OperationCompleted);
                _ed.RequestRefresh(_lp.SubType.RootPath);

                //Load procedure may have modified this resource as part of executioin
                _ed.SyncSessionCopy();
                //HACK: Force dirty state as successful execution writes some extra XML content to the resource
                _ed.MarkDirty();
            }
            catch (CancelException)
            {
                MessageBox.Show(Strings.OperationCancelled);
            }
        }