private void DocumentForm_Load(object sender, EventArgs e)
        {
            SignatureQueueServiceClient service = null;
            WaitingForm progressWindow          = null;

            try
            {
                this.Cursor    = Cursors.WaitCursor;
                progressWindow = new WaitingForm(Tools.GetLocalizedString("GettingJobInfo"));
                progressWindow.Show();
                service   = WSTools.GetSignatureQueueServiceClient();
                m_Job     = service.GetJob(m_JobId);
                this.Text = m_Job.jobReferenceEx.jobTitle;

                toolStripOwner.Text = String.Format(Tools.GetLocalizedString("Owner"), m_Job.jobReferenceEx.owner);
                if (m_Job.jobReferenceEx.processed)
                {
                    mnuSignDocument.Visible = false;
                    toolStripTime.Text      = String.Format(Tools.GetLocalizedString("SubmissionTime"), m_Job.jobReferenceEx.time.ToShortDateString(), m_Job.jobReferenceEx.time.ToLongTimeString());
                    toolStripComputer.Text  = String.Format(Tools.GetLocalizedString("SourceComputer"), m_Job.jobReferenceEx.computerName);
                }
                else
                {
                    mnuSignDocument.Visible = true;
                    toolStripTime.Text      = String.Format(Tools.GetLocalizedString("SigningTime"), m_Job.jobReferenceEx.time.ToShortDateString(), m_Job.jobReferenceEx.time.ToLongTimeString());
                    toolStripComputer.Text  = "";
                }

                m_tempFilename = System.IO.Path.GetTempFileName();
                FileStream f = new FileStream(m_tempFilename, FileMode.Create, FileAccess.Write);
                f.Write(m_Job.jobReferenceEx.blob, 0, m_Job.jobReferenceEx.blob.Length);
                f.Close();
                axAcroPDF1.LoadFile(m_tempFilename);
                axAcroPDF1.setShowToolbar(false);

                this.WindowState = FormWindowState.Maximized;
                this.Activate();
            }
            catch (Exception ex)
            {
                Tools.ShowUnexpectedError(this, ex);
            }
            finally
            {
                if (progressWindow != null)
                {
                    progressWindow.Close();
                }
                try
                {
                    if (service != null)
                    {
                        service.Close();
                    }
                }
                catch { }
                this.Cursor = Cursors.Default;
            }
        }
 public void Close()
 {
     if (waitForm != null)
     {
         if (waitForm.InvokeRequired)
         {
             waitForm.Invoke(new CloseDelegate(Close), null);
         }
         else
         {
             waitForm.Close();
         }
         waitForm = null;
     }
     //if (waitForm != null) waitForm.Close();
 }