コード例 #1
0
        private void SendFullReport(bool includeScreenshot,
                                    DrDumpService.SendRequestCompletedEventHandler sendRequestCompleted, Control form, string from,
                                    string userMessage)
        {
            var sendScreenshot = File.Exists(ScreenShot) && includeScreenshot;
            var screenshot     = sendScreenshot ? File.ReadAllBytes(ScreenShot) : null;

            if (sendRequestCompleted != null)
            {
                if (_doctorDumpService == null)
                {
                    SendAnonymousReport(sendRequestCompleted);
                }

                if (_doctorDumpService == null)
                {
                    throw new SocketException();
                }

                _doctorDumpService.SendAdditionalDataAsync(form, DeveloperMessage, from,
                                                           userMessage, screenshot);
            }
            else
            {
                _doctorDumpService = new DrDumpService(WebProxy);
                var reportUrl = _doctorDumpService.SendReportSilently(Exception, ToEmail, DoctorDumpSettings?.ApplicationID, DeveloperMessage, from, userMessage, screenshot);
                if (DoctorDumpSettings != null && DoctorDumpSettings.OpenReportInBrowser)
                {
                    if (!string.IsNullOrEmpty(reportUrl))
                    {
                        Process.Start(reportUrl);
                    }
                }
            }
        }
コード例 #2
0
        internal void SendReport(bool includeScreenshot,
                                 DrDumpService.SendRequestCompletedEventHandler sendRequestCompleted = null,
                                 SendCompletedEventHandler smtpClientSendCompleted = null, Control form = null, string from = "",
                                 string userMessage = "")
        {
            string subject = String.Empty;

            if (string.IsNullOrEmpty(from))
            {
                from = !string.IsNullOrEmpty(FromEmail)
                    ? FromEmail
                    : null;
            }
            else
            {
                subject = $"{ApplicationTitle} {ApplicationVersion} Crash Report by {from}";
            }

            if (AnalyzeWithDoctorDump)
            {
                SendFullReport(includeScreenshot, sendRequestCompleted, form, from, userMessage);
            }
            else
            {
                SendEmail(includeScreenshot, smtpClientSendCompleted, from, subject, userMessage);
            }
        }
コード例 #3
0
        internal void SendAnonymousReport(DrDumpService.SendRequestCompletedEventHandler sendRequestCompleted)
        {
            _doctorDumpService = new DrDumpService(WebProxy);

            _doctorDumpService.SendRequestCompleted += sendRequestCompleted;

            _doctorDumpService.SendAnonymousReportAsync(
                Exception,
                ToEmail,
                DoctorDumpSettings?.ApplicationID);
        }
コード例 #4
0
        private void SendFullReport(bool includeScreenshot,
                                    DrDumpService.SendRequestCompletedEventHandler sendRequestCompleted, Control form, string from,
                                    string userMessage)
        {
            var sendScreenshot = File.Exists(ScreenShot) && includeScreenshot;
            var screenshot     = sendScreenshot ? File.ReadAllBytes(ScreenShot) : null;

            if (_doctorDumpService == null)
            {
                SendAnonymousReport(sendRequestCompleted);
            }

            _doctorDumpService.SendAdditionalDataAsync(form, DeveloperMessage, from,
                                                       userMessage, screenshot);
        }