Exemple #1
0
        private void WaitOnLoad()
        {
            inboxDriver_DataGridView.DataSource = null;

            if (DriverStoreScanner.Instance.ScanningComplete)
            {
                inboxDriver_DataGridView.DataSource = new SortableBindingList <PrintDeviceDriver>(DriverStoreScanner.Instance.Drivers);
                driversFound_Label.Text             =
                    _driverCountFormat.FormatWith(DriverStoreScanner.Instance.Drivers.Count);
            }
            else
            {
                using (DriverStoreScanningForm form = new DriverStoreScanningForm())
                {
                    DialogResult result = form.ShowDialog();

                    if (result == System.Windows.Forms.DialogResult.OK)
                    {
                        inboxDriver_DataGridView.DataSource = new SortableBindingList <PrintDeviceDriver>(DriverStoreScanner.Instance.Drivers);
                        driversFound_Label.Text             =
                            _driverCountFormat.FormatWith(DriverStoreScanner.Instance.Drivers.Count);
                    }
                    else
                    {
                        Close();
                    }
                }
            }
        }
        /// <summary>
        /// Upgrades the driver.
        /// </summary>
        public void UpgradeDriver()
        {
            // If this is an XP based machine, the driver name is not stored in the registry
            // so preload the driver data
            if (Environment.OSVersion.Version.Major < 6)
            {
                if (!DriverStoreScanner.Instance.ScanningComplete)
                {
                    using (DriverStoreScanningForm form = new DriverStoreScanningForm())
                    {
                        DialogResult result = form.ShowDialog();

                        if (result != System.Windows.Forms.DialogResult.OK)
                        {
                            return;
                        }
                    }
                }
            }

            if (_upgradeForm == null)
            {
                _upgradeForm = new DriverUpgradeForm(_manager);
            }

            _upgradeForm.LoadDrivers();
            _upgradeForm.ShowDialog();
        }