Ejemplo n.º 1
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            UITabBarController tabBarController;

            window = new UIWindow(UIScreen.MainScreen.Bounds);

            //viewController = new TrafficDialogViewController();

            var dv = new TrafficDialogViewController()
            {
                Autorotate = true
            };

            var tap = new UITapGestureRecognizer();

            tap.AddTarget(() => {
                dv.View.EndEditing(true);
            });
            dv.View.AddGestureRecognizer(tap);

            tap.CancelsTouchesInView = false;


            navigation = new UINavigationController();
            navigation.PushViewController(dv, true);

            window = new UIWindow(UIScreen.MainScreen.Bounds);
            window.MakeKeyAndVisible();
            window.RootViewController = navigation;

            return(true);
        }
Ejemplo n.º 2
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching (UIApplication   app, NSDictionary options)
        {

            UITabBarController tabBarController;

            window = new UIWindow (UIScreen.MainScreen.Bounds);

            //viewController = new TrafficDialogViewController();

            var dv = new TrafficDialogViewController (){
                Autorotate = true
            };

            var tap = new UITapGestureRecognizer ();
            tap.AddTarget (() =>{
                dv.View.EndEditing (true);
            });
            dv.View.AddGestureRecognizer (tap);

            tap.CancelsTouchesInView = false;


            navigation = new UINavigationController ();
            navigation.PushViewController (dv, true);

            window = new UIWindow (UIScreen.MainScreen.Bounds);
            window.MakeKeyAndVisible ();
            window.RootViewController = navigation;  

            return true;
        }
Ejemplo n.º 3
0
        public void ValidateLocation (string location, TrafficDialogViewController.GetLocationActions locActions){

            Console.WriteLine ("Validating locations...");
            string url = string.Format ("https://maps.googleapis.com/maps/api/geocode/json?latlng={0}&sensor=true&key={1}", location, GoogleApiKey);
            MakeCallAndGetJsonResponse (url, false, 
                (string jsonString, string time) => {

                    if(ParseValidateLocationResponse(jsonString, false, locActions) ){
                    }
                }
            );

            Console.WriteLine ("");
        }
Ejemplo n.º 4
0
        public bool ParseValidateLocationResponse (string jsonString, bool fromAddress, TrafficDialogViewController.GetLocationActions locActions){

            try {
                JArray locjson = ParseJObject (jsonString, "results");

                if ((locjson != null) && (locjson.Count() > 0)) {
                    Console.Write (string.Format ("Location from Coordinates * {0}{1}{2}", locjson[0]["formatted_address"], locjson[0]["geometry"]["location"]["lat"], locjson[0]["geometry"]["location"]["lng"]));
                    AddressUpdate(locjson[0]["formatted_address"].ToString(), locjson[0]["geometry"]["location"]["lat"].ToString(), locjson[0]["geometry"]["location"]["lng"].ToString(), fromAddress, "",  locActions);
                }
            } catch (Exception ex) {
                Console.WriteLine ("Error" + ex.ToString ());
            }       
            return true;
        }