| | |
| | | using Shared; |
| | | using UIKit; |
| | | using Shared.SimpleControl; |
| | | using System; |
| | | |
| | | namespace ON.IosrgumentExceptio |
| | | { |
| | | public class Application |
| | |
| | | static void Main (string [] args) |
| | | { |
| | | //获取经纬度 |
| | | Shared.Application.LocationAction = (arg1, arg2) => { |
| | | Shared.Application.LocationAction = null; |
| | | System.Threading.Tasks.Task.Run (() => { |
| | | while (true) { |
| | | //#if DEBUG |
| | | // break; |
| | | //#endif |
| | | Utlis.WriteLine ("Get Location GetAirQuality"); |
| | | try { |
| | | CommonPage.AirQuality = new service.hdlcontrol.com_WebServiceAirQuality.WebServiceAirQuality ().GetAirQuality (arg2.ToString (), arg1.ToString ()); |
| | | //CommonPage.AirQuality = new service.hdlcontrol.com_WebServiceAirQuality.WebServiceAirQuality ().GetAirQuality ("14.5184506127", "121.0762023926"); |
| | | if (Shared.SimpleControl.CommonPage.AirQuality != null) |
| | | break; |
| | | } catch { } |
| | | } |
| | | Shared.Application.RunOnMainThread (() => { |
| | | if (CommonPage.RefreshAir != null) |
| | | CommonPage.RefreshAir (); |
| | | }); |
| | | }); |
| | | Shared.Application.LocationAction = (lon, lat) => { |
| | | try { |
| | | Shared.Application.LocationAction = null; |
| | | HttpServerRequest.Current.GetCityInfo (lon.ToString (), lat.ToString ()); |
| | | } catch (Exception ex) { |
| | | Utlis.WriteLine ("GetCityInfo catch" + ex.Message); |
| | | } |
| | | |
| | | }; |
| | | |
| | | // if you want to use a different Application Delegate class from "AppDelegate" |