public void Update() { _currentEntry.Subject = this.Subject; _currentEntry.RepeatType = this.RepeatType.ToString(); _currentEntry.AlarmTime = this.AlarmTime; _currentEntry.ExpirationTime = this.ExpirationTime; _currentEntry.Vibrate = this.Vibrate; _currentEntry.RingTone = this.RingTone.ToString(); _currentEntry.ExtraInfo = this.AlarmTime.ToShortTimeString(); EntryDataContext.Instance.UpdateEntry(_currentEntry); AlarmUtilities.UpdateAlarm(_currentEntry); }
public void Update() { _currentEntry.Subject = Subject; _currentEntry.AlarmOn = AlarmOn; _currentEntry.RepeatType = RepeatType.ToString(); _currentEntry.AlarmTime = AlarmTime; _currentEntry.ExpirationTime = ExpirationTime; _currentEntry.Vibrate = Vibrate; _currentEntry.RingTone = RingTone.ToString(); _currentEntry.ExtraInfo = AlarmOn ? AlarmTime.ToShortTimeString() : AppResources.NoAlarmText; EntryDataContext.Instance.UpdateEntry(_currentEntry); if (_currentEntry.AlarmOn) { AlarmUtilities.UpdateAlarm(_currentEntry); } }
public void Store(DateTime startTime) { Entry entry = new Entry { EntryId = System.Guid.NewGuid().ToString(), EntryType = EntryType.Alarm.ToString(), CreateTime = DateTime.Now, StartTime = startTime.Date, ExpirationTime = this.ExpirationTime, Subject = this.Subject, RepeatType = this.RepeatType.ToString(), ExtraInfo = this.AlarmTime.ToShortTimeString(), AlarmOn = true, AlarmTime = this.AlarmTime, RingTone = this.RingTone.ToString(), Vibrate = this.Vibrate }; EntryDataContext.Instance.AddEntry(entry); AlarmUtilities.AddAlarm(entry); }
public void Remove() { EntryDataContext.Instance.RemoveEntry(_currentEntry.EntryId); AlarmUtilities.RemoveAlarm(_currentEntry.EntryId); }