private void Window_Closed(object sender,EventArgs e) {
     Crittercism.LeaveBreadcrumb("Closed");
     App.UserflowEvent -= UserflowEventHandler;
     if (Application.Current.Windows.Count == 0) {
         // Last window is closing.
         Crittercism.Shutdown();
         Application.Current.Shutdown();
     }
 }
 private void Form1_FormClosed(object sender, FormClosedEventArgs e)
 {
     Crittercism.LeaveBreadcrumb("FormClosed");
     ApplicationOpenFormsCount--;
     if (ApplicationOpenFormsCount == 0)
     {
         // Last window is closing.
         Crittercism.Shutdown();
         Application.Exit();
     }
 }
Example #3
0
 private void MainWindow_FormClosed(object sender, FormClosedEventArgs e)
 {
     Crittercism.LeaveBreadcrumb("FormClosed");
     Program.UserflowEvent -= UserflowEventHandler;
     ApplicationOpenFormsCount--;
     if (ApplicationOpenFormsCount == 0)
     {
         // Last window is closing.
         Crittercism.Shutdown();
         Application.Exit();
     }
 }
 public static void Main(string[] args)
 {
     Crittercism.Init("YOUR APP ID GOES HERE");
     try {
         Console.WriteLine("ConsoleApp Demo");
         Help();
         CommandLoop();
     } catch (Exception e) {
         // Log a Crash .
         Crittercism.LogUnhandledException(e);
     }
     Crittercism.Shutdown();
 }
 public static void Main(string[] args)
 {
     Crittercism.Init("537a4e738039805d82000002");
     try {
         Console.WriteLine("ConsoleApp Demo");
         Help();
         CommandLoop();
     } catch (Exception e) {
         // Log a Crash .
         Crittercism.LogUnhandledException(e);
     }
     Crittercism.Shutdown();
 }
Example #6
0
 public void MetadataPersistenceTest()
 {
     try {
         TestHelpers.StartApp();
         Crittercism.SetUsername("harry");
         Crittercism.SetValue("surname", "hedwig");
         Trace.WriteLine("surname == " + Crittercism.ValueFor("surname"));
         Assert.AreEqual(Crittercism.ValueFor("surname"), "hedwig");
         Assert.AreEqual(Crittercism.ValueFor("username"), "harry");
         Crittercism.SetUsername("hermione");
         Crittercism.SetValue("surname", "crookshanks");
         Assert.AreEqual(Crittercism.ValueFor("surname"), "crookshanks");
         Assert.AreEqual(Crittercism.ValueFor("username"), "hermione");
     } finally {
         Crittercism.Shutdown();
         TestHelpers.Cleanup();
     }
 }
Example #7
0
 public void AddMetadataTwiceTest()
 {
     try {
         TestHelpers.StartApp();
         Crittercism.SetUsername("hamster");
         Crittercism.SetUsername("robin");
         Crittercism.SetUsername("squirrel");
         TestHelpers.LogHandledException();
         MessageReport messageReport = TestHelpers.DequeueMessageType(typeof(HandledException));
         String        asJson        = JsonConvert.SerializeObject(messageReport);
         Assert.IsFalse(asJson.Contains("hamster"));
         Assert.IsFalse(asJson.Contains("robin"));
         Assert.IsTrue(asJson.Contains("squirrel"));
     } finally {
         Crittercism.Shutdown();
         TestHelpers.Cleanup();
     }
 }
Example #8
0
 public void TestCleanup()
 {
     // Use TestCleanup to run code after each test has run
     Crittercism.Shutdown();
     TestHelpers.Cleanup();
 }