Beispiel #1
0
 public void AddToTriggerTimes(DailyTriggerTime dtt)
 {
     if (!triggerTimes.Contains(dtt))
     {
         triggerTimes.Add(dtt);
         TriggerTimes_LB.Items.Add(dtt);
     }
 }
Beispiel #2
0
        public override bool Equals(object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return(false);
            }

            // If parameter cannot be cast return false.
            DailyTriggerTime other = obj as DailyTriggerTime;

            if ((System.Object)other == null)
            {
                return(false);
            }

            // Return true if the fields match:
            return((this.hour == other.hour) && (this.minute == other.minute));
        }
Beispiel #3
0
 public TimePickerWindow(MainWindow prevWindow)
 {
     this.prevWindow = prevWindow;
     dtt             = new DailyTriggerTime();
     InitializeComponent();
     // Add the options to the dropdowns
     for (int i = 1; i < 13; i++)
     {
         Hour_Dropdown.Items.Add(i);
     }
     for (int i = 0; i <= 60; i += 15)
     {
         Minute_Dropdown.Items.Add(i);
     }
     AMPM_Dropdown.Items.Add("AM");
     AMPM_Dropdown.Items.Add("PM");
     // set default values (7:00 pm)
     Hour_Dropdown.SelectedIndex   = 6;
     Minute_Dropdown.SelectedIndex = 0;
     AMPM_Dropdown.SelectedIndex   = 1;
     this.dtt.hour   = 7 + 12; //24 hour time
     this.dtt.minute = 0;
 }