Пример #1
0
 private void btnCustomWebBrowserPathFileDialog_Click(object sender, EventArgs e)
 {
     if (WebBrowserUtility.TrySelectWebBrowserPath(optionPage.CustomWebBrowserPath, out var newPath))
     {
         optionPage.CustomWebBrowserPath = newPath;
         txtboxCustomWebBrowserPath.Text = optionPage.CustomWebBrowserPath;
     }
 }
Пример #2
0
        private void dropdownWebBrowserType_SelectedIndexChanged(object sender, EventArgs e)
        {
            var currentType = (WebBrowserType)dropdownWebBrowserType.SelectedIndex;

            if (optionPage.WebBrowserType == currentType)
            {
                return;
            }

            if (currentType == WebBrowserType.CustomWebBrowser &&
                string.IsNullOrEmpty(optionPage.CustomWebBrowserPath))
            {
                if (!WebBrowserUtility.TrySelectWebBrowserPath(optionPage.CustomWebBrowserPath, out var newPath))
                {
                    optionPage.CustomWebBrowserPath      = newPath;
                    txtboxCustomWebBrowserPath.Text      = optionPage.CustomWebBrowserPath;
                    dropdownWebBrowserType.SelectedIndex = (int)optionPage.WebBrowserType;
                    return;
                }
            }

            optionPage.WebBrowserType = currentType;
            UpdateCustomWebBrowserUI();
        }