Exemple #1
0
        public MonitoredApplication(IConfigurationRoot config)
            : base(config)
        {
            var settings = config.Get <AppSettings>();

            this.telemetry = new WinAppInsightsTelemetryFactory(settings).Create();
        }
Exemple #2
0
        private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            var ex2 = e.ExceptionObject as Exception;

            if (ex2 == null)
            {
                ex2 = sender as Exception;
            }
            AppInsightTelemetry.TrackException(ex2);
        }
Exemple #3
0
        protected override async void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            if (Guid.Empty == TakoDeployWPF.Properties.Settings.Default.AnonymousUserId)
            {
                TakoDeployWPF.Properties.Settings.Default.AnonymousUserId = Guid.NewGuid();
                TakoDeployWPF.Properties.Settings.Default.Save();
            }

            if (Guid.Empty != TakoDeployWPF.Properties.Settings.Default.AnonymousUserId)
            {
                AppInsightTelemetry.SetUser(TakoDeployWPF.Properties.Settings.Default.AnonymousUserId.ToString());
            }

            AppInsightTelemetry.Enabled = TakoDeployWPF.Properties.Settings.Default.EnableTelemetry;
            AppInsightTelemetry.TrackEvent("Startup");
        }
Exemple #4
0
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     AppInsightTelemetry.Flush();
 }