예제 #1
0
        public static void SetupTelemetry(this MainWindowVmBase vm, Window win, string instrumentationKey, bool hideOnWindowClose)
        {
            AppInsights.StartTracking(instrumentationKey);
            SetAppEventHandlers();
            AppInsights.Post("Telemetry started.");

            vm.HandleWindowEvents(win, null, hideOnWindowClose);
        }
예제 #2
0
 private static void SetAppEventHandlers()
 {
     AppDomain.CurrentDomain.ProcessExit += (s, e) =>
     {
         AppInsights.Post("Telemetry ended.");
         AppInsights.Flush();
     };
 }