public override async void LoadViewData () { ShowBusyBox(); try { var rv = await Task.Run(() => mFuwuqiService.GetFuwuqis()); foreach (var item in rv) { var fuwuqu = new UIFuwuqi() { ID = item.ID, IsEnableNow = false , Url = item.Url, IsOpenning = item.IsOpenning }; Servers.Add(fuwuqu); } CheckFuwuqis(); } catch(Exception e) { e.Show(); } CloseBusyBox(); }
private async Task CheckFuwuqi (UIFuwuqi server) { try { //var rv = await mFuwuqiService.FuwuqiCheck(server.Url); //server.IsEnableNow = rv.IsEnable; } catch (Exception) { server.IsEnableNow = false; } }
private async void AddServer () { ShowBusyBox(); try { var rv = await Task.Run(()=>mFuwuqiService.AddFuwuqi(WorkForm.Url, WorkForm.IsOpenning)); var fuwuqu = new UIFuwuqi() { IsEnableNow = false, IsOpenning = WorkForm.IsOpenning, Url = WorkForm.Url, ID = rv }; Servers.Add(fuwuqu); CheckFuwuqi(fuwuqu); } catch (Exception e) { e.Show(); } CloseBusyBox();}