コード例 #1
0
 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");
 }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: Clock.cs プロジェクト: stimpy77/ancient-legacy
 public Clock(AlarmSettings settings) : this()
 {
     this.Settings = settings;
 }