示例#1
0
        private void setSaveSettings()
        {
            string saveValue = ClassFile.SearchSaveValue("Alarm song");

            if (saveValue != null)
            {
                objectClassSettings.PathFile = saveValue;
                string alarm = saveValue.GetFileNameWithoutPath('\\');
                objectClassSettings.AlarmSong = alarm.Substring(0, alarm.IndexOf('.'));
                objectClassSettings.SetMediaPlayer(saveValue);
            }

            saveValue = ClassFile.SearchSaveValue("Snooze");
            if (saveValue != null)
            {
                objectClassSettings.Snooze = saveValue;
                SnoozeCheck.IsChecked      = true;
                setValueSnooze(setSnooze, saveValue);
            }

            saveValue = ClassFile.SearchSaveValue("Alarm clock");
            if (saveValue != null)
            {
                objectClassSettings.UpdateListAlarmClockVersion(saveValue);
                string lefV = null, rightV = null;
                ClassParserSettings.SetLeftValueAndRightValue(objectClassSettings.GetListAlarmClock[0].ValueAlarmClock, ':', leftValue: ref lefV, rightValue: ref rightV);
                objectClassSettings.AlarmClock = lefV + ":" + rightV;
                setValueHoursMinutes(setHours, lefV);
                setValueHoursMinutes(setMinutes, rightV);
                previousValueAlarmClock = objectClassSettings.AlarmClock;
            }
            sliderVolume.Value = 25d;
        }
示例#2
0
        public static string SearchSaveValue(string key)
        {
            string elementList = listData.Find((obj) => obj.Contains(key));

            if (elementList == null)
            {
                return(null);
            }
            string valueData = null;

            ClassParserSettings.SetLeftValueAndRightValue(elementList, '-', leftValue: ref key, rightValue: ref valueData);
            return(valueData);
        }