Skip to content

Instantly share code, notes, and snippets.

@cdeutsch
Created December 10, 2014 16:11
Show Gist options
  • Save cdeutsch/07a1fae06db0fafa22ca to your computer and use it in GitHub Desktop.
Save cdeutsch/07a1fae06db0fafa22ca to your computer and use it in GitHub Desktop.
partial void btnTrack_TouchUpInside (UIButton sender)
{
Xamarin.Insights.Track("track-clicked", new Dictionary <string, string> {
{"track-local-time", DateTime.Now.ToString()}
});
UIAlertView alert = new UIAlertView ("Done", "Track registered", null, "OK", null);
alert.Show();
}
partial void btnWarning_TouchUpInside (UIButton sender)
{
var exp = new ApplicationException("This is a warning.");
Xamarin.Insights.Report(exp, new Dictionary <string, string> {
{"warning-local-time", DateTime.Now.ToString()}
}, Xamarin.ReportSeverity.Warning);
UIAlertView alert = new UIAlertView ("Done", "Warning registered", null, "OK", null);
alert.Show();
}
partial void btnCrash_TouchUpInside (UIButton sender)
{
Xamarin.Insights.Report(new ApplicationException("This is a crash."), new Dictionary <string, string> {
{"crash-local-time", DateTime.Now.ToString()}
}, Xamarin.ReportSeverity.Error);
UIAlertView alert = new UIAlertView ("Done", "Crash registered", null, "OK", null);
alert.Show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment