/// <summary>
        /// File an issue. Telemetry wrapper.
        /// </summary>
        /// <param name="issueInformation">Issue infromation to pass on to the reporter</param>
        /// <returns></returns>
        public static IIssueResult FileIssueAsync(IssueInformation issueInformation)
        {
            if (!IssueReporter.IsEnabled)
            {
                return(null);
            }

            try
            {
                IIssueResult issueResult    = IssueReporter.FileIssueAsync(issueInformation);
                var          telemetryEvent = TelemetryEventFactory.ForIssueFilingCompleted(issueResult, issueInformation);
                Logger.PublishTelemetryEvent(telemetryEvent);
                return(issueResult);
            }
            catch (Exception e)
            {
                e.ReportException();
                return(null);
            }
        }
        /// <summary>
        /// File an issue. Telemetry wrapper.
        /// </summary>
        /// <param name="issueInformation">Issue infromation to pass on to the reporter</param>
        /// <returns></returns>
        public static IIssueResult FileIssueAsync(IssueInformation issueInformation)
        {
            if (!IssueReporter.IsEnabled)
            {
                return(null);
            }

            try
            {
                IIssueResult issueResult    = IssueReporter.FileIssueAsync(issueInformation);
                var          telemetryEvent = TelemetryEventFactory.ForIssueFilingCompleted(issueResult, issueInformation);
                Logger.PublishTelemetryEvent(telemetryEvent);
                return(issueResult);
            }
#pragma warning disable CA1031 // Do not catch general exception types
            catch (Exception e)
            {
                e.ReportException();
                return(null);
            }
#pragma warning restore CA1031 // Do not catch general exception types
        }
示例#3
0
        /// <summary>
        /// File an issue. Telemetry wrapper.
        /// </summary>
        /// <param name="issueInformation">Issue infromation to pass on to the reporter</param>
        /// <returns></returns>
        public static IIssueResult FileIssueAsync(IssueInformation issueInformation)
        {
            if (!IssueReporter.IsEnabled)
            {
                return(null);
            }

            try
            {
                IIssueResult issueResult = IssueReporter.FileIssueAsync(issueInformation);

                if (issueResult.IssueLink != null)
                {
                    if (issueInformation.RuleForTelemetry != null)
                    {
                        Logger.PublishTelemetryEvent(TelemetryAction.Issue_Save, new Dictionary <TelemetryProperty, string>
                        {
                            { TelemetryProperty.RuleId, issueInformation.RuleForTelemetry },
                            { TelemetryProperty.UIFramework, issueInformation.UIFramework ?? string.Empty },
                        });
                    }
                    else // if the bug is coming from the hierarchy tree, it will not have ruleID or UIFramework
                    {
                        Logger.PublishTelemetryEvent(TelemetryAction.Issue_Save);
                    }
                }
                else
                {
                    Logger.PublishTelemetryEvent(TelemetryAction.Issue_File_Attempt);
                }
                return(issueResult);
            }
            catch
            {
                return(null);
            }
        }