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)); } } } } }
public ICommandEventArgs ReleaseReturnArgs() { ICommandEventArgs args = m_retargs[ViewState["thread"]] as ICommandEventArgs; m_retargs.Remove(ViewState["thread"]); return(args); }
private void Finish(ICommandEventArgs args) { Directory.Delete(m_target, true); if (Finished != null) { Finished(this, args); } }
protected void FireSubEvent(ICommandEventArgs args) { //Notify submission has been proced if (SubmissionProcessed != null) { SubmissionProcessed(this, new SubmissionEventArgs((Components.Submission)args.ReturnValue)); } }
private void scmd_Finished(object sender, ICommandEventArgs args) { if (args.Exception != null) { PageError(args.Exception.Message); } else { FireSubEvent(args); } }
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); } }
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); }
private void task_Finished(object sender, ICommandEventArgs args) { m_threads.Remove(ViewState["thread"]); m_retargs[ViewState["thread"]] = args; }