Exemplo n.º 1
0
 public void Synchronize()
 {
     if (lblError != null)
     {
         lblError.Visible = false;
     }
     if (IsSubmitting())
     {
         LongTaskControl ltc = ((MasterPage)Page).GetLongTaskControl();
         if (!ltc.IsBusy())
         {
             ViewState["submitting"] = false;
             ICommandEventArgs args = ltc.ReleaseReturnArgs();
             //Display errors
             if (args.Exception != null)
             {
                 PageError("Error during submission: " + args.Exception.Message);
             }
             else
             {
                 //Notify submission has been proced
                 if (SubmissionProcessed != null)
                 {
                     SubmissionProcessed(this,
                                         new SubmissionEventArgs((Components.Submission)args.ReturnValue));
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
        public ICommandEventArgs ReleaseReturnArgs()
        {
            ICommandEventArgs args = m_retargs[ViewState["thread"]] as ICommandEventArgs;

            m_retargs.Remove(ViewState["thread"]);
            return(args);
        }
Exemplo n.º 3
0
 private void Finish(ICommandEventArgs args)
 {
     Directory.Delete(m_target, true);
     if (Finished != null)
     {
         Finished(this, args);
     }
 }
Exemplo n.º 4
0
 protected void FireSubEvent(ICommandEventArgs args)
 {
     //Notify submission has been proced
     if (SubmissionProcessed != null)
     {
         SubmissionProcessed(this,
                             new SubmissionEventArgs((Components.Submission)args.ReturnValue));
     }
 }
Exemplo n.º 5
0
 private void scmd_Finished(object sender, ICommandEventArgs args)
 {
     if (args.Exception != null)
     {
         PageError(args.Exception.Message);
     }
     else
     {
         FireSubEvent(args);
     }
 }
Exemplo n.º 6
0
            public void Execute()
            {
                IExternalSource   extsource;
                ICommandEventArgs args = new ICommandEventArgs();

                //Unpack archive
                Components.Submission sub = null;
                try {
                    extsource = CreateSource(m_upfile);

                    //Create submission
                    sub = m_subda.Create(m_asstID, m_prinID, extsource);
                } catch (Exception er) {
                    args.Exception = er;
                }

                args.ReturnValue = sub;
                if (Finished != null)
                {
                    Finished(this, args);
                }
            }
Exemplo n.º 7
0
            public void Execute()
            {
                IExternalSource   extsrc;
                ICommandEventArgs args = new ICommandEventArgs();

                //Run CVS to get the files
                CVSTool cvs = new CVSTool();

                try {
                    extsrc = cvs.Checkout(m_cvsroot, m_module, m_password, out m_target);
                } catch (Exception er) {
                    args.Exception = er;
                    Finish(args); return;
                }

                //Sanity check on CVS
                if (extsrc == null)
                {
                    args.Exception = new ToolExecutionException("Failure during execution of CVS");
                    Finish(args); return;
                }

                //Create the submission
                Submissions subda = new Submissions(Globals.CurrentIdentity);

                Components.Submission sub = null;
                try {
                    sub = m_subda.Create(m_asstID, m_prinID, extsrc);
                } catch (Exception er) {
                    args.Exception = er;
                    Finish(args); return;
                }

                //Finish up
                args.ReturnValue = sub;
                Finish(args);
            }
Exemplo n.º 8
0
 private void task_Finished(object sender, ICommandEventArgs args)
 {
     m_threads.Remove(ViewState["thread"]);
     m_retargs[ViewState["thread"]] = args;
 }