Ejemplo n.º 1
0
        public static void call_back_process_updatedata(string msg, object obj)
        {
            UpdateRet o = new UpdateRet();

            try
            {
                o = UmsJson.Deserialize <UpdateRet>(msg);
            }
            catch (Exception e)
            {
                DebugTool.Log(e);
            }
            if (o == null)
            {
                return;
            }


            if (o.flag.Equals("1"))
            {
                showUpdateDialog(o.time, o.version, o.description, o.fileurl);
            }

            DebugTool.Log("call back of check version------" + msg);
        }
Ejemplo n.º 2
0
        public static void call_back_process_configdata(string msg, object obj)
        {
            ConfigRet o = new ConfigRet();

            try
            {
                o = UmsJson.Deserialize <ConfigRet>(msg);
            }
            catch (Exception e)
            {
                DebugTool.Log(e);
            }
            if (o == null)
            {
                return;
            }
            if (o.flag.Equals("1"))
            {
                Windows.Storage.ApplicationDataContainer settings = Windows.Storage.ApplicationData.Current.LocalSettings;
                ApplicationSettings.SetSetting <string>(SettingKeys.UPDATE_ONLY_WIFI, o.updateonlywifi);
                ApplicationSettings.SetSetting <string>(SettingKeys.REPORT_POLICY, o.reportpolicy);
                ApplicationSettings.SetSetting <string>(SettingKeys.AUTO_LOCATION, o.autogetlocation);
            }

            DebugTool.Log("call back of onlineconfig data------" + msg);
        }
Ejemplo n.º 3
0
        public static void call_back_process_configdata(string msg, object obj)
        {
            ConfigRet o = new ConfigRet();

            try
            {
                o = UmsJson.Deserialize <ConfigRet>(msg);
            }
            catch (Exception e)
            {
                DebugTool.Log(e);
            }
            if (o == null)
            {
                return;
            }
            if (o.flag.Equals("1"))
            {
                IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
                if (settings.Contains("updateonlywifi"))
                {
                    settings["updateonlywifi"] = o.updateonlywifi;
                }
                else
                {
                    settings.Add("updateonlywifi", o.updateonlywifi);
                }

                if (settings.Contains("repolicy"))
                {
                    settings["repolicy"] = o.reportpolicy;
                }
                else
                {
                    settings.Add("repolicy", o.reportpolicy);
                }

                if (settings.Contains("autolocation"))
                {
                    settings["autolocation"] = o.autogetlocation;
                }
                else
                {
                    settings.Add("autolocation", o.autogetlocation);
                }
                settings.Save();
            }

            DebugTool.Log("call back of onlineconfig data------" + msg);
        }
Ejemplo n.º 4
0
        //check msg
        public static CommonRet getJsonObj(string msg)
        {
            CommonRet o = new CommonRet();

            try
            {
                o = UmsJson.Deserialize <CommonRet>(msg);
            }
            catch (Exception e)
            {
                DebugTool.Log(e.Message);
            }
            if (o == null)
            {
                DebugTool.Log("invaild return");
            }
            return(o);
        }