Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
 public IndexerBuisnessService(LagerDAO dao, ITranslationService translate)
 {
     this.dao = dao;
     this.translate = translate;
 }