Example #1
0
        //public static CouchDB db;
        //
        // 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)
        {
            GAI.SharedInstance.DispatchInterval = 20;
            GAI.SharedInstance.TrackUncaughtExceptions = true;
            Tracker = GAI.SharedInstance.GetTracker (TrackingId);

            iRate.SharedInstance.UserDidAttemptToRateApp += (sender, e) => {
                GAI.SharedInstance.DefaultTracker.Send (GAIDictionaryBuilder.CreateEvent ("UserRating", "User is rating app now!","UsesCount", iRate.SharedInstance.UsesCount).Build ());
                Console.WriteLine ("User is rating app now!");
            };

            iRate.SharedInstance.UserDidDeclineToRateApp += (sender, e) => {
                GAI.SharedInstance.DefaultTracker.Send (GAIDictionaryBuilder.CreateEvent ("UserRating", "User does not want to rate app","UsesCount", iRate.SharedInstance.UsesCount).Build ());
                Console.WriteLine ("User does not want to rate app");
            };

            iRate.SharedInstance.UserDidRequestReminderToRateApp += (sender, e) => {
                GAI.SharedInstance.DefaultTracker.Send (GAIDictionaryBuilder.CreateEvent ("UserRating", "User will rate app later","UsesCount", iRate.SharedInstance.UsesCount).Build ());
                Console.WriteLine ("User will rate app later");
            };

            key = new KeyStorageServiceIos ();

            var documents = Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData);
            var pathToDatabase = Path.Combine(documents, "db_sqlite-net.db");

            Connection conn = new Connection (pathToDatabase);

            dao = new LagerDAO (conn,Variant);

            dao.LimitExceeded += (object sender, EventArgs e) => PleaseBuyFullVersion ();

            bl = new IndexerBuisnessService (dao, new TranslationServiceIos());
            its = new TranslationServiceIos ();

            // create a new window instance based on the screen size
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            Dashboard = new DashBoardViewController ();
            navController = new UINavigationController (Dashboard);
            //navController.NavigationBar.BackgroundColor = UIColor.Clear;

            //			if(MonoTouch.Foundation.isi
            //			window.TintColor = UIColor.Purple;

            window.RootViewController = navController;
            // If you have defined a root view controller, set it here:
            //this.window.RootViewController = dashboard;

            // make the window visible
            window.MakeKeyAndVisible ();

            return true;
        }
Example #2
0
        public void InitSateliteMenu()
        {
            var image = MenuIcon.MakeImage ();
            var yPos = View.Frame.Height - image.Size.Height - 10;
            var frame = new RectangleF (10, yPos, image.Size.Width, image.Size.Height);

            var items = GetMenuItems ();

            SateliteButton = new SatelliteMenuButton (View, image, items, frame);
            SateliteButton.CloseItemsOnClick = false;

            SateliteButton.MenuItemClick += (_, args) => {
                Console.WriteLine ("{0} was clicked!", args.MenuItem.Name);

                if(args.MenuItem.Name == "Scanner"){
                    Scanner scanner = new Scanner(this);
                    scanner.Scannit();
                }
                if(args.MenuItem.Name == "Items"){
            //					if(UserInterfaceIdiomIsPhone){
                        ItemCatalogue cat = new ItemCatalogue();
                        //PresentViewControllerAsync(cat, true);
                        ancestor.NavigationController.PushViewController(cat,true);
            //					}else{
            //						ItemMasterView itemMaster = new ItemMasterView();
            //						ancestor.NavigationController.PushViewController(itemMaster,true);
            //					}
                }
                if(args.MenuItem.Name == "Big Items"){
            //					if(UserInterfaceIdiomIsPhone){
                        BigItemsScreen biggies = new BigItemsScreen();
                        ancestor.NavigationController.PushViewController(biggies, true);
            //					}else{
            //						BigItemMasterView bigMaster = new BigItemMasterView();
            //						ancestor.NavigationController.PushViewController(bigMaster,true);
            //					}
                }
                if(args.MenuItem.Name == "Containers"){
            //					if(UserInterfaceIdiomIsPhone){
                        ContainerScreen containers = new ContainerScreen();
                        ancestor.NavigationController.PushViewController(containers,true);
            //					}else{
            //						ContainerMasterView containerMaster = new ContainerMasterView();
            //						ancestor.NavigationController.PushViewController(containerMaster,true);
            //					}
                }

                if(args.MenuItem.Name == "Gallery"){
                    GalleryViewController tagGallery = new GalleryViewController();
                    ancestor.NavigationController.PushViewController(tagGallery,true);
                }

                if(args.MenuItem.Name == "Locations"){
            //					if(UserInterfaceIdiomIsPhone){
                    StorageCatalogue sc = new StorageCatalogue();
                    ancestor.NavigationController.PushViewController(sc,true);
            //					}else{
            //						LagerMasterView lmv = new LagerMasterView();
            //						ancestor.NavigationController.PushViewController(lmv,true);
            //					}
                }

                if(args.MenuItem.Name == "Dashboard"){
                    DashBoardViewController dash = new DashBoardViewController();
                    ancestor.NavigationController.PushViewController(dash,true);
                }

            };
            this.View.BackgroundColor = UIColor.Clear;
            View.AddSubview (SateliteButton);
            View.UserInteractionEnabled = true;
        }