| | |
| | | } |
| | | public void Show() |
| | | { |
| | | |
| | | LogicView.TopView topView = new LogicView.TopView(); |
| | | this.AddChidren(topView.FLayoutView()); |
| | | topView.clickBackBtn.MouseUpEventHandler += (e, sen) => |
| | |
| | | //室外变化 |
| | | shiwaiView.btnClick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | //if (string.IsNullOrEmpty(Entity.DB_ResidenceData.Instance.CurrentRegion.homeAddress))//.longitude == 0 && Entity.DB_ResidenceData.Instance.CurrentRegion.latitude == 0) |
| | | //{ |
| | | // new PublicAssmebly().TipMsg(StringId.tip, StringId.GatewayLocationInformationIsNotConfigured); |
| | | // return; |
| | | //} |
| | | Weather weather = new Weather(); |
| | | //if (string.IsNullOrEmpty(Entity.DB_ResidenceData.Instance.CurrentRegion.homeAddress))//.longitude == 0 && Entity.DB_ResidenceData.Instance.CurrentRegion.latitude == 0) |
| | | //{ |
| | | // new PublicAssmebly().TipMsg(StringId.tip, StringId.GatewayLocationInformationIsNotConfigured); |
| | | // return; |
| | | //} |
| | | Weather weather = new Weather(); |
| | | MainPage.BasePageView.AddChidren(weather); |
| | | weather.Show(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | |
| | | string valueStr = "arrive"; |
| | | if (str == Language.StringByID(StringId.daoda)) |
| | | { |
| | | //到达某地 |
| | | valueStr = "arrive"; |
| | | //到达某地 |
| | | valueStr = "arrive"; |
| | | } |
| | | else |
| | | { |
| | | //离开 |
| | | valueStr = "leave"; |
| | | //离开 |
| | | valueStr = "leave"; |
| | | } |
| | | |
| | | #if __Android__ |
| | | //申请定位权限 |
| | | ((BaseActivity)Application.Activity).SetGPSLocationPermission((result1) => |
| | | { |
| | | if (result1 == false) { return; } |
| | | if (result1 == false) { return; } |
| | | |
| | | //申请允许程序写入外部存储,如SD卡上写文件 |
| | | ((BaseActivity)Application.Activity).SetPermission((result2) => |
| | | { |
| | | if (result2 == false) { return; } |
| | | if (result2 == false) { return; } |
| | | //读取电话状态权限 |
| | | ((BaseActivity)Application.Activity).SetPermission((result3) => |
| | | { |
| | | if (result3 == false) { return; } |
| | | if (result3 == false) { return; } |
| | | |
| | | //调用方法,跳转页面 |
| | | GDMapKit.Show((mLatitude, mLongitude, mRadius, name) => |
| | | { |
| | | //高德坐标转WGS84坐标(高德地图设置GPS) |
| | | double out_lng, out_lat; |
| | | LogicMethod.CurrLogicMethod.GCJ02_to_WGS84(mLongitude, mLatitude, out out_lng, out out_lat); |
| | | Input input = new Input(); |
| | | input.sid = LogicMethod.CurrLogicMethod.NewSid(); |
| | | input.condition_type = "8"; |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | LogicMethod.CurrLogicMethod.dictionary(dic, "key", "direction"); |
| | | LogicMethod.CurrLogicMethod.dictionary(dic, "comparator", "="); |
| | | LogicMethod.CurrLogicMethod.dictionary(dic, "data_type", "string"); |
| | | LogicMethod.CurrLogicMethod.dictionary(dic, "value", valueStr); |
| | | input.condition.Add(dic); |
| | | //纬度 |
| | | input.geo_fence.latitude = out_lat.ToString(); |
| | | //经度 |
| | | input.geo_fence.longitude = out_lng.ToString(); |
| | | //半径<单位米> |
| | | input.geo_fence.radius = mRadius.ToString(); |
| | | AddCondition(input); |
| | | LogicMethod.CurrLogicMethod.RemoveAllView(); |
| | | AddLogic addLogic = new AddLogic(); |
| | | MainPage.BasePageView.AddChidren(addLogic); |
| | | addLogic.Show(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | //调用方法,跳转页面 |
| | | GDMapKit.Show((mLatitude, mLongitude, mRadius, name) => |
| | | { |
| | | //高德坐标转WGS84坐标(高德地图设置GPS) |
| | | double out_lng, out_lat; |
| | | LogicMethod.CurrLogicMethod.GCJ02_to_WGS84(mLongitude, mLatitude, out out_lng, out out_lat); |
| | | Input input = new Input(); |
| | | input.sid = LogicMethod.CurrLogicMethod.NewSid(); |
| | | input.condition_type = "8"; |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | LogicMethod.CurrLogicMethod.dictionary(dic, "key", "direction"); |
| | | LogicMethod.CurrLogicMethod.dictionary(dic, "comparator", "="); |
| | | LogicMethod.CurrLogicMethod.dictionary(dic, "data_type", "string"); |
| | | LogicMethod.CurrLogicMethod.dictionary(dic, "value", valueStr); |
| | | input.condition.Add(dic); |
| | | //纬度 |
| | | input.geo_fence.latitude = out_lat.ToString(); |
| | | //经度 |
| | | input.geo_fence.longitude = out_lng.ToString(); |
| | | //半径<单位米> |
| | | input.geo_fence.radius = mRadius.ToString(); |
| | | AddCondition(input); |
| | | LogicMethod.CurrLogicMethod.RemoveAllView(); |
| | | AddLogic addLogic = new AddLogic(); |
| | | MainPage.BasePageView.AddChidren(addLogic); |
| | | addLogic.Show(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | }, strname, Language.StringByID(StringId.save), true, latitude, longitude, r); |
| | | }, strname, Language.StringByID(StringId.save), true, latitude, longitude, r); |
| | | |
| | | }, "android.permission.READ_PHONE_STATE"); |
| | | |
| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }, strname, Language.StringByID(StringId.save), true, latitude, longitude, r); |
| | | #endif |
| | | }); |
| | | }); |
| | | |
| | | |
| | | } |