Esempio n. 1
0
        protected override void EditAction()
        {
            if (CurrentDocumento == null)
            {
                return;
            }

            _destination_path = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);

            _back_job = BackJob.Download;
            PgMng.Reset(5, 1, Resources.Messages.CONNECTING_SERVER, this);
            //PgMng.StartBackJob(this);
            DoJob();

            if (PgMng.Result == BGResult.OK)
            {
                System.Diagnostics.Process process = new System.Diagnostics.Process();
                process.StartInfo.FileName = TempFile;
                PgMng.FillUp();
                process.Start();
                try
                {
                    process.WaitForExit();
                }
                catch { }

                _back_job = BackJob.Upload;
                PgMng.Reset(5, 1);
                PgMng.Message = Resources.Messages.CONNECTING_SERVER;
                PgMng.ShowForm();
                PgMng.Grow();

                if (PgMng.Result == BGResult.OK)
                {
                    PgMng.StartBackJob(this);
                    PgMng.FillUp();

                    File.Delete(TempFile);
                }
                else
                {
                    PgMng.FillUp();
                }
            }
            else
            {
                PgMng.FillUp();
            }
        }