internal void SetSettings(AlarmSettings settings) { this.AlarmTime.Time = settings.AlarmTime; this.SoundFilePicker.Text = settings.SoundFile; this.AlarmType.SelectedItem = settings.AlarmType.ToString() .Replace("SoundFile", "Sound File") .Replace("SilentVisual", "Silent Visual"); }
internal AlarmSettings GetSettings() { var ret = new AlarmSettings(); ret.AlarmTime = DateTime.Parse(DateTime.Now.ToShortDateString() + " " + AlarmTime.Text); if (ret.AlarmTime < DateTime.Now) { ret.AlarmTime = ret.AlarmTime.AddDays(1); } ret.AlarmType = (AlarmSettings.AlarmTypeEnum)Enum.Parse(typeof(AlarmSettings.AlarmTypeEnum), AlarmType.SelectedItem.ToString().Replace(" ", "")); ret.SoundFile = SoundFilePicker.Text; return(ret); }
public Clock(AlarmSettings settings) : this() { this.Settings = settings; }