Esempio n. 1
0
        /// <summary>
        /// This is the method to write and issue into the report. This takes the parameters in the issue node
        /// </summary>
        /// <param name="id">Issue Id</param>
        /// <param name="type">Issue Type</param>
        /// <param name="details">Actual Isssue Message</param>
        /// <param name="itemName">Issue Item</param>
        /// <param name="location">Issue Location</param>
        /// <param name="group">Issue Group/Category</param>
        /// <param name="additionalInfos">Other Additional Info</param>
        virtual public void WriteIssue(string id,
                                       string details,
                                       string itemName,
                                       string location,
                                       string group,
                                       ReportIssueType type,
                                       params string[] additionalInfoList
                                       )
        {
            //What will happen if id/message/type is null?
            ReportIssue issue = new ReportIssue();

            issue.IssueID = id;
            issue.Type    = type;
            issue.Message = details;
            issue.Group   = group;
            if (additionalInfoList != null && additionalInfoList.Length > 0)
            {
                issue.AdditionalInfos = additionalInfoList;
            }

            issue.Item     = itemName;
            issue.Location = location;
            // Increment the corresponding counter
            switch (type)
            {
            // If this issue is an critical error, set the flag
            // as there can be only one Critical Error
            case ReportIssueType.Critical:
                // debug check to see that this should'nt occur more than once
                Debug.Assert(statisticsField.HasCriticalError == false, "Trying to add more than one critical error");
                statisticsField.HasCriticalError = true;
                m_criticalError = issue.Message;
                break;

            // If this issue is an error, increment the numberoferrors
            case ReportIssueType.Error:
                statisticsField.NumberOfErrors++;
                break;

            // if this issue is a warning, increment the numberofwarnings
            case ReportIssueType.Warning:
                statisticsField.NumberOfWarnings++;
                break;
            }

            AddIssue(issue);
        }
Esempio n. 2
0
        internal static void WriteIssue(string fromEntity,
                                        string toEntity,
                                        ReportStatisticsStatisicsDetails.MigrationStatus status,
                                        ReportIssueType type,
                                        string id,
                                        string item,
                                        IssueGroup group,
                                        string msg)
        {
            Debug.Assert(ConverterMain.MigrationReport != null);

            // also add in per work item section only if it is work item issue
            if (group == IssueGroup.Wi)
            {
                ConverterMain.MigrationReport.Statistics.StatisicsDetails.AddToEntityStatistics(fromEntity, toEntity, status);
            }

            // add the error in migration report
            if (type != ReportIssueType.Info)
            {
                ConverterMain.MigrationReport.WriteIssue(id, msg, item, null, group.ToString(), type, null);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// This is the method to write and issue into the report. This takes the parameters in the issue node
 /// </summary>
 /// <param name="id"></param>
 /// <param name="type"></param>
 /// <param name="details"></param>
 /// <param name="itemName"></param>
 /// <param name="location"></param>
 /// <param name="additionalInfos"></param>
 virtual public void WriteIssue(string id, ReportIssueType type, string details, string itemName, string location, params string[] additionalInfoList)
 {
     WriteIssue(id, details, itemName, location, null, type, additionalInfoList);
 }
Esempio n. 4
0
 /// <summary>
 /// This method takes issueid, type, message and the itemname as input.
 /// </summary>
 /// <param name="id"></param>
 /// <param name="type"></param>
 /// <param name="message"></param>
 /// <param name="item"></param>
 virtual public void WriteIssue(string id, ReportIssueType type, string message, string item)
 {
     WriteIssue(id, type, message, item, null);
 }