Example #1
0
        /// <summary>
        ///     Initializes the singleton application object.  This is the first line of authored code
        ///     executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;
            WindowsAppInitializer.InitializeAsync(
                WindowsCollectors.Metadata |
                WindowsCollectors.Session);
            InitializeComponent();
            Suspending += OnSuspending;


            //var path = ApplicationData.Current.LocalFolder;
            try
            {
                LocalizationHelper.SetLocale(LocalizationHelper.GetCurrentLocale());

                using (var db = new FamilyBudgetContext())
                {
                    db.Database.Migrate();
                    FamilyBudgetInitializer.Initialize();

                    new CurrencyServiceWrapper().RefreshCurrencies();
                }
            }
            catch (Exception ex)
            {
            }
        }
Example #2
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            // Initialize AI telemetry in the app.
            WindowsAppInitializer.InitializeAsync();

            // Timer uploading hearbeat telemetry event
            HeartbeatTimer          = new DispatcherTimer();
            HeartbeatTimer.Tick    += HeartbeatTimer_Tick;
            HeartbeatTimer.Interval = new TimeSpan(0, heartbeatInterval, 0);    // tick every heartbeatInterval
            HeartbeatTimer.Start();

            // Retrieve and set environment settings
            OSVersion  = EnvironmentSettings.GetOSVersion();
            appVersion = EnvironmentSettings.GetAppVersion();
            deviceName = EnvironmentSettings.GetDeviceName();
            ipAddress  = EnvironmentSettings.GetIPAddress();



            this.InitializeComponent();
            this.Suspending += OnSuspending;
            this.Resuming   += OnResuming;

            Controller = new AppController();
        }
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            WindowsAppInitializer.InitializeAsync()
            .ContinueWith(
                task =>
            {
                TelemetryConfiguration.Active.TelemetryInitializers.Add(new UwpDeviceTelemetryInitializer());
            })
            .ContinueWith(task => { Telemetry = new TelemetryClient(); });

            this.InitializeComponent();
            this.Suspending         += this.OnSuspending;
            this.Resuming           += this.OnResuming;
            this.UnhandledException += this.App_UnhandledException;

            if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                HardwareButtons.BackPressed += this.HardwareButtons_BackPressed;
            }

            try
            {
                TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true);
            }
            catch (Exception)
            {
                // on device which doesn't have it... (core)
            }
        }
Example #4
0
 /// <summary>
 ///     Initializes the singleton application object.  This is the first line of authored code
 ///     executed, and as such is the logical equivalent of main() or WinMain().
 /// </summary>
 public App()
 {
     WindowsAppInitializer.InitializeAsync();
     this.InitializeComponent();
     this.Suspending += this.OnSuspending;
     BackgroundTask.Register();
 }
Example #5
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            WindowsAppInitializer.InitializeAsync();

            this.InitializeComponent();
            this.Suspending += this.OnSuspending;
        }
Example #6
0
 /// <summary>
 ///     Initializes the singleton application object.  This is the first line of authored code
 ///     executed, and as such is the logical equivalent of main() or WinMain().
 /// </summary>
 public App()
 {
     WindowsAppInitializer.InitializeAsync(
         WindowsCollectors.Metadata |
         WindowsCollectors.Session);
     InitializeComponent();
 }
Example #7
0
        protected override async void OnLaunched(LaunchActivatedEventArgs e)
        {
            Loc.Init();
#if DEBUG
            if (Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            await WindowsAppInitializer.InitializeAsync("755097ed-7bf6-41a8-81c4-6d072579a7eb", WindowsCollectors.Metadata | WindowsCollectors.PageView | WindowsCollectors.Session | WindowsCollectors.UnhandledException);

            if (AppShell == null)
            {
                AppShell = new Shell();
                App.AppShell.GoToDarkTheme(Loc.Settings.IsApplicationThemeDark);
                Loc.NavigationService.Initialize();
                ThreadUI.setDispatcher(NavigationFrame.Dispatcher);
                AppViewHelper.SetAppView();
                Window.Current.Activate();

                Loc.Main.AccountManager = new AccountManager();

                AppShell.Language = ApplicationLanguages.Languages[0];

                AppShell.NavigationFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }
            }
        }
Example #8
0
        public App()
        {
            this.UnhandledException += App_UnhandledException;
            this.Suspending         += this.OnSuspending;

#if DEBUG
            //disable application insights on debug
            TelemetryConfiguration.Active.DisableTelemetry = true;
#else
            //config application insights
            WindowsAppInitializer.InitializeAsync();//WindowsCollectors.Metadata | WindowsCollectors.Session | WindowsCollectors.UnhandledException);
#endif

            //application insights has always to be initialized
            TelemetryClient = new TelemetryClient();

            AppSettings.Instance.ThemeChanged               += (s, e) => { UpdateTheme(e.Theme); App.TelemetryClient.TrackMetric("Theme", AppSettings.Instance.Theme == ElementTheme.Light ? 1 : 2); };
            AppSettings.Instance.TransparentTileChanged     += (s, e) => NotificationsManager.UpdateDefaultTile(e.TransparentTile);
            AppSettings.Instance.TransparentNoteTileChanged += (s, e) => NotificationsManager.UpdateAllNoteTilesBackgroundColor(e.TransparentTile);

            AppData.NotesSaved       += (s, e) => SimulateStatusBarProgressComplete();
            AppData.NoteColorChanged += async(s, _e) => { await NotificationsManager.UpdateNoteTileBackgroundColor(_e.Note, AppSettings.Instance.TransparentNoteTile); };


            this.InitializeComponent();
        }
Example #9
0
        /// <summary>
        /// 初始化单一实例应用程序对象。这是执行的创作代码的第一行,
        /// 已执行,逻辑上等同于 main() 或 WinMain()。
        /// </summary>
        public App()
        {
            WindowsAppInitializer.InitializeAsync(WindowsCollectors.Metadata | WindowsCollectors.Session);

            this.InitializeComponent();
            this.Suspending         += OnSuspending;
            this.UnhandledException += App_UnhandledException;
        }
Example #10
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            // Add this initilization line.
            WindowsAppInitializer.InitializeAsync();

            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }
Example #11
0
        public App()
        {
            // Initialize telemetry
            WindowsAppInitializer.InitializeAsync();

            InitializeComponent();
            SplashFactory = (e) => new Splash(e);
        }
Example #12
0
 /// <summary>
 /// Initializes the singleton application object.  This is the first line of authored code
 /// executed, and as such is the logical equivalent of main() or WinMain().
 /// </summary>
 public App()
 {
     Microsoft.HockeyApp.HockeyClient.Current.Configure("4d0ddb67a4144b2ca638f5adf7a09801");
     WindowsAppInitializer.InitializeAsync();
     InitializeComponent();
     _activationService = new Lazy <ActivationService>(CreateActivationService);
     Suspending        += OnSuspending;
 }
Example #13
0
 /// <summary>
 /// Initializes the singleton application object.  This is the first line of authored code
 /// executed, and as such is the logical equivalent of main() or WinMain().
 /// </summary>
 public App()
 {
     WindowsAppInitializer.InitializeAsync(
         WindowsCollectors.Metadata |
         WindowsCollectors.Session);
     this.InitializeComponent();
     this.Suspending += OnSuspending;
 }
Example #14
0
 /// <summary>
 /// 初始化单一实例应用程序对象。这是执行的创作代码的第一行,
 /// 已执行,逻辑上等同于 main() 或 WinMain()。
 /// </summary>
 public App()
 {
     WindowsAppInitializer.InitializeAsync(
         WindowsCollectors.Metadata |
         WindowsCollectors.Session);
     InitializeComponent();
     Suspending += OnSuspending;
     LoadConfig();
 }
        /// <summary>
        ///     Initializes the singleton application object.  This is the first line of authored code
        ///     executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            InitializeComponent();
#if !DEBUG
            WindowsAppInitializer.InitializeAsync();
#endif

            Suspending += OnSuspending;
        }
Example #16
0
 /// <summary>
 /// Initialize full AI and HA telemetry for the app.
 /// </summary>
 public static void InitializeAppTelemetry()
 {
     WindowsAppInitializer.InitializeAsync(
         AppInsightsIKey,
         WindowsCollectors.Metadata |
         WindowsCollectors.Session |
         WindowsCollectors.UnhandledException);
     HockeyClient.Current.Configure(HockeyAppKey);
 }
Example #17
0
 /// <summary>
 ///     Initializes the singleton application object.  This is the first line of authored code
 ///     executed, and as such is the logical equivalent of main() or WinMain().
 /// </summary>
 public App()
 {
     WindowsAppInitializer.InitializeAsync(
         WindowsCollectors.Metadata |
         WindowsCollectors.Session);
     Current.RequestedTheme = Settings.SelectedTheme;
     InitializeComponent();
     Suspending += OnSuspending;
 }
Example #18
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            // Add this initilization line.
            WindowsAppInitializer.InitializeAsync();

            this.InitializeComponent();
            this.Suspending         += OnSuspending;
            this.UnhandledException += App_UnhandledException;
        }
Example #19
0
        /// <summary>
        /// Internal method for Telemetry initialization.
        /// </summary>
        private static async Task InitializeInternalAsync()
        {
            if (!OptinTelemetry)
            {
                return;
            }
            await WindowsAppInitializer.InitializeAsync();

            _isInitialized = true;
        }
Example #20
0
        /// <summary>
        /// Initialise l'objet d'application de singleton.  Il s'agit de la première ligne du code créé
        /// à être exécutée. Elle correspond donc à l'équivalent logique de main() ou WinMain().
        /// </summary>
        public App()
        {
            WindowsAppInitializer.InitializeAsync();

            // Set screen size
            SetScreenSize();

            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }
Example #21
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            if (!DesignMode.DesignModeEnabled)
            {
                WindowsAppInitializer.InitializeAsync(WindowsCollectors.Metadata | WindowsCollectors.Session | WindowsCollectors.PageView | WindowsCollectors.UnhandledException);
            }

            this.InitializeComponent();
            this.Suspending += OnSuspending;
        }
Example #22
0
        //public static BuildsData BuildsDataCollection { get; set; }

        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            // Add this initilization line.
            WindowsAppInitializer.InitializeAsync();

            this.InitializeComponent();
            this.Suspending += OnSuspending;

            //BuildsDataCollection = new BuildsData();
        }
Example #23
0
 /// <summary>
 /// Initializes the singleton application object.  This is the first line of authored code
 /// executed, and as such is the logical equivalent of main() or WinMain().
 /// </summary>
 public App()
 {
     WindowsAppInitializer.InitializeAsync(
         WindowsCollectors.Metadata |
         WindowsCollectors.Session);
     HockeyClient.Current.Configure("02009771188741c6a210252326b5732e");
     InitializeComponent();
     Suspending += OnSuspending;
     InitNotificationsAsync();
 }
        public void WindowsBootStrapperSettingTheInstrumentationKeyWhenSupplied()
        {
            ServiceLocator.AddService <BaseStorageService>(new TestStorageService());

            string instrumentationKey = Guid.NewGuid().ToString();

            WindowsAppInitializer.InitializeAsync(instrumentationKey, new TelemetryConfiguration()
            {
                Collectors = WindowsCollectors.Metadata
            }).GetAwaiter().GetResult();
            Assert.IsFalse(string.IsNullOrEmpty(TelemetryConfiguration.Active.InstrumentationKey));
        }
Example #25
0
        public App()
        {
            WindowsAppInitializer.InitializeAsync();

            // Only the dark theme is supported in everything else (they only have light option)
            if (!DeviceHelper.IsType(DeviceFamily.Mobile))
            {
                RequestedTheme = ApplicationTheme.Dark;
            }

            InitializeComponent();
        }
Example #26
0
        public App()
        {
            // initialize application insights
            WindowsAppInitializer.InitializeAsync();

            // then init the components for the app
            InitializeComponent();

            CacheMaxDuration    = TimeSpan.FromDays(2);
            ShowShellBackButton = SettingsService.Instance.UseShellBackButton;
            SplashFactory       = (e) => new Views.Splash(e);
        }
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            WindowsAppInitializer.InitializeAsync(ServiceEnvironmentBase.Current.InstrumentationKey,
                                                  WindowsCollectors.Metadata
                                                  | WindowsCollectors.Session
                                                  | WindowsCollectors.UnhandledException);

            InitializeComponent();

            // Register for events
            Suspending         += OnSuspending;
            UnhandledException += OnUnhandledException;
        }
Example #28
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            WindowsAppInitializer.InitializeAsync();

            this.InitializeComponent();
            this.Suspending += OnSuspending;

            // Set screen size
            SetScreenSize();

            // Load theme
            LoadTheme(false);
        }
Example #29
0
 /// <summary>
 ///     Initializes the singleton application object.  This is the first line of authored code
 ///     executed, and as such is the logical equivalent of main() or WinMain().
 /// </summary>
 public App()
 {
     WindowsAppInitializer.InitializeAsync(
         WindowsCollectors.Metadata |
         WindowsCollectors.PageView |
         WindowsCollectors.Session);
     TelemetryConfiguration.Active.DisableTelemetry =
         !ChatterBox.Client.Common.Settings.SignalingSettings.AppInsightsEnabled;
     UnhandledException += CurrentDomain_UnhandledException;
     InitializeComponent();
     Suspending += OnSuspending;
     Resuming   += OnResuming;
 }
Example #30
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            WindowsAppInitializer.InitializeAsync()
            .ContinueWith(task =>
            {
                TelemetryConfiguration.Active.TelemetryInitializers.Add(new UwpDeviceTelemetryInitializer());
            })
            .ContinueWith(task => { Telemetry = new TelemetryClient(); });

            this.InitializeComponent();
            this.Suspending += OnSuspending;

            Telemetry = new TelemetryClient();
        }