예제 #1
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     var counter = new Counter();
     var form = new AddEditCounterForm(counter, AddEditCounterForm.Action.Add);
     var result = form.ShowDialog(this);
     if (result == DialogResult.OK)
     {
         Settings.Instance.Counters.Add(counter);
     }
 }
예제 #2
0
 private void buttonEdit_Click(object sender, EventArgs e)
 {
     var counter = GetSelectedCounter();
     if (counter != null)
     {
         var form = new AddEditCounterForm(counter, AddEditCounterForm.Action.Edit);
         form.ShowDialog(this);
     }
     RefreshDatagrid();
 }