Example #1
0
        private void ButtonAddSource_Click(object sender, EventArgs e)
        {
            if (!_machineAvailable)
            {
                return;
            }

            _disableStateChangedEvents = true;
            _selectedSource            = new DistributionSource();
            DistributionSources.Add(_selectedSource);
            DistributionSourcesChanged = true;
            DisplayPath(_selectedSource.Path);
            textBoxFilter.Text        = _selectedSource.Filter;
            checkBoxRecursive.Checked = _selectedSource.Recursive;
            checkBoxInclusive.Checked = _selectedSource.Inclusive;
            ListViewItem item = listViewSources.Items.Add(new ListViewItem(new[]
            {
                _selectedSource.Path ?? UNSPECIFIED_PATH,
                _selectedSource.Filter,
                _selectedSource.Recursive.ToString(CultureInfo.InvariantCulture),
                _selectedSource.Inclusive.ToString(CultureInfo.InvariantCulture)
            })
            {
                Tag = _selectedSource
            });

            _disableStateChangedEvents = false;
            item.Selected       = true;
            panelSource.Visible = true;
            EnableControls();
            textBoxPath.Focus();
        }