Esempio n. 1
0
        public static string CreateConflictDetails(
            Project teamProject,
            string workItemType)
        {
            WorkItemTypeNotExistConflictTypeDetails dtls =
                new WorkItemTypeNotExistConflictTypeDetails(teamProject, workItemType);

            return(dtls.Properties.ToString());
        }
Esempio n. 2
0
        public override string TranslateConflictDetailsToReadableDescription(string dtls)
        {
            if (string.IsNullOrEmpty(dtls))
            {
                throw new ArgumentNullException("dtls");
            }

            WorkItemTypeNotExistConflictTypeDetails details = null;

            try
            {
                ConflictDetailsProperties properties = ConflictDetailsProperties.Deserialize(dtls);
                details = new WorkItemTypeNotExistConflictTypeDetails(properties);
            }
            catch (Exception)
            {
                try
                {
                    GenericSerializer <WorkItemTypeNotExistConflictTypeDetails> serializer =
                        new GenericSerializer <WorkItemTypeNotExistConflictTypeDetails>();
                    details = serializer.Deserialize(dtls);
                }
                catch (Exception)
                {
                    // do nothing, fall back to raw string later
                }
            }

            if (null != details)
            {
                return(string.Format(
                           "Work Item Type {0} is not defined for team project '{1}' on server '{2}'.",
                           details.MissingWorkItemType,
                           details.TeamProject,
                           details.TeamFoundationServer));
            }
            else
            {
                return(dtls);
            }
        }