Exemplo n.º 1
0
        private void buttonPathNew_Click(object sender, EventArgs e)
        {
            AddPathForm  addPathForm = new AddPathForm();
            DialogResult result      = addPathForm.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                Location newLocation = new Location {
                    Name = addPathForm.PathName, Path = addPathForm.PathFolder
                };
                _locations.Add(newLocation);
                listBoxPaths.SelectedIndex = listBoxPaths.Items.Add(newLocation);
            }
            UpdateSingleDestinationCombo();
        }
Exemplo n.º 2
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            Location currentLocation = (Location)listBoxPaths.SelectedItem;

            if (currentLocation != null)
            {
                var editPathForm = new AddPathForm {
                    PathName = currentLocation.Name, PathFolder = currentLocation.Path
                };
                DialogResult result = editPathForm.ShowDialog(this);
                if (result == DialogResult.OK)
                {
                    currentLocation.Name = editPathForm.PathName;
                    currentLocation.Path = editPathForm.PathFolder;
                }
            }
        }
Exemplo n.º 3
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            Location currentLocation =  (Location) listBoxPaths.SelectedItem;
            if (currentLocation != null)
            {

                var editPathForm = new AddPathForm {PathName = currentLocation.Name, PathFolder = currentLocation.Path};
                DialogResult result = editPathForm.ShowDialog(this);
                if (result == DialogResult.OK)
                {
                    currentLocation.Name = editPathForm.PathName;
                    currentLocation.Path = editPathForm.PathFolder;
                }
            }
        }
Exemplo n.º 4
0
 private void buttonPathNew_Click(object sender, EventArgs e)
 {
     AddPathForm addPathForm = new AddPathForm();
     DialogResult result = addPathForm.ShowDialog(this);
     if ( result == DialogResult.OK)
     {
         Location newLocation = new Location {Name = addPathForm.PathName, Path = addPathForm.PathFolder};
         _locations.Add(newLocation);
         listBoxPaths.SelectedIndex =  listBoxPaths.Items.Add(newLocation);                
     }
     UpdateSingleDestinationCombo();
 }