public static async Task AttemptLogin(string Email, string Pass, Action <bool, int> Complete) { // Try to login again if no response for (int i = 0; i < 2; i++) { var Result = await NetworkingLayer.Authenticate(Email, Pass); if (Result != "") { checkLoginResult(Result, Complete); return; } } // if failed twice , error Complete.Invoke(false, 2); }
// Fetches Blogs From Server public static async Task RefreshBlogs(Action <bool, int> Complete) { // Try twice for (int i = 0; i < 2; i++) { var data = await NetworkingLayer.BlogClient(); if (data != "") { if (DataLayer.ParseBlogs(data)) { Complete.Invoke(true, 0); return; } } } Complete.Invoke(false, 2); }
public static async Task RefreshPosts(Action <bool, int> Complete) { for (int i = 0; i < 2; i++) { var data = await NetworkingLayer.PostClient((Application.Current as App).EntityID); if (data != "") { if (DataLayer.ParseItinUpdate(data)) { Complete.Invoke(true, 0); return; } } } Complete.Invoke(false, 2); return; }