Esempio n. 1
0
 public WinformBrowser(string url = "about:blank")
 {
     if (!PlatformFunction.IsMono)
     {
         try {
             PlatformFunction.SetWebBrowserFeatures();
             CoInternetSetFeatureEnabled(FEATURE_LOCALMACHINE_LOCKDOWN, SET_FEATURE_ON_PROCESS, false);
         } catch {
             // No need to handle registry errors
         }
     }
     browser = new WebBrowser {
         IsWebBrowserContextMenuEnabled = false,
         AllowWebBrowserDrop            = false,
         ScriptErrorsSuppressed         = false,
         WebBrowserShortcutsEnabled     = false
     };
     browser.DocumentCompleted += Browser_DocumentCompleted;
     browser.PreviewKeyDown    += Browser_PreviewKeyDown;
     browser.ObjectForScripting = new ScriptManager(this);
     if (url != "about:blank")
     {
         browser.Navigate(new Uri(url));
     }
 }
Esempio n. 2
0
        private void tsbtnUserConfig_Click(object sender, EventArgs e)
        {
            var result = new FormUserConfig().ShowDialog();

            if (result == DialogResult.Abort)
            {
                // How can I stop WebView2 from occupying the files?
                // I cannot delete the entire DataDirectory
                mainWebBrowser.Dispose();
                if (File.Exists(PreferenceManager.PreferencePath))
                {
                    File.Delete(PreferenceManager.PreferencePath);
                }
                if (!PlatformFunction.IsMono)
                {
                    PlatformFunction.UnsetWebBrowserFeatures();
                }
                PreferenceManager.Current = null;
                Application.Exit();
            }
            if (PreferenceManager.Current != null)
            {
                updateTitleAndSaveBtn();
            }
        }
Esempio n. 3
0
 private void InfoLabel_LinkClicked(object sender, EventArgs e)
 {
     if (TargetUrl != null && !browserReady)
     {
         PlatformFunction.CallBrowser(TargetUrl);
     }
 }
Esempio n. 4
0
 private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     PlatformFunction.CallBrowser("https://www.zbx1425.cn");
 }
Esempio n. 5
0
 private void tsbtnHelp_Click(object sender, EventArgs e)
 {
     PlatformFunction.CallBrowser("https://www.zbx1425.cn/nautilus/blocklyats");
 }
Esempio n. 6
0
 private void llbEmail_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     PlatformFunction.CallBrowser("mailto:[email protected]?subject=BlocklyAts%20Bug%20Report");
 }
Esempio n. 7
0
 private void llbTwitter_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     PlatformFunction.CallBrowser("https://twitter.com/messages/compose?recipient_id=797350934653210624");
 }
Esempio n. 8
0
 private void llbGithub_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     PlatformFunction.CallBrowser("https://github.com/zbx1425/BlocklyAts/issues/new");
 }