Beispiel #1
0
        private static void ClipboardUploadCached(ClipboardContentViewer ccv, TaskSettings taskSettings = null)
        {
            if (taskSettings == null)
            {
                taskSettings = TaskSettings.GetDefaultTaskSettings();
            }

            if (ccv.ClipboardContentType == EClipboardContentType.Image)
            {
                Image img = (Image)ccv.ClipboardContent;

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

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

                ProcessFilesUpload(files, taskSettings);
            }
        }
        public static void ClipboardUploadWithContentViewer(TaskSettings taskSettings = null)
        {
            if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings();

            using (ClipboardContentViewer ccv = new ClipboardContentViewer())
            {
                ProcessClipboardContentViewerDialog(ccv, taskSettings);
            }
        }
Beispiel #3
0
        public static void ClipboardUploadWithContentViewer(TaskSettings taskSettings = null)
        {
            if (taskSettings == null)
            {
                taskSettings = TaskSettings.GetDefaultTaskSettings();
            }

            using (ClipboardContentViewer ccv = new ClipboardContentViewer())
            {
                if (ccv.ShowDialog() == DialogResult.OK && !ccv.IsClipboardEmpty)
                {
                    ClipboardUpload(taskSettings);
                }
            }
        }
        public static void ClipboardUploadMainWindow(TaskSettings taskSettings = null)
        {
            if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings();

            if (Program.Settings.ShowClipboardContentViewer)
            {
                using (ClipboardContentViewer ccv = new ClipboardContentViewer(true))
                {
                    ProcessClipboardContentViewerDialog(ccv, taskSettings);

                    Program.Settings.ShowClipboardContentViewer = !ccv.DontShowThisWindow;
                }
            }
            else
            {
                ClipboardUpload(taskSettings);
            }
        }
        public override void ClipboardUpload()
        {
            if (Engine.ConfigUI.ShowClipboardContentViewer)
            {
                using (var ccv = new ClipboardContentViewer())
                {
                    if (ccv.ShowDialog() == DialogResult.OK && !ccv.IsClipboardEmpty)
                    {
                        UploadUsingClipboard();
                    }

                    Engine.ConfigUI.ShowClipboardContentViewer = !ccv.DontShowThisWindow;
                }
            }
            else
            {
                UploadUsingClipboard();
            }
        }
        public static void ClipboardUploadWithContentViewer()
        {
            if (Program.Settings.ShowClipboardContentViewer)
            {
                using (ClipboardContentViewer ccv = new ClipboardContentViewer())
                {
                    if (ccv.ShowDialog() == DialogResult.OK && !ccv.IsClipboardEmpty)
                    {
                        UploadManager.ClipboardUpload();
                    }

                    Program.Settings.ShowClipboardContentViewer = !ccv.DontShowThisWindow;
                }
            }
            else
            {
                UploadManager.ClipboardUpload();
            }
        }
        private static void ProcessClipboardContentViewerDialog(ClipboardContentViewer ccv, TaskSettings taskSettings = null)
        {
            if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings();

            if (ccv.ShowDialog() == DialogResult.OK && ccv.IsClipboardContentValid)
            {
                if (ccv.ClipboardContentType != EClipboardContentType.Default)
                {
                    ClipboardUploadCached(ccv, taskSettings);
                }
                else
                {
                    ClipboardUpload(taskSettings);
                }
            }
            else if (ccv.ClipboardContentType == EClipboardContentType.Image)
            {
                ((Image)ccv.ClipboardContent).Dispose();
            }
        }
Beispiel #8
0
        public static void ClipboardUploadMainWindow(TaskSettings taskSettings = null)
        {
            if (taskSettings == null)
            {
                taskSettings = TaskSettings.GetDefaultTaskSettings();
            }

            if (Program.Settings.ShowClipboardContentViewer)
            {
                using (ClipboardContentViewer ccv = new ClipboardContentViewer(true))
                {
                    if (ccv.ShowDialog() == DialogResult.OK && !ccv.IsClipboardEmpty)
                    {
                        ClipboardUpload(taskSettings);
                    }

                    Program.Settings.ShowClipboardContentViewer = !ccv.DontShowThisWindow;
                }
            }
            else
            {
                ClipboardUpload(taskSettings);
            }
        }