void AlarmOff_Click(object sender, EventArgs e) { AlarmMngr.StopAlarm(this); AlarmMngr.SnoozeMode = false; ActionMngr.StopPlayer(); setNewAlarm(); Finish(); return; }
private void setSnooze() { bool[] days = new bool[7]; for (int i = 0; i < 7; i++) { days [i] = true; } ActionMngr.StopPlayer(); AlarmMngr.StartAlarm(new Alarm(DateTime.Now.AddMinutes(alarm.SnoozeTime).TimeOfDay, true) { Days = days, ActionID = alarm.ActionID }, this); }
void ActionRadioButton_Click(object sender, EventArgs e) { int position = (int)((RadioButton)sender).GetTag(Resource.Id.action_radio_button); if (oldActionID != position) { Console.WriteLine("oldActionID != position" + oldActionID + "," + position); selected.Checked = false; oldActionID = position; selected = (RadioButton)sender; } ActionMngr.StartPlayer(context, ActionMngr.Actions[SelectedActionID], 1, 1); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); RequestWindowFeature(WindowFeatures.NoTitle); SetContentView(Resource.Layout.AlarmGoingOff); alarmOff = FindViewById <Button>(Resource.Id.alarmgoingoff_off); alarmSnooze = FindViewById <Button> (Resource.Id.alarmgoingoff_snooze); alarmTime = FindViewById <TextView> (Resource.Id.alarmgoingoff_time); alarmOff.Click += AlarmOff_Click; alarmSnooze.Click += AlarmSnooze_Click; alarm = (Alarm)this.Intent.GetParcelableExtra("startAlarm"); string time = string.Format("{0}.{1}", alarm.Time.Hours.ToString(), alarm.Time.Minutes.ToString().PadLeft(2, '0')); alarmTime.Text = time; AlarmAction action = ActionMngr.Actions[alarm.ActionID]; ActionMngr.StartPlayer(this, action, alarm.Duration, alarm.Volume); }
void Cancel_Click(object sender, EventArgs e) { ActionMngr.StopPlayer(); this.Dismiss(); }
void Save_Click(object sender, EventArgs e) { actionSetEventHandler.Invoke(this, new ActionSetEventArgs(actionListViewAdapter.SelectedActionID)); ActionMngr.StopPlayer(); this.Dismiss(); }