コード例 #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();
     };
 }