예제 #1
0
 private static string FormatConflict([NotNull] ExceptionAttributeConflict conflict,
                                      [NotNull] IIssueTableFields fields)
 {
     return(string.Format("{0} ({1} [{2}])",
                          fields.GetName(conflict.Attribute),
                          FormatConflictValue(conflict),
                          conflict.CurrentValueOrigin));
 }
예제 #2
0
        private static string FormatConflictValue([NotNull] ExceptionAttributeConflict conflict)
        {
            string text = conflict.CurrentValue?.ToString();

            if (text == null)
            {
                return("<null>");
            }

            const int    maxLength = 60;
            const string ellipsis  = "...";

            if (text.Length <= maxLength)
            {
                return(text);
            }

            return(text.Substring(0, maxLength - ellipsis.Length) + ellipsis);
        }