Exemple #1
0
        public override string TranslateConflictDetailsToReadableDescription(string dtls)
        {
            try
            {
                ConflictDetailsProperties properties = ConflictDetailsProperties.Deserialize(dtls);
                CyclicLinkConflictDetails details    = new CyclicLinkConflictDetails(properties);

                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.AppendLine(string.Format(TfsWITAdapterResources.CyclicalLinkError, details.SourceWorkItemID, details.TargetWorkItemID, details.LinkTypeReferenceName));
                if (details.LinkReferenceClosure.Count > 0)
                {
                    stringBuilder.AppendLine();
                    stringBuilder.AppendLine(TfsWITAdapterResources.LinkClosureHeader);
                    stringBuilder.AppendLine("SOURCE\tTARGET");
                    foreach (LinkDescription link in details.LinkReferenceClosure)
                    {
                        stringBuilder.AppendLine(string.Format("{0}\t{1}", link.SourceWorkItemId, link.TargetWorkItemId));
                    }
                }
                return(stringBuilder.ToString());
            }
            catch (Exception)
            {
                return(dtls);
            }
        }
Exemple #2
0
        internal static string CreateConflictDetails(
            string sourceItem,
            string targetItem,
            string linkType,
            NonCyclicReferenceClosure linkReferenceClosure)
        {
            CyclicLinkConflictDetails dtls =
                new CyclicLinkConflictDetails(sourceItem, targetItem, linkType, linkReferenceClosure);

            return(dtls.Properties.ToString());
        }
Exemple #3
0
        private static string CreateConflictDetails(
            Exception linkSubmissionException,
            LinkChangeAction action,
            NonCyclicReferenceClosure linkReferenceClosure)
        {
            string sourceItem;
            string targetItem;
            string linkType;

            ParseException(linkSubmissionException, action, out sourceItem, out targetItem, out linkType);

            return(CyclicLinkConflictDetails.CreateConflictDetails(sourceItem, targetItem, linkType, linkReferenceClosure));
        }