//all data private string allData2jsonstr() { AllInfo allinfo = new AllInfo(); allinfo.appkey = UmsManager.appkey; string ret = ""; IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings; if (settings.Contains("clientdata")) { List <ClientData> list_client_data = (List <ClientData>)settings["clientdata"]; allinfo.clientData = list_client_data; } if (settings.Contains("tagdata")) { List <Tag> list_tag_data = (List <Tag>)settings["tagdata"]; allinfo.tagListInfo = list_tag_data; } if (settings.Contains("eventdata")) { List <Event> list_event_data = (List <Event>)settings["eventdata"]; allinfo.eventInfo = list_event_data; } try { string err_str = CrashListener.CheckForPreviousException(); ErrorInfo error = UmsJson.Deserialize <ErrorInfo>(err_str); if (error != null) { List <ErrorInfo> err_list = new List <ErrorInfo>(); err_list.Add(error); allinfo.errorInfo = err_list; } } catch (Exception e) { DebugTool.Log(e.Message); } if (settings.Contains("pageinfo")) { List <PageInfo> list_pageinfo_data = (List <PageInfo>)settings["pageinfo"]; allinfo.activityInfo = list_pageinfo_data; } ret = UmsJson.Serialize(allinfo); return(ret); }
//check is exist crash log public static bool isExistCrashLog() { try { string err_str = CrashListener.CheckForPreviousException(); ErrorInfo o = UmsJson.Deserialize <ErrorInfo>(err_str); if (o != null) { return(true); } } catch (Exception e) { DebugTool.Log(e.Message); return(false); } return(false); }
//all data private async Task <string> allData2jsonstr() { AllInfo allinfo = new AllInfo(); allinfo.appkey = UmsManager.appkey; string ret = ""; Windows.Storage.ApplicationDataContainer settings = Windows.Storage.ApplicationData.Current.LocalSettings; allinfo.clientData = await ApplicationSettings.GetSettingFromXmlFileAsync <List <ClientData> >(SettingKeys.CLIENT_DATA, null); allinfo.eventInfo = await ApplicationSettings.GetSettingFromXmlFileAsync <List <Event> >(SettingKeys.EVENT_DATA, null); allinfo.activityInfo = await ApplicationSettings.GetSettingFromXmlFileAsync <List <PageInfo> >(SettingKeys.PAGE_INFO, null); //patch: we nolonger use in storage settings anymore, just remove it for old versions ApplicationSettings.RemoveSetting(SettingKeys.CLIENT_DATA); ApplicationSettings.RemoveSetting(SettingKeys.EVENT_DATA); ApplicationSettings.RemoveSetting(SettingKeys.PAGE_INFO); try { string err_str = CrashListener.CheckForPreviousException(); ErrorInfo error = UmsJson.Deserialize <ErrorInfo>(err_str); if (error != null) { List <ErrorInfo> err_list = new List <ErrorInfo>(); err_list.Add(error); allinfo.errorInfo = err_list; } } catch (Exception e) { DebugTool.Log(e.Message); } ret = UmsJson.Serialize(allinfo); return(ret); }