Ejemplo n.º 1
0
        internal void InitializeOnActivated()
        {
            if (_initialized)
            {
                return;
            }

            _initialized = true;
            // get packages sources
            IList <PackageSource> allPackageSources         = _packageSourceProvider.LoadPackageSources().ToList();
            IList <PackageSource> packageSources            = allPackageSources.Where(ps => !ps.IsMachineWide).ToList();
            IList <PackageSource> machineWidePackageSources = allPackageSources.Where(ps => ps.IsMachineWide).ToList();

            _activeSource = _packageSourceProvider.ActivePackageSource;

            // bind to the package sources, excluding Aggregate
            _packageSources = new BindingSource(packageSources.Select(ps => ps.Clone()).ToList(), null);
            _packageSources.CurrentChanged  += OnSelectedPackageSourceChanged;
            PackageSourcesListBox.GotFocus  += PackageSourcesListBox_GotFocus;
            PackageSourcesListBox.DataSource = _packageSources;

            if (machineWidePackageSources.Count > 0)
            {
                _machineWidepackageSources = new BindingSource(machineWidePackageSources.Select(ps => ps.Clone()).ToList(), null);
                _machineWidepackageSources.CurrentChanged  += OnSelectedMachineWidePackageSourceChanged;
                MachineWidePackageSourcesListBox.GotFocus  += MachineWidePackageSourcesListBox_GotFocus;
                MachineWidePackageSourcesListBox.DataSource = _machineWidepackageSources;
            }
            else
            {
                MachineWidePackageSourcesListBox.Visible = MachineWideSourcesLabel.Visible = false;
            }

            OnSelectedPackageSourceChanged(null, EventArgs.Empty);
        }
Ejemplo n.º 2
0
        internal void InitializeOnActivated()
        {
            if (_initialized)
            {
                return;
            }

            _initialized = true;
            // get packages sources
            IList <PackageSource> packageSources = _packageSourceProvider.LoadPackageSources().ToList();

            _activeSource = _packageSourceProvider.ActivePackageSource;

            // bind to the package sources, excluding Aggregate
            _allPackageSources = new BindingSource(packageSources.Select(ps => ps.Clone()).ToList(), null);
            _allPackageSources.CurrentChanged += OnSelectedPackageSourceChanged;
            PackageSourcesListBox.DataSource   = _allPackageSources;
        }