Esempio n. 1
0
        public void Load(Setting setting)
        {
            OpenNETCF.AppSettings.SettingsFile settingFile = this.GetSettingsFile();

            setting.DeviceToken = (string)this.LoadValue(settingFile, "General", "DeviceToken", "");

            setting.EnableRecordOnBatteryCharging = (bool)this.LoadValue(settingFile, "Record", "EnableRecordOnBatteryCharging", true);
            setting.EnableRecordOnPowerConnecting = (bool)this.LoadValue(settingFile, "Record", "EnableRecordOnPowerConnecting", true);
            setting.EnableLevelLog = (bool)this.LoadValue(settingFile, "Record", "EnableLevelLog", false);

            setting.RecordOnInterval = (bool)this.LoadValue(settingFile, "RecordTiming", "RecordOnInterval", true);
            setting.RecordOnIntervalMinute = (uint)this.LoadValue(settingFile, "RecordTiming", "RecordOnIntervalMinute", 10U);
            setting.RecordOnChangeLevelState = (bool)this.LoadValue(settingFile, "RecordTiming", "RecordOnChangeLevelState", false);
            setting.RecordOnChangeChargeState = (bool)this.LoadValue(settingFile, "RecordTiming", "RecordOnChangeChargeState", false);

            setting.SendOnInterval = (bool)this.LoadValue(settingFile, "SendTiming", "SendOnInterval", false);
            setting.SendOnIntervalMinute = (uint)this.LoadValue(settingFile, "SendTiming", "SendOnIntervalMinute", 10U);
            setting.SendOnCount = (bool)this.LoadValue(settingFile, "SendTiming", "SendOnCount", true);
            setting.SendOnCountRecord = (uint)this.LoadValue(settingFile, "SendTiming", "SendOnCountRecord", 1U);
            setting.SendOnChangeLevelState = (bool)this.LoadValue(settingFile, "SendTiming", "SendOnChangeLevelState", false);
            setting.SendOnChangeChargeState = (bool)this.LoadValue(settingFile, "SendTiming", "SendOnChangeChargeState", false);
        }
Esempio n. 2
0
        public void Save(Setting setting)
        {
            OpenNETCF.AppSettings.SettingsFile settingFile = this.GetSettingsFile();

            this.SaveValue(settingFile, "General", "DeviceToken", setting.DeviceToken);

            this.SaveValue(settingFile, "Record", "EnableRecordOnBatteryCharging", setting.EnableRecordOnBatteryCharging);
            this.SaveValue(settingFile, "Record", "EnableRecordOnPowerConnecting", setting.EnableRecordOnPowerConnecting);
            this.SaveValue(settingFile, "Record", "EnableLevelLog", setting.EnableLevelLog);

            this.SaveValue(settingFile, "RecordTiming", "RecordOnInterval", setting.RecordOnInterval);
            this.SaveValue(settingFile, "RecordTiming", "RecordOnIntervalMinute", setting.RecordOnIntervalMinute);
            this.SaveValue(settingFile, "RecordTiming", "RecordOnChangeLevelState", setting.RecordOnChangeLevelState);
            this.SaveValue(settingFile, "RecordTiming", "RecordOnChangeChargeState", setting.RecordOnChangeChargeState);

            this.SaveValue(settingFile, "SendTiming", "SendOnInterval", setting.SendOnInterval);
            this.SaveValue(settingFile, "SendTiming", "SendOnIntervalMinute", setting.SendOnIntervalMinute);
            this.SaveValue(settingFile, "SendTiming", "SendOnCount", setting.SendOnCount);
            this.SaveValue(settingFile, "SendTiming", "SendOnCountRecord", setting.SendOnCountRecord);
            this.SaveValue(settingFile, "SendTiming", "SendOnChangeLevelState", setting.SendOnChangeLevelState);
            this.SaveValue(settingFile, "SendTiming", "SendOnChangeChargeState", setting.SendOnChangeChargeState);

            settingFile.Save();
        }
Esempio n. 3
0
        private void SetupSetting()
        {
            this.setting = new Setting();

            SettingManager settingManager = new SettingManager();
            settingManager.Load(this.setting);
        }