| | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | |
| | | bodyView.AddChidren(VerticalScrolViewMiddle); |
| | | |
| | | var waitPage = new Loading(); |
| | | waitPage.Start("Please wait..."); |
| | | bodyView.AddChidren(waitPage); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | |
| | | System.Threading.Tasks.Task.Run(() => { |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | var dataList = new List<GlobalRegionListRes>(); |
| | |
| | | var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_GlobalRegionList, requestJson, HttpUtil.GlobalRequestHttpsHost); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GlobalRegionListRes>>(revertObj.Data.ToString()); |
| | | if (responseDataObj != null) |
| | | { |
| | |
| | | } |
| | | catch |
| | | { |
| | | |
| | | |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Hide(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | |
| | | }; |
| | | VerticalScrolViewMiddle.AddChidren(rowView); |
| | | |
| | | var urlBtn = new Button() { |
| | | var urlBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Height = rowView.Height, |
| | | Width = Application.GetRealWidth(200), |
| | |
| | | //rowView.AddChidren(lineView); |
| | | //lineView.Y = rowView.Height - lineView.Height; |
| | | |
| | | EventHandler<MouseEventArgs> eHandler = (sender, e) => { |
| | | UserInfo.Current.RequestHttpsHost = mGlobalRegion.regionUrl; |
| | | UserInfo.Current.GlobalRegion = mGlobalRegion; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | EventHandler<MouseEventArgs> eHandler = (sender, e) => |
| | | { |
| | | OnAppConfig.Instance.RequestHttpsHost = mGlobalRegion.regionUrl; |
| | | OnAppConfig.Instance.GlobalRegion = mGlobalRegion; |
| | | OnAppConfig.Instance.SaveConfig(); |
| | | //关闭页面 |
| | | this.Close(); |
| | | selectAction?.Invoke(); |
| | |
| | | |
| | | urlBtn.Text = mGlobalRegion.regionName; |
| | | |
| | | if (mGlobalRegion.regionUrl == UserInfo.Current.RequestHttpsHost) |
| | | if (mGlobalRegion.regionUrl == OnAppConfig.Instance.RequestHttpsHost) |
| | | { |
| | | urlBtn.TextColor = CSS_Color.MainColor; |
| | | } |