Ejemplo n.º 1
0
        public void ExtractLinkChangeActions(TfsMigrationWorkItem source, List <LinkChangeGroup> linkChangeGroups, WorkItemLinkStore store)
        {
            if (null == source)
            {
                throw new ArgumentNullException("source");
            }

            if (null == source.WorkItem)
            {
                throw new ArgumentException("source.WorkItem is null");
            }

            var linkChangeGroup = new LinkChangeGroup(
                source.WorkItem.Id.ToString(CultureInfo.InvariantCulture), LinkChangeGroup.LinkChangeGroupStatus.Created, false);

            ReadOnlyCollection <Hyperlink> myLinks = ExtractMyLinks(source.WorkItem);

            foreach (var hl in myLinks)
            {
                var link = new Toolkit.Linking.ArtifactLink(
                    source.WorkItem.Id.ToString(CultureInfo.InvariantCulture),
                    new Toolkit.Linking.Artifact(source.Uri, s_sourceArtifactType),
                    new Toolkit.Linking.Artifact(TfsHyperlinkHandler.UriFromId(hl.Location), s_targetArtifactType),
                    hl.Comment,
                    this);
                linkChangeGroup.AddChangeAction(new LinkChangeAction(WellKnownChangeActionId.Add, link,
                                                                     LinkChangeAction.LinkChangeActionStatus.Created,
                                                                     false));
            }

            linkChangeGroups.Add(linkChangeGroup);
        }
Ejemplo n.º 2
0
        private int?ExtractFileLinkInfoExtId(WorkItem workItem, string uri)
        {
            ReadOnlyCollection <Hyperlink> myLinks = ExtractMyLinks(workItem);

            foreach (Hyperlink link in myLinks)
            {
                if (TFStringComparer.ArtiFactUrl.Equals(TfsHyperlinkHandler.UriFromId(link.Location), uri))
                {
                    return(WorkItemExternalLinkType.ReflectFileLinkInfoExtId(link));
                }
            }

            return(null);
        }