Esempio n. 1
0
 private void ProviderAddButton_Click(object sender, EventArgs e)
 {
     ProviderAddDialog dialog = new ProviderAddDialog(IsFirst: true);
     if (dialog.ShowDialog() != DialogResult.OK) return;
     Data.Provider P = dialog.Provider;
     Data.ProviderCollection.AddProvider(P);
     LoadData();
 }
Esempio n. 2
0
 private void ProviderChangeButton_Click(object sender, EventArgs e)
 {
     if (ListProviders.SelectedItems.Count != 1) return;
     var item = ListProviders.SelectedItems[0];
     var index = ListProviders.SelectedIndices[0];
     var provider = item.Tag as Data.Provider;
     ProviderAddDialog dialog = new ProviderAddDialog(provider.Name, provider.TemplateName, false);
     if (dialog.ShowDialog() != DialogResult.OK) return;
     provider.Name = dialog.Name;
     LoadData();
     ListProviders.Items[index].Selected = true;
 }
Esempio n. 3
0
 private void ProviderCopyButton_Click(object sender, EventArgs e)
 {
     if (ListProviders.SelectedItems.Count != 1) return;
     ProviderAddDialog dialog = new ProviderAddDialog(IsFirst: true);
     if (dialog.ShowDialog() != DialogResult.OK) return;
     var item = ListProviders.SelectedItems[0];
     var index = ListProviders.SelectedIndices[0];
     var provider = item.Tag as Data.Provider;
     Data.Provider _p = provider.Clone(dialog.Provider.Name, dialog.Provider.TemplateName);
     Data.ProviderCollection.AddProvider(_p);
     LoadData();
 }