Exemple #1
0
        private void SetInternetExplorerMode()
        {
            try
            {
                switch ((string)cbEmulateIEver.SelectedItem)
                {
                case "(Latest)":
                    InternetExplorerBrowserEmulation.SetBrowserEmulationVersion();
                    break;

                case "Edge (Pretending)":
                    InternetExplorerBrowserEmulation.SetBrowserEmulationVersion(BrowserEmulationVersion.Version12Edge);
                    break;

                case "11 - Quirks Mode":
                    InternetExplorerBrowserEmulation.SetBrowserEmulationVersion(BrowserEmulationVersion.Version11);
                    break;

                case "11 - Edge Mode":
                    InternetExplorerBrowserEmulation.SetBrowserEmulationVersion(BrowserEmulationVersion.Version11Edge);
                    break;

                case "10 - Quirks Mode":
                    InternetExplorerBrowserEmulation.SetBrowserEmulationVersion(BrowserEmulationVersion.Version10);
                    break;

                case "10 - Standards Mode":
                    InternetExplorerBrowserEmulation.SetBrowserEmulationVersion(BrowserEmulationVersion.Version10Standards);
                    break;

                case "9 - Quirks Mode":
                    InternetExplorerBrowserEmulation.SetBrowserEmulationVersion(BrowserEmulationVersion.Version9);
                    break;

                case "9 - Standards Mode":
                    InternetExplorerBrowserEmulation.SetBrowserEmulationVersion(BrowserEmulationVersion.Version9Standards);
                    break;

                case "8 - Quirks Mode":
                    InternetExplorerBrowserEmulation.SetBrowserEmulationVersion(BrowserEmulationVersion.Version8);
                    break;

                case "8 - Standards Mode":
                    InternetExplorerBrowserEmulation.SetBrowserEmulationVersion(BrowserEmulationVersion.Version8Standards);
                    break;

                case "7":
                    InternetExplorerBrowserEmulation.SetBrowserEmulationVersion(BrowserEmulationVersion.Version7);
                    break;

                default:
                    InternetExplorerBrowserEmulation.SetBrowserEmulationVersion();
                    break;
                }
            }
            catch
            {
                InternetExplorerBrowserEmulation.SetBrowserEmulationVersion();
            }
        }
        public static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            InternetExplorerBrowserEmulation.SetBrowserEmulationVersion();

            Application.Run(new MainForm());
        }
Exemple #3
0
        public Usage()
        {
            if (!Cyotek.ApplicationServices.Windows.Forms.InternetExplorerBrowserEmulation.IsBrowserEmulationSet())
            {
                IsWebbrowserOk = InternetExplorerBrowserEmulation.SetBrowserEmulationVersion();
            }
            else
            {
                IsWebbrowserOk = true;
            }

            InitializeComponent();
        }
Exemple #4
0
        public BoatDetail(string fullName, int accessLevel, int boatId, int memberId)
        {
            FullName    = fullName;
            AccessLevel = accessLevel;
            MemberId    = memberId;
            BoatID      = boatId;
            InitializeComponent();

            //Update Web browser IE version to latest for emulation
            if (!InternetExplorerBrowserEmulation.IsBrowserEmulationSet())
            {
                InternetExplorerBrowserEmulation.SetBrowserEmulationVersion();
            }
        }
Exemple #5
0
        public GitHubOAuthView(IGitHubClientFactory gitHubClientFactory)
        {
            _gitHubClientFactory = gitHubClientFactory;

            InitializeComponent();

            this.Loaded += (sender, args) =>
            {
                if (!InternetExplorerBrowserEmulation.IsBrowserEmulationSet())
                {
                    InternetExplorerBrowserEmulation.SetBrowserEmulationVersion();
                }

                IsLoading = true;
                WebBrowser.Navigate(AuthUrl);
            };
        }
Exemple #6
0
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (!EnvUtils.IsMonoRuntime())
            {
                try
                {
                    NBug.Settings.UIMode = NBug.Enums.UIMode.Full;

                    // Uncomment the following after testing to see that NBug is working as configured
                    NBug.Settings.ReleaseMode = true;
                    NBug.Settings.ExitApplicationImmediately = false;
                    NBug.Settings.WriteLogToDisk             = false;
                    NBug.Settings.MaxQueuedReports           = 10;
                    NBug.Settings.StopReportingAfter         = 90;
                    NBug.Settings.SleepBeforeSend            = 30;
                    NBug.Settings.StoragePath = NBug.Enums.StoragePath.WindowsTemp;

                    AppDomain.CurrentDomain.UnhandledException += NBug.Handler.UnhandledException;
                    Application.ThreadException += NBug.Handler.ThreadException;
#if !__MonoCS__
                    if (!InternetExplorerBrowserEmulation.IsBrowserEmulationSet())
                    {
                        InternetExplorerBrowserEmulation.SetBrowserEmulationVersion();
                    }
#endif
                }
                catch (TypeInitializationException tie)
                {
                    // is this exception caused by the configuration?
                    if (tie.InnerException != null &&
                        tie.InnerException.GetType()
                        .IsSubclassOf(typeof(System.Configuration.ConfigurationException)))
                    {
                        HandleConfigurationException((System.Configuration.ConfigurationException)tie.InnerException);
                    }
                }
            }

            string[] args = Environment.GetCommandLineArgs();
            FormSplash.ShowSplash();
            //Store here SynchronizationContext.Current, because later sometimes it can be null
            //see http://stackoverflow.com/questions/11621372/synchronizationcontext-current-is-null-in-continuation-on-the-main-ui-thread
            GitUIExtensions.UISynchronizationContext = SynchronizationContext.Current;
            Application.DoEvents();

            AppSettings.LoadSettings();
            if (EnvUtils.RunningOnWindows())
            {
                //Quick HOME check:
                FormSplash.SetAction("Checking home path...");
                Application.DoEvents();

                FormFixHome.CheckHomePath();
            }
            //Register plugins
            FormSplash.SetAction("Loading plugins...");
            Application.DoEvents();

            if (string.IsNullOrEmpty(AppSettings.Translation))
            {
                using (var formChoose = new FormChooseTranslation())
                {
                    formChoose.ShowDialog();
                }
            }

            try
            {
                if (AppSettings.CheckSettings || string.IsNullOrEmpty(AppSettings.GitCommandValue))
                {
                    FormSplash.SetAction("Checking settings...");
                    Application.DoEvents();

                    GitUICommands     uiCommands         = new GitUICommands(string.Empty);
                    var               commonLogic        = new CommonLogic(uiCommands.Module);
                    var               checkSettingsLogic = new CheckSettingsLogic(commonLogic);
                    ISettingsPageHost fakePageHost       = new SettingsPageHostMock(checkSettingsLogic);
                    using (var checklistSettingsPage = SettingsPageBase.Create <ChecklistSettingsPage>(fakePageHost))
                    {
                        if (!checklistSettingsPage.CheckSettings())
                        {
                            checkSettingsLogic.AutoSolveAllSettings();
                            uiCommands.StartSettingsDialog();
                        }
                    }
                }
            }
            catch
            {
                // TODO: remove catch-all
            }

            FormSplash.HideSplash();

            if (EnvUtils.RunningOnWindows())
            {
                MouseWheelRedirector.Active = true;
            }

            GitUICommands uCommands = new GitUICommands(GetWorkingDir(args));

            if (args.Length <= 1)
            {
                uCommands.StartBrowseDialog();
            }
            else  // if we are here args.Length > 1
            {
                uCommands.RunCommand(args);
            }

            AppSettings.SaveSettings();
        }
        private void WebBrowserVersionSetting()
        {
            RegistryKey registryKey = null; // 레지스트리 변경에 사용 될 변수

            int browserver        = 0;
            int ie_emulation      = 0;
            var targetApplication = Process.GetCurrentProcess().ProcessName + ".exe"; // 현재 프로그램 이름

            try
            {
                registryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(
                    @"SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", true);

                if (!InternetExplorerBrowserEmulation.IsBrowserEmulationSet())
                {
                    InternetExplorerBrowserEmulation.SetBrowserEmulationVersion();
                    browserver = InternetExplorerBrowserEmulation.GetInternetExplorerMajorVersion();
                    if (browserver >= 11)
                    {
                        ie_emulation = 11001;
                    }
                    else if (browserver == 10)
                    {
                        ie_emulation = 10001;
                    }
                    else if (browserver == 9)
                    {
                        ie_emulation = 9999;
                    }
                    else if (browserver == 8)
                    {
                        ie_emulation = 8888;
                    }
                    else
                    {
                        ie_emulation = 7000;
                    }
                }
                // IE가 없으면 실행 불가능
                if (registryKey == null)
                {
                    MessageBox.Show("웹 브라우저 버전 초기화에 실패했습니다..!");
                    System.Windows.Application.Current.Shutdown();
                    return;
                }

                string FindAppkey = Convert.ToString(registryKey.GetValue(targetApplication));

                // 이미 키가 있다면 종료
                if (FindAppkey == ie_emulation.ToString())
                {
                    registryKey.Close();
                    return;
                }

                // 키가 없으므로 키 셋팅
                registryKey.SetValue(targetApplication, unchecked ((int)ie_emulation), RegistryValueKind.DWord);

                // 다시 키를 받아와서
                FindAppkey = Convert.ToString(registryKey.GetValue(targetApplication));

                // 현재 브라우저 버전이랑 동일 한지 판단
                if (FindAppkey == ie_emulation.ToString())
                {
                    return;
                }
                else
                {
                    MessageBox.Show("웹 브라우저 버전 초기화에 실패했습니다..!");
                    System.Windows.Application.Current.Shutdown();
                    return;
                }
            }
            catch
            {
                MessageBox.Show("웹 브라우저 버전 초기화에 실패했습니다..!");
                System.Windows.Application.Current.Shutdown();
                return;
            }
            finally
            {
                // 키 메모리 해제
                if (registryKey != null)
                {
                    registryKey.Close();
                }
            }
        }