| | |
| | | { |
| | | public static class MainPage |
| | | { |
| | | /// <summary> |
| | | /// BaseView |
| | | /// </summary> |
| | | public static FrameLayout BaseView { get; internal set; } |
| | | /// <summary> |
| | | /// BasePageView |
| | | /// </summary> |
| | | public static PageLayout BasePageView { get; set; } |
| | | /// <summary> |
| | | /// DisplayCompleted |
| | | /// </summary> |
| | | |
| | | public static bool DisplayCompleted = false; |
| | | |
| | | //public static UserInfo LoginUser; |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.0.0924"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | | //public static string ClientType = APIClientType.HDL_ON_PRO.ToString(); |
| | | public static UserInfo LoginUser; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public static string VersionString = "1.0.0924"; |
| | | |
| | | public static Entity.CityInfo cityInfo = new Entity.CityInfo(); |
| | | /// <summary> |
| | | /// 天气刷新action |
| | |
| | | /// </summary> |
| | | public static bool IsRemote = false; |
| | | |
| | | ///// <summary> |
| | | ///// 公司代码 |
| | | ///// 预留第三方定制标记 |
| | | ///// 0:HDL |
| | | ///// </summary> |
| | | //public static int Company = 0; |
| | | /// <summary> |
| | | /// 公司代码 |
| | | /// 预留第三方定制标记 |
| | | /// 0:HDL |
| | | /// </summary> |
| | | public static int Company = 0; |
| | | |
| | | /// <summary> |
| | | /// 是否全面屏手机 |
| | |
| | | BaseView = Application.MainPage; |
| | | Application.MainPage.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | |
| | | //LoginUser = Newtonsoft.Json.JsonConvert.DeserializeObject<UserInfo>(System.Text.Encoding.UTF8.GetString(FileUtils.ReadFile("UserInfo_File"))); |
| | | //BusSocket.Start(); |
| | | //CommonPage.InitReceiveEvent(); |
| | | |
| | | LoginUser = Newtonsoft.Json.JsonConvert.DeserializeObject<UserInfo>(System.Text.Encoding.UTF8.GetString(FileUtils.ReadFile("UserInfo_File"))); |
| | | //判断需不需要登录,有没有登录,或者登录是否过期, |
| | | if (UserInfo.Current == null || !UserInfo.Current.IsLogin) |
| | | if (LoginUser == null || !LoginUser.IsLogin) |
| | | { |
| | | GoLoginPage(UserInfo.Current); |
| | | GoLoginPage(LoginUser); |
| | | } |
| | | else |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | pm.RefreshToken();//刷新Token |
| | | pm.GetHomePager();//刷新住宅信息 |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | //UdpSocket._BusSocket.Start(); |
| | | //if (Entity.DB_ResidenceData.residenceData.GatewayType == 1) |
| | | //{ |
| | | // BusSocket.Start(); |
| | | // CommonPage.InitReceiveEvent(); |
| | | // Control.ReadGatewayIPAddress(); |
| | | //} |
| | | //else |
| | | //{ |
| | | // BusSocket.Start(); |
| | | // CommonPage.InitReceiveEvent(); |
| | | //} |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | var pm =new DAL.Server.HttpServerRequest(); |
| | | pm.GetUserInfo();//刷新个人信息 |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | pm.GetHomePager();//刷新住宅信息 |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | GoUserPage(); |
| | | //启动密码验证 |
| | | new AppUnlockPage().LoadPage(); |
| | | //读取音乐信息 |
| | | UI.Music.A31MusicModel.ReadMusicStates(); |
| | | //搜索网关 |
| | | |
| | | #if DEBUG |
| | | //Entity.DB_ResidenceData.residenceData.residenceGatewayMAC = "4E47323347591243"; |
| | | //Entity.DB_ResidenceData.residenceData.GatewayType = 0; |
| | | Entity.DB_ResidenceData.residenceData.residenceGatewayMAC = "123456789AAAAAAA"; |
| | | Entity.DB_ResidenceData.residenceData.GatewayType = 1; |
| | | #endif |
| | | DriverLayer.Control.Ins.SearchLoaclGateway(); |
| | | //new HDL_ON.DAL.Net.TcpListener().OpenServer(8586); |
| | | #endif |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | /// <summary> |
| | | /// 进入登录界面 |
| | | /// </summary> |
| | | public static void GoLoginPage(UserInfo userInfo = null) |
| | | public static void GoLoginPage(UserInfo userInfo =null) |
| | | { |
| | | BaseView.RemoveAll(); |
| | | BaseView.BackgroundColor = CSS_Color.BackgroundColor; |
| | |
| | | Console.WriteLine(msg); |
| | | #endif |
| | | } |
| | | |
| | | |
| | | } |
| | | } |