| | |
| | | UserView.HomePage.Instance.RemoveViewByTag("Logic");//移除所有标记Logic界面 |
| | | if (LogicView.IfString._Logic == if_logic) |
| | | { |
| | | |
| | | //查询-当前逻辑-是否添加地理位置作为条件 |
| | | var exist = Common.Logic.CurrentLogic.Conditions.Find((obj) => obj["Type"] == "7"); |
| | | if (exist==null) |
| | | { |
| | | bool if_type = false; |
| | | //查询-逻辑列表-是否添加过地理位置作为条件 |
| | | for (int a = 0; a < Common.Logic.LogicList.Count; a++) |
| | | { |
| | | var logic = Common.Logic.LogicList[a]; |
| | | var exist_logic = logic.Conditions.Find((obj) => obj["Type"] == "7"); |
| | | if (exist_logic != null) |
| | | { |
| | | //是否存在地理位置条件 |
| | | if_type = true; |
| | | //退出for循环 |
| | | break; |
| | | } |
| | | } |
| | | if (if_type) |
| | | { |
| | | //查询之前状态是否已经开启GPS服务(以本地存储状态为主 0:没开启; 1:开启) |
| | | if (Send.If_Exist == "0") |
| | | { |
| | | //开启GPS服务 |
| | | Application.StartGPSLocationService(); |
| | | //保存GPS服务开启状态 |
| | | Send.SaveLocalFile(Config.Instance.HomeId + "_GPS_File", "1"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | //如果找不到地理位置作为条件的话,关闭GPS服务(减少耗电) |
| | | if (Send.If_Exist == "1") |
| | | { |
| | | //关闭GPS服务 |
| | | Application.StopGPSLocationService(); |
| | | //保存GPS服务关闭状态 |
| | | Send.SaveLocalFile(Config.Instance.HomeId + "_GPS_File", "0"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //查询之前状态是否已经开启GPS服务(以本地存储状态为主 0:没开启; 1:开启) |
| | | if (Send.If_Exist == "0") |
| | | { |
| | | //开启GPS服务 |
| | | Application.StartGPSLocationService(); |
| | | //保存GPS服务开启状态 |
| | | Send.SaveLocalFile(Config.Instance.HomeId + "_GPS_File", "1"); |
| | | } |
| | | } |
| | | //只刷新分类-自动化上下滑动view; |
| | | Phone.Category.CategoryMainForm.instance?.RefreshBodyView(); |
| | | // Category.Category.instance?.RefreshBodyView(); |
| | |
| | | /// 界面高度 |
| | | /// </summary> |
| | | public static int H = 1922; |
| | | |
| | | |
| | | |
| | | } |
| | | } |