Exemplo n.º 1
0
 private void AddButtonClick(object sender, EventArgs e)
 {
     var form = new DurationForm(24 * 60 - GetTotalDuration());
     if (form.ShowDialog(this) == DialogResult.Cancel)
         return;
     durationsListBox.Items.Add(String.Format("{0}:{1:D2}", form.Duaration / 60, form.Duaration % 60));
     UpdateDurations();
 }
Exemplo n.º 2
0
        private void AddButtonClick(object sender, EventArgs e)
        {
            var form = new DurationForm(24 * 60 - GetTotalDuration());

            if (form.ShowDialog(this) == DialogResult.Cancel)
            {
                return;
            }
            durationsListBox.Items.Add(String.Format("{0}:{1:D2}", form.Duaration / 60, form.Duaration % 60));
            UpdateDurations();
        }
Exemplo n.º 3
0
        private void ChangeButtonClick(object sender, EventArgs e)
        {
            var index = durationsListBox.SelectedIndex;

            if (index < 0)
            {
                return;
            }
            var duration = GetDuration(index);
            var form     = new DurationForm(24 * 60 - GetTotalDuration() + duration, duration);

            if (form.ShowDialog(this) == DialogResult.Cancel)
            {
                return;
            }
            durationsListBox.Items[index] = String.Format("{0}:{1:D2}", form.Duaration / 60, form.Duaration % 60);
            UpdateDurations();
        }
Exemplo n.º 4
0
 private void ChangeButtonClick(object sender, EventArgs e)
 {
     var index = durationsListBox.SelectedIndex;
     if (index < 0)
         return;
     var duration = GetDuration(index);
     var form = new DurationForm(24 * 60 - GetTotalDuration() + duration, duration);
     if (form.ShowDialog(this) == DialogResult.Cancel)
         return;
     durationsListBox.Items[index] = String.Format("{0}:{1:D2}", form.Duaration / 60, form.Duaration % 60);
     UpdateDurations();
 }