Beispiel #1
0
 void Initialize()
 {
     //Console.WriteLine("Initialize");
     _WoodCore = new WoodCore(this);
     this.SetWebChromeClient(new WoodWebChromeClient());
     this.SetWebViewClient(new WoodWebViewClient());
     this.Settings.JavaScriptEnabled = true;
     this.Settings.JavaScriptCanOpenWindowsAutomatically = false;
 }
Beispiel #2
0
 public object ExecuteHasReturn(WoodCore core, ServiceArgs args)
 {
     var methodName = args.Method;
     var callback = args.CallbackName;
     if (_actions.ContainsKey(methodName))
     {
         var method = _actions[methodName] as Func<WoodCore, ServiceArgs, object>;
         if (method == null)
         {
             throw new Exception("service " + args.Service + " has no method  named " + args.Method + " with return value");
         }
         return method(core, args);
     }
     throw new Exception("service " + args.Service + " has no method  named " + args.Method + " with return value");
 }
Beispiel #3
0
 public void Execute(WoodCore core, ServiceArgs args)
 {
     var methodName = args.Method;
     var callback = args.CallbackName;
     if (_actions.ContainsKey(methodName))
     {
         var method = _actions[methodName] as Action<WoodCore, ServiceArgs>;
         if (method == null)
         {
             throw new Exception("service " + args.Service + " has no method named " + args.Method);
         }
         method(core, args);
     }
     throw new Exception("service " + args.Service + " has no method named " + args.Method);
 }
Beispiel #4
0
			public LocationManager(WoodCore core,ServiceArgs args){
				this.core=core;
				this.args=args;
				Id=Guid.NewGuid();
				mgr=new CLLocationManager();
				if(UIDevice.CurrentDevice.CheckSystemVersion(8,0)){
					mgr.RequestAlwaysAuthorization();
				}
				if(CLLocationManager.LocationServicesEnabled){
					mgr.DesiredAccuracy=1;
					//StartUpdatingLocation();
					mgr.LocationsUpdated+=delegate(object sender,CLLocationsUpdatedEventArgs e) {
						LocationUpdated(this,new LocationUpdatedEventArgs(e.Locations[e.Locations.Length-1]));	
					};
				}
			}
Beispiel #5
0
 void Initialize()
 {
     //Console.WriteLine("Initialize");
     _WoodCore = new WoodCore(this);
     this.LoadStarted += delegate { AttachCoreScripts(); };
 }