Beispiel #1
0
            public override NSArray AttachmentsWithCrashes(MacOSCrashes crashes, MSACErrorReport msReport)
            {
                if (GetErrorAttachments == null)
                {
                    return(null);
                }
                var report      = new ErrorReport(msReport);
                var attachments = GetErrorAttachments(report);

                if (attachments != null)
                {
                    var nsArray = new NSMutableArray();
                    foreach (var attachment in attachments)
                    {
                        if (attachment != null)
                        {
                            nsArray.Add(attachment.internalAttachment);
                        }
                        else
                        {
                            AppCenterLog.Warn(LogTag, "Skipping null ErrorAttachmentLog in Crashes.GetErrorAttachments.");
                        }
                    }
                    return(nsArray);
                }
                return(null);
            }
Beispiel #2
0
            public override bool CrashesShouldProcessErrorReport(MacOSCrashes crashes, MSACErrorReport msReport)
            {
                if (ShouldProcessErrorReport == null)
                {
                    return(true);
                }
                var report = new ErrorReport(msReport);

                return(ShouldProcessErrorReport(report));
            }
Beispiel #3
0
 public override void CrashesDidSucceedSendingErrorReport(MacOSCrashes crashes, MSACErrorReport msReport)
 {
     if (SentErrorReport != null)
     {
         var report = new ErrorReport(msReport);
         var e      = new SentErrorReportEventArgs
         {
             Report = report
         };
         SentErrorReport(null, e);
     }
 }
Beispiel #4
0
 public override void CrashesDidFailSendingErrorReport(MacOSCrashes crashes, MSACErrorReport msReport, NSError error)
 {
     if (FailedToSendErrorReport != null)
     {
         var report = new ErrorReport(msReport);
         var e      = new FailedToSendErrorReportEventArgs
         {
             Report    = report,
             Exception = error
         };
         FailedToSendErrorReport(null, e);
     }
 }
Beispiel #5
0
 static Crashes()
 {
     /* Perform custom setup around the native SDK's for setting signal handlers */
     MacOSCrashes.DisableMachExceptionHandler();
     MSACWrapperCrashesHelper.SetCrashHandlerSetupDelegate(_crashesInitializationDelegate);
     AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
     MacOSCrashes.SetUserConfirmationHandler((reports) =>
     {
         if (ShouldAwaitUserConfirmation != null)
         {
             return(ShouldAwaitUserConfirmation());
         }
         return(false);
     });
     MacOSCrashes.SetDelegate(_crashesDelegate);
 }
Beispiel #6
0
        static void PlatformNotifyUserConfirmation(UserConfirmation confirmation)
        {
            MSACUserConfirmation macosUserConfirmation;

            switch (confirmation)
            {
            case UserConfirmation.Send:
                macosUserConfirmation = MSACUserConfirmation.Send;
                break;

            case UserConfirmation.DontSend:
                macosUserConfirmation = MSACUserConfirmation.DontSend;
                break;

            case UserConfirmation.AlwaysSend:
                macosUserConfirmation = MSACUserConfirmation.Always;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(confirmation), confirmation, null);
            }
            MacOSCrashes.NotifyWithUserConfirmation(macosUserConfirmation);
        }
Beispiel #7
0
 private static void PlatformUnsetInstance()
 {
     MacOSCrashes.ResetSharedInstance();
 }
Beispiel #8
0
 static Task PlatformSetEnabledAsync(bool enabled)
 {
     MacOSCrashes.SetEnabled(enabled);
     return(Task.FromResult(default(object)));
 }
Beispiel #9
0
 static Task <bool> PlatformIsEnabledAsync()
 {
     return(Task.FromResult(MacOSCrashes.IsEnabled()));
 }