Example #1
0
 public override void DoAction()
 {
     CaptureForm.StartCapture(WorkMode.AutoCapture, CaptureMode.FullScreen, (image) =>
     {
         if (image != null)
         {
             Clipboard.SetImage(image);
         }
     });
 }
Example #2
0
 public override void DoAction()
 {
     CaptureForm.StartCapture(WorkMode.OnlyCapture, (image) =>
     {
         if (image != null)
         {
             editAction.DoAction();
         }
     });
 }
Example #3
0
 public override void DoAction()
 {
     CaptureForm.StartCapture(WorkMode.General, CaptureMode.SmartScan, (image) =>
     {
         if (image != null)
         {
             Clipboard.SetImage(image);
         }
     });
 }
Example #4
0
        protected override void OnClosing(CancelEventArgs e)
        {
            //ConfigurationManager.Instance.SaveCurrentUserConfiguration();

            DisableHotKey();

            try
            {
                CaptureForm.Shutdown();
            }
            catch { }

            base.OnClosing(e);
        }
Example #5
0
        public MainForm(bool systemTray, string[] args)
        {
            this.SystemTray = systemTray;
            this.args       = args;
            instance        = this;

            InitializeComponent();

            InitCulture();

            notifyIcon1.DoubleClick += (s, e) =>
                                       ShortcutActionManager.Instance.DoActionById((int)ActionIds.CaptureRegionOfScreen_Clipboard);

            captureRegionOfScreenToolStripMenuItem.Click += (s, e) =>
            {
                Thread.Sleep(200);
                ShortcutActionManager.Instance.DoActionById((int)ActionIds.CaptureRegionOfScreen_Clipboard);
            };

            captureWindowToolStripMenuItem.Click += (s, e) =>
            {
                Thread.Sleep(200);
                ShortcutActionManager.Instance.DoActionById((int)ActionIds.CaptureWindow_Clipboard);
            };

            captureFullScreenToolStripMenuItem.Click += (s, e) =>
            {
                Thread.Sleep(200);
                ShortcutActionManager.Instance.DoActionById((int)ActionIds.CaptureFullScreen_Clipboard);
            };

            smartScanToolStripMenuItem.Click += (s, e) =>
            {
                Thread.Sleep(200);
                ShortcutActionManager.Instance.DoActionById((int)ActionIds.CaptureSmartScan_Clipboard);
            };

            saveLastPictureToolStripMenuItem.Click += (s, e) =>
            {
                if (CaptureForm.LastCapturedImage == null)
                {
                    MessageBox.Show(LangResource.no_picture_captured);
                }
                else
                {
                    ShortcutActionManager.Instance.DoActionById((int)ActionIds.SaveLastPicture);
                }
            };

            printLastCapturedPictureToolStripMenuItem.Click += (s, e) =>
            {
                if (CaptureForm.LastCapturedImage == null)
                {
                    MessageBox.Show(LangResource.no_picture_captured);
                }
                else
                {
                    ShortcutActionManager.Instance.DoActionById((int)ActionIds.PrintLastPicture);
                }
            };

            imageEditorToolStripMenuItem.Click += (s, e) =>
            {
                ShortcutActionManager.Instance.DoActionById((int)ActionIds.EditLastPicture);
            };

            settingsToolStripMenuItem.Click += (s, e) =>
            {
                // unregister hotkeys
                ShortcutActionManager.UnregisterAllShortcutActions(this.Handle);

                new SettingForm().ShowDialog();

                MainForm.Instance.InitCulture();
                CaptureForm.InitInstanceCulture();

                if (!this.IsDisposed)
                {
                    // reregister hotkeys
                    ShortcutActionManager.RegisterAllShortcutActions(this.Handle);
                }
            };

            homepageToolStripMenuItem.Click += (s, e) => ProductInfo.OpenProductHomepage();

            aboutToolStripMenuItem.Click += (s, e) =>
            {
                new AboutForm().ShowDialog();
            };

            contextMenuStrip1.Opening += (s, e) =>
            {
                saveLastPictureToolStripMenuItem.Enabled =
                    printLastCapturedPictureToolStripMenuItem.Enabled =
                        CaptureForm.LastCapturedImage != null;
            };

            tipsToolStripMenuItem.Click += (s, e) => TipsForm.ShowTipSlides(StartTipsKey, false);
        }