Ejemplo n.º 1
0
        private static void ClipboardUploadCached(ClipboardUploadForm form, TaskSettings taskSettings = null)
        {
            if (taskSettings == null)
            {
                taskSettings = TaskSettings.GetDefaultTaskSettings();
            }

            if (form.ClipboardContentType == EClipboardContentType.Image)
            {
                Bitmap bmp = (Bitmap)form.ClipboardContent;

                ProcessImageUpload(bmp, taskSettings);
            }
            else if (form.ClipboardContentType == EClipboardContentType.Text)
            {
                string text = (string)form.ClipboardContent;

                ProcessTextUpload(text, taskSettings);
            }
            else if (form.ClipboardContentType == EClipboardContentType.Files)
            {
                string[] files = (string[])form.ClipboardContent;

                ProcessFilesUpload(files, taskSettings);
            }
        }
Ejemplo n.º 2
0
        public static void ClipboardUploadWithContentViewer(TaskSettings taskSettings = null)
        {
            if (taskSettings == null)
            {
                taskSettings = TaskSettings.GetDefaultTaskSettings();
            }

            using (ClipboardUploadForm clipboardUploadForm = new ClipboardUploadForm(taskSettings))
            {
                clipboardUploadForm.ShowDialog();
            }
        }
Ejemplo n.º 3
0
        public static void ClipboardUploadMainWindow(TaskSettings taskSettings = null)
        {
            if (taskSettings == null)
            {
                taskSettings = TaskSettings.GetDefaultTaskSettings();
            }

            if (Program.Settings.ShowClipboardContentViewer)
            {
                using (ClipboardUploadForm clipboardUploadForm = new ClipboardUploadForm(taskSettings, true))
                {
                    clipboardUploadForm.ShowDialog();
                    Program.Settings.ShowClipboardContentViewer = !clipboardUploadForm.DontShowThisWindow;
                }
            }
            else
            {
                ClipboardUpload(taskSettings);
            }
        }
Ejemplo n.º 4
0
        private static void ProcessClipboardUploadDialog(ClipboardUploadForm form, TaskSettings taskSettings = null)
        {
            if (taskSettings == null)
            {
                taskSettings = TaskSettings.GetDefaultTaskSettings();
            }

            if (form.ShowDialog() == DialogResult.OK && form.IsClipboardContentValid)
            {
                if (form.ClipboardContentType != EClipboardContentType.Default)
                {
                    ClipboardUploadCached(form, taskSettings);
                }
                else
                {
                    ClipboardUpload(taskSettings);
                }
            }
            else if (form.ClipboardContentType == EClipboardContentType.Image)
            {
                ((Bitmap)form.ClipboardContent).Dispose();
            }
        }