コード例 #1
0
        public App()
        {
            InitializeComponent();
            SplashFactory = e => new Splash(e);

            // ensure unobserved task exceptions (unawaited async methods returning Task or Task<T>) are handled
            TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;

            // ensure general app exceptions are handled
            Application.Current.UnhandledException += App_UnhandledException;

            // Init HockeySDK
            if (!string.IsNullOrEmpty(ApplicationKeys.HockeyAppToken))
            {
                HockeyClient.Current.Configure(ApplicationKeys.HockeyAppToken);
            }

            // Set this in the instance constructor to prevent the creation of an unnecessary static constructor.
            _displayRequest = new DisplayRequest();

            // Initialize the Live Tile Updater.
            LiveTileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();

            // Init the proximity helper to turn the screen off when it's in your pocket
            _proximityHelper = new Utils.Helpers.ProximityHelper();
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: DrMabuse90/PoGo-UWP
        public App()
        {
            InitializeComponent();
            SplashFactory = e => new Splash(e);

            // ensure unobserved task exceptions (unawaited async methods returning Task or Task<T>) are handled
            TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;

            // ensure general app exceptions are handled
            Application.Current.UnhandledException += App_UnhandledException;

            // Init HockeySDK
            if (!string.IsNullOrEmpty(ApplicationKeys.HockeyAppToken))
            {
                HockeyClient.Current.Configure(ApplicationKeys.HockeyAppToken);
            }

            // Set this in the instance constructor to prevent the creation of an unnecessary static constructor.
            _displayRequest = new DisplayRequest();

            // Initialize the Live Tile Updater.
            LiveTileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();

            // Init the proximity helper to turn the screen off when it's in your pocket
            _proximityHelper = new ProximityHelper();
            _proximityHelper.EnableDisplayAutoOff(false);

            POGOLib.Official.Logging.Logger.RegisterLogOutput((level, message) =>
            {
                Debug.WriteLine($"[{DateTime.Now.ToString("HH:mm:ss")}][{level}] {message}");
            });
        }