Пример #1
0
        //-------------------------------------------------------------------------------------------------------------
        private void BrowserButton_Click(object sender, EventArgs e)
        //-------------------------------------------------------------------------------------------------------------
        {
            // callback for click event inside the browserControls
            BrowserButtonControl button;

            if (sender is BrowserButtonControl)
            {
                button = (BrowserButtonControl)sender;
            }
            else if (((Control)sender).Parent is BrowserButtonControl)
            {
                button = (BrowserButtonControl)((Control)sender).Parent;
            }
            else
            {
                throw new Exception("Invalid item was clicked!");
            }

            UrlProcessor processor = new UrlProcessor();

            // check if create rule button was clicked
            if (button.createRule)
            {
                ShowAddRuleMenu(button.browser);
            }
            else if ((ModifierKeys & Keys.Shift) != 0 || (ModifierKeys & Keys.Alt) != 0)    // open in incognito
            {
                processor.OpenUrl(button.browser, true);
            }
            else
            {
                processor.OpenUrl(button.browser);
            }
        }
Пример #2
0
        //-------------------------------------------------------------------------------------------------------------
        public void AddRule(string type, string pattern, BrowserModel browser)
        //-------------------------------------------------------------------------------------------------------------
        {
            SaveRule(type, pattern, browser);

            UrlProcessor processor = new UrlProcessor();

            processor.OpenUrl(browser);
        }
Пример #3
0
        //-------------------------------------------------------------------------------------------------------------
        private void BrowserSelectView_KeyPress(object sender, KeyPressEventArgs e)
        //-------------------------------------------------------------------------------------------------------------
        {
            int i = 1;

            foreach (var browser in browsers)
            {
                if (browser.shortcuts.Contains(e.KeyChar) || e.KeyChar == (Convert.ToString(i++))[0])
                {
                    UrlProcessor processor = new UrlProcessor();
                    processor.OpenUrl(browser);
                    return;
                }
            }
        }