public bool GetConcreteUser(ref GetJSON output) { if (!FetcherUsers.ContainsKey(output.DestPage)) { return(false); } else { return(FetcherUsers.TryGetValue(output.DestPage, out output)); } }
protected Dictionary <Pages, GetJSON> FetcherUsers;//每一页都有固定位置 public void RegisterFetcherUser(GetJSON User, bool AddAnyWay = false) { if (!AddAnyWay) { foreach (var m in FetcherUsers) { if (m.Value == User || m.Key == User.DestPage) { break; } } } Debug.WriteLine("已加入一个FetcherUser Type:" + User.DestPage.ToString()); User.ChangeFetcher(Fetcher_Now); FetcherUsers[User.DestPage] = User; }
public async Task <bool> RunConcreteUser(GetJSON which, bool set_as_User = false) { if (which == null) { return(false); } else { Debug.WriteLine("开始执行对于" + which.DestPage.ToString() + "的任务"); if (set_as_User) { SetConcreteUser(which); } bool Hresult = await which.RunSession(); ReturnData HArgs = which.GetRecentInfo(); Debug.WriteLine("|" + which.DestPage.ToString() + "刷新显示内容"); RunReturnDataEvent(which.DestPage, Hresult, HArgs); Debug.WriteLine("|" + which.DestPage.ToString() + "结束"); return(Hresult); } }
public bool SetConcreteUser(GetJSON input) { input.ChangeFetcher(Fetcher_Now); FetcherUsers[input.DestPage] = input; return(true); }