Beispiel #1
0
        string GetAttributeDisplayName(TimerStateEnum tse)
        {
            var type       = typeof(TimerStateEnum);
            var memInfo    = type.GetMember(tse.ToString());
            var attributes = memInfo[0].GetCustomAttributes(typeof(DisplayAttribute), false);

            return(((DisplayAttribute)attributes.First()).Name);
        }
Beispiel #2
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     time = time.AddSeconds(-1);
     UpdateTimeLabel();
     if (time.Minute == 0 && time.Second == 0)
     {
         TimerState = TimerStateEnum.Alarm;
     }
 }
Beispiel #3
0
 public Form1()
 {
     InitializeComponent();
     cycle = CycleEnum.Break;
     ToggleCycle();
     TimerState = TimerStateEnum.Stop;
     alarmSound = new SoundPlayer(_25work.Properties.Resources.alarm);
     alarmSound.Load();
     UpdateWorkTimeLabel();
 }
Beispiel #4
0
        private void cancelButton_Click(object sender, EventArgs e)
        {
            switch (((Button)sender).Text)
            {
            case "Stop":
                TimerState = TimerStateEnum.Stop;
                break;

            case "Toggle Cycle":
                ToggleCycle();
                break;
            }
        }
Beispiel #5
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            TimerStateEnum timerState = (TimerStateEnum)value;

            if (timerState == TimerStateEnum.Running)
            {
                return("॥");
            }
            else if (timerState == TimerStateEnum.Stopped)
            {
                return("►");
            }
            else
            {
                return("►");
            }
        }
Beispiel #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            switch (((Button)sender).Text)
            {
            case "Start":
                TimerState = TimerStateEnum.Start;
                break;

            case "Pause":
                TimerState = TimerStateEnum.Pause;
                break;

            case "Continue":
                TimerState = TimerStateEnum.Continue;
                break;

            case "Dismiss":
                TimerState = TimerStateEnum.Dismiss;
                TimerState = TimerStateEnum.Start;
                break;
            }
        }