Esempio n. 1
0
        //user config read and save
        private void initUserSetting()
        {
            userRepolicy.setRepolicy(ApplicationSettings.GetSetting <string>(SettingKeys.REPORT_POLICY,
                                                                             userRepolicy.getRepolicy()));

            userRepolicy.setAutoLocation(ApplicationSettings.GetSetting <string>(SettingKeys.AUTO_LOCATION,
                                                                                 userRepolicy.getAutoLocation()));

            userRepolicy.setSessionTime(ApplicationSettings.GetSetting <string>(SettingKeys.SESSION_TIME,
                                                                                userRepolicy.getSessionTime()));

            userRepolicy.setUpdateOnlyWifi(ApplicationSettings.GetSetting <string>(SettingKeys.UPDATE_ONLY_WIFI,
                                                                                   userRepolicy.getUpdateOnlyWifi()));
        }
Esempio n. 2
0
        //user config read and save
        private void initUserSetting()
        {
            if (!setting.Contains("UserIdentifier"))
            {
                setting.Add("UserIdentifier", "");
            }
            if (!setting.Contains("hasDateToSend"))
            {
                setting.Add("hasDateToSend", "0");
            }

            if (!setting.Contains("repolicy"))
            {
                setting.Add("repolicy", userRepolicy.getRepolicy());
            }
            else
            {
                userRepolicy.setRepolicy((string)setting["repolicy"]);
            }
            if (!setting.Contains("autolocation"))
            {
                setting.Add("autolocation", userRepolicy.getAutoLocation());
            }
            else
            {
                userRepolicy.setAutoLocation((string)setting["autolocation"]);
            }

            if (!setting.Contains("sessiontime"))
            {
                setting.Add("sessiontime", userRepolicy.getSessionTime());
            }
            else
            {
                userRepolicy.setSessionTime((string)setting["sessiontime"]);
            }

            if (!setting.Contains("updateonlywifi"))
            {
                setting.Add("updateonlywifi", userRepolicy.getUpdateOnlyWifi());
            }
            else
            {
                userRepolicy.setUpdateOnlyWifi((string)setting["updateonlywifi"]);
            }
            setting.Save();
        }