Exemplo n.º 1
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
#if HAVE_LOG_FILE
            FSLog.LogFileEnabled = true;
#endif
            FSLog.Info("App starting");

#if HAVE_BACKGROUND_RUNNING
            RunningInBackground = false;
#endif
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                //Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are being GPU accelerated with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;
            }

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Language display initialization
            InitializeLanguage();

            // For now this affects the textbox on signup page only
            (App.Current.Resources["PhoneTextBoxEditBorderBrush"] as SolidColorBrush).Color
                = (Color)((ResourceDictionary)Resources["Colors"])["Main"];

            // Affects many texts, which should be white
            (App.Current.Resources["PhoneForegroundBrush"] as SolidColorBrush).Color
                = (Color)((ResourceDictionary)Resources["Colors"])["White"];

#if RELEASE
            AppRater.Initialize(TimeSpan.FromDays(4), 10);
#else
            AppRater.Initialize(TimeSpan.FromMinutes(5), 1);
#endif

            AppRater.IncreaseLaunchCount();

            PlacesManager.Instance.Initialize();
        }
Exemplo n.º 2
0
	void Awake ()
	{
		instance = this;
		
		neverShow = PlayerPrefs.GetInt(neverRateKey, 0) == 1;
		alreadyRated = PlayerPrefs.GetInt(ratedKey, 0) == 1;
		days = PlayerPrefs.GetInt(lastRateKey, -1);
		
		if (days <= -1) 
		{
			days = 0;//Mathf.FloorToInt((float)System.DateTime.Now.Subtract(baseDate).TotalDays);
			//PlayerPrefs.SetInt(lastRateKey, days);
		}
#if UNITY_ANDROID || UNITY_IPHONE
		if (distributionBuild) {
			appId = clientId;
		}
		else {
			appId = devId;
		}
#endif
	}
Exemplo n.º 3
0
    void Awake()
    {
        instance = this;

        neverShow    = PlayerPrefs.GetInt(neverRateKey, 0) == 1;
        alreadyRated = PlayerPrefs.GetInt(ratedKey, 0) == 1;
        days         = PlayerPrefs.GetInt(lastRateKey, -1);

        if (days <= -1)
        {
            days = 0;            //Mathf.FloorToInt((float)System.DateTime.Now.Subtract(baseDate).TotalDays);
            //PlayerPrefs.SetInt(lastRateKey, days);
        }
#if UNITY_ANDROID || UNITY_IPHONE
        if (distributionBuild)
        {
            appId = clientId;
        }
        else
        {
            appId = devId;
        }
#endif
    }
Exemplo n.º 4
0
        // This method is invoked when the application has loaded its UI and its ready to run
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // If you have defined a view, add it here:
            // window.AddSubview (navigationController.View);
            //var version = NSBundle.MainBundle.InfoDictionary.ObjectForKey(new NSString("CFBundleName")).ToString();
            AppRater.AppLaunched("myappid");
            var launcher = new NavLauncher();

            launcher.Pages = new List <NavPage>()
            {
                new NavPage(3, 3)
                {
                    Icons = new List <NavIcon> {
                        new NavIcon()
                        {
                            Image             = Images.Contacts,
                            Title             = "Test Label",
                            NotificationCount = 10,
                            ModalView         = delegate() {
                                return(new TestView(new RectangleF(100, 100, 100, 100), "Label Text"));
                            },
                        },
                        new NavIcon()
                        {
                            Image     = Images.Favorites,
                            Title     = "Stack Panel",
                            ModalView = delegate()
                            {
                                return(new      StackPanelView(this.window.Frame));
                            }
                        },
                        new NavIcon()
                        {
                            Image     = Images.History,
                            Title     = "Calendar",
                            ModalView = delegate() { return(new CalendarView()); }
                        },
                        new NavIcon()
                        {
                            Image     = Images.Most,
                            Title     = "MT.D",
                            ModalView = delegate()
                            {
                                return(new DialogViewController(DemoElementApi()));
                            }
                        },
                        new NavIcon()
                        {
                            Image     = Images.Favorites,
                            Title     = "Datagrid",
                            ModalView = delegate()
                            {
                                return(new DataGrid(this.window.Frame));
                            }
                        },
                        new NavIcon()
                        {
                            Image     = Images.Recent,
                            Title     = "Play movie",
                            ModalView = delegate()
                            {
                                MPMoviePlayerController mp = new MPMoviePlayerController(new NSUrl("http://content.mp3tunes.com/storage/lockerplay/be266176d810daf35bdc2cc6469da98c/?sid=92ba9ce91039f0e2b1d46bbd3d0714cb&partner_token=1159283925"));
                                mp.ShouldAutoplay = true;
                                mp.Fullscreen     = true;
                                return(mp.View);
                                //moviePlayer.Play();
                                //return moviePlayer;
                            }
                        }
                    }
                },
                new NavPage(3, 3)
                {
                    Icons = new List <NavIcon> {
                        new NavIcon()
                        {
                            Image = Images.Recent,
                            Title = "nothing"
                        },
                    }
                }
            };
            navigationController = new UINavigationController();
            navigationController.PushViewController(launcher, false);
            window.AddSubview(navigationController.View);
            window.MakeKeyAndVisible();

            return(true);
        }