public async void UpdateFAQ_StaticData() { try { sc = new UtilityClasses.ServerCall(); // string content = await sc.GetjsonStream_StaticFAQ(Network.URL_FAQ_DATA);// Get Updated from server string content = await sc.GetjsonStream(UtilityClasses.Network.URL_FAQ_DATA);// Get Updated from server if (UtilityClasses.MKValidations.isValidJson(content)) { //if (File.Exists("FAQ_mapping.txt")) //{ // File.Delete("FAQ_mapping.txt");// Delete existing file //} //TextWriter file = new StreamWriter("FAQ_mapping.txt", true);// Create New //file.WriteLine(content);//Replace Data //file.Close(); var FileName = "StaticFiles/FAQ_mapping.txt"; var Folder = Windows.Storage.ApplicationData.Current.LocalFolder; var Fileoption = Windows.Storage.CreationCollisionOption.ReplaceExisting; var File = await Folder.CreateFileAsync(FileName, Fileoption); await Windows.Storage.FileIO.WriteTextAsync(File, content); FAQ_data =await ParseFAQMapping(); // get file data in local variable } } catch (Exception ex) { //List<Parameter> Params = new List<Parameter>(); //Params.Add(AccountFunctions.createParameter("Location", "ViewModel FAQ")); //Params.Add(AccountFunctions.createParameter("Method", "Update static Faq question, Error:" + ex.Message)); //FlurryWP8SDK.Api.LogEvent("FAQ Exception", Params); } }
public async void GetFaqData() { if (FAQ_data == null) FAQ_data = await ParseFAQMapping(); // else do nothing }