Esempio n. 1
0
        public frm_settings()
        {
            InitializeComponent();

            HotkeyStrings hotkey = new HotkeyStrings();
            txtHotkeyDefined.Text = hotkey.getHotkeyStringDefined();
            txtHotkeyFull.Text = hotkey.getHotkeyStringFull();
            txtHotkeyActive.Text = hotkey.getHotkeyStringActive();

            chkBxAutoStart.Checked = settings.AutoStart;
            chkBxExplorerContextMenu.Checked = settings.ExplorerContextMenu;
            chkBxSaveLocal.Checked = settings.SaveLocal;
            chkBxPopups.Checked = settings.Popups;
            txtSavePath.Text = settings.Path;

            this.chkBxAutoStart.CheckedChanged += new System.EventHandler(this.chkBxAutoStart_CheckedChanged);
            this.chkBxExplorerContextMenu.CheckedChanged += new System.EventHandler(this.chkBxExplorerContextMenu_CheckedChanged);
            LoadUploadLog();

            if (IsUserAdministrator())
            {
                chkBxAutoStart.Enabled = true;
                chkBxExplorerContextMenu.Enabled = true;
            }
            else
            {
                MessageBox.Show("Close the application and restart it with admin rights because it needs to edit registry keys");
            }
        }
Esempio n. 2
0
        public TrayIcon()
        {
            trayIcon = new NotifyIcon();
            trayIcon.Icon = new Icon(Properties.Resources.snipup, 40, 40);
            trayIcon.Visible = true;
            trayIcon.Text = "SnipUp";

            HotkeyStrings hotkey = new HotkeyStrings();
            settingsMenu = new ContextMenuStrip();
            settingsMenu.Items.Add("Defined Area Capture [" + hotkey.getHotkeyStringDefined() + "]", Properties.Resources.IconDefined, (sender, e) => NewScreenshot(SnippingTool.ScreenshotType.DEFINED));
            settingsMenu.Items.Add("Fullscreen Capture [" + hotkey.getHotkeyStringFull() + "]", Properties.Resources.IconFull, (sender, e) => NewScreenshot(SnippingTool.ScreenshotType.FULL));
            settingsMenu.Items.Add("Active Window Capture [" + hotkey.getHotkeyStringActive() + "]", Properties.Resources.IconActive, (sender, e) => NewScreenshot(SnippingTool.ScreenshotType.ACTIVE));
            settingsMenu.Items.Add("-");
            settingsMenu.Items.Add("Settings", Properties.Resources.IconSettings, (sender, e) => OpenSettings());
            settingsMenu.Items.Add("Open Folder", Properties.Resources.IconFolder, (sender, e) => OpenFolder());
            settingsMenu.Items.Add("-");
            settingsMenu.Items.Add("Exit", null, (sender, e) => Application.Exit());
            trayIcon.ContextMenuStrip = settingsMenu;
        }