示例#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);
            }
示例#2
0
            public override bool CrashesShouldProcessErrorReport(MacOSCrashes crashes, MSACErrorReport msReport)
            {
                if (ShouldProcessErrorReport == null)
                {
                    return(true);
                }
                var report = new ErrorReport(msReport);

                return(ShouldProcessErrorReport(report));
            }
示例#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);
     }
 }
示例#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);
     }
 }
示例#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);
 }
示例#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);
        }
示例#7
0
 private static void PlatformUnsetInstance()
 {
     MacOSCrashes.ResetSharedInstance();
 }
示例#8
0
 static Task PlatformSetEnabledAsync(bool enabled)
 {
     MacOSCrashes.SetEnabled(enabled);
     return(Task.FromResult(default(object)));
 }
示例#9
0
 static Task <bool> PlatformIsEnabledAsync()
 {
     return(Task.FromResult(MacOSCrashes.IsEnabled()));
 }