Example #1
0
        private void SetProgressText(IWorkshareTask task)
        {
            try
            {
                if (InvokeRequired)
                {
                    Invoke(new MethodInvoker(() => SetProgressText(task)));
                    return;
                }

                lblAttachment.Height = this.Parent.Height / 2 - 32;

                var discoveryTask = task as TaskDiscovery;
                if (discoveryTask != null)
                {
                    lblHeading.Text = "Discovering";
                    lblAttachment.Text = discoveryTask.Attachment.Name;
                }

                var cleanTask = task as TaskClean;
                if (cleanTask != null)
                {
                    lblHeading.Text = "Cleaning";
                    lblAttachment.Text = cleanTask.Attachment.Name;
                }

                var cleanPdfTask = task as TaskCleanPdf;
                if (cleanPdfTask != null)
                {
                    lblHeading.Text = "Cleaning";
                    lblAttachment.Text = cleanPdfTask.Attachment.Name;
                }

                var pdfTask = task as TaskPdf;
                if (pdfTask != null)
                {
                    lblHeading.Text = "Converting";
                    lblAttachment.Text = pdfTask.Attachment.Name;
                }

                var linkTask = task as TaskSendLink;
                if (linkTask != null)
                {
                    lblHeading.Text = "Processing";
                    lblAttachment.Text = "";
                }

                var zipTask = task as TaskZip;
                if (zipTask != null)
                {
                    lblHeading.Text = "Compressing";
                    lblAttachment.Text = "";
                }
            }
            catch (ObjectDisposedException e)
            {
                Logger.LogError(e);   
            }
        }
Example #2
0
        public ActionEventArgs(IWorkshareTask task, string status)
        {
            Task = task;

            var itemTask = task as IWorkshareItemTask;
            if (itemTask != null)
            {
                Attachment = itemTask.Attachment;
            }

            Status = status;
        }
Example #3
0
        public static string GetProgressText(IWorkshareTask task, out string attachmentName)
        {
            attachmentName = string.Empty;

            try
            {
                var discoveryTask = task as TaskDiscovery;
                if (discoveryTask != null)
                {
                    attachmentName = discoveryTask.Attachment.Name;
                    return "Discovering";
                }

                var cleanTask = task as TaskClean;
                if (cleanTask != null)
                {
                    attachmentName = cleanTask.Attachment.Name;
                    return "Cleaning";
                }

                var cleanPdfTask = task as TaskCleanPdf;
                if (cleanPdfTask != null)
                {
                    attachmentName = cleanPdfTask.Attachment.Name;
                    return "Cleaning";
                }

                var pdfTask = task as TaskPdf;
                if (pdfTask != null)
                {
                    attachmentName = pdfTask.Attachment.Name;
                    return "Converting";
                }

                var linkTask = task as TaskSendLink;
                if (linkTask != null)
                {
                    return "Securely uploading attachment(s)";
                }

                var zipTask = task as TaskZip;
                if (zipTask != null)
                {
                    return "Compressing attachment(s)";
                }
            }
            catch (Exception e)
            {
                Logger.LogError(e);   
            }
            return string.Empty;
        }