示例#1
0
        public AddProgramSource(Settings.ProgramSource edit, Settings settings)
        {
            _editing = edit;
            _settings = settings;

            InitializeComponent();
            Directory.Text = _editing.Location;
        }
示例#2
0
        private void ButtonAdd_OnClick(object sender, RoutedEventArgs e)
        {
            if(_editing == null)
            {
                var source = new Settings.ProgramSource
                {
                    Location = Directory.Text,
                };
                _settings.ProgramSources.Add(source);
            }
            else
            {
                _editing.Location = Directory.Text;
            }

            DialogResult = true;
            Close();
        }