Exemplo n.º 1
0
        public DSEForm()
        {
            if (!DSEFormHelper.IsOSSupported)
            {
                this.ShowMessageBox(
                    Language.Message_Requires_Later_OS,
                    Language.Product_Name,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);

                Application.Exit();
            }

            if (!DSEFormHelper.IsRunAsAdmin)
            {
                DSEFormHelper.RunAsAdministrator();
            }

            var lang = Settings.Default.Language;

            if (lang != null && !CultureInfo.InvariantCulture.Equals(lang))
            {
                Thread.CurrentThread.CurrentCulture   = lang;
                Thread.CurrentThread.CurrentUICulture = lang;
            }

            this.Font = SystemFonts.MessageBoxFont;

            this.InitializeComponent();

            this.Icon = DSEFormHelper.ExtractAssociatedIcon(Application.ExecutablePath);
            this.BuildLanguageMenu();

            this.lstDriverStoreEntries.PrimarySortColumn   = this.driverClassColumn;
            this.lstDriverStoreEntries.PrimarySortOrder    = SortOrder.Ascending;
            this.lstDriverStoreEntries.SecondarySortColumn = this.driverDateColumn;
            this.lstDriverStoreEntries.SecondarySortOrder  = SortOrder.Descending;
            this.lstDriverStoreEntries.CheckBoxes          = DSEFormHelper.IsRunAsAdmin;

            this.SetupListViewColumns();

            Trace.TraceInformation("---------------------------------------------------------------");
            Trace.TraceInformation($"{Application.ProductName} started");

            this.UpdateDriverStore(DriverStoreFactory.CreateOnlineDriverStore());

            this.UpdateCheckedItemSizeTimer = new Timer(x => this.BeginInvoke((Action)(() => this.UpdateCheckedItemSize())));
        }
Exemplo n.º 2
0
 private void RunAsAdminToolStripMenuItem_Click(object sender, EventArgs e)
 {
     DSEFormHelper.RunAsAdministrator();
 }