Esempio n. 1
0
        public virtual void RegisterSupportedLinkTypes()
        {
            LinkType linkType = new WorkItemChangeListLinkType();

            m_supportedLinkTypes.Add(linkType.ReferenceName, linkType);
            ExtractLinkChangeActionsCallback += ((ILinkHandler)linkType).ExtractLinkChangeActions;

            linkType = new WorkItemHyperlinkLinkType();
            m_supportedLinkTypes.Add(linkType.ReferenceName, linkType);
            ExtractLinkChangeActionsCallback += ((ILinkHandler)linkType).ExtractLinkChangeActions;

            linkType = new WorkItemLatestFileLinkType();
            m_supportedLinkTypes.Add(linkType.ReferenceName, linkType);
            ExtractLinkChangeActionsCallback += ((ILinkHandler)linkType).ExtractLinkChangeActions;

            linkType = new WorkItemRelatedLinkType();
            m_supportedLinkTypes.Add(linkType.ReferenceName, linkType);
            ExtractLinkChangeActionsCallback += ((ILinkHandler)linkType).ExtractLinkChangeActions;

            linkType = new WorkItemRevisionFileLinkType();
            m_supportedLinkTypes.Add(linkType.ReferenceName, linkType);
            ExtractLinkChangeActionsCallback += ((ILinkHandler)linkType).ExtractLinkChangeActions;

            foreach (RegisteredLinkType registeredLinkType in m_migrationSource.WorkItemStore.WorkItemStore.RegisteredLinkTypes)
            {
                Debug.Assert(!string.IsNullOrEmpty(registeredLinkType.Name));
                if (!TfsDefaultLinkType(registeredLinkType))
                {
                    linkType = new WorkItemExternalLinkType(registeredLinkType.Name);
                    m_supportedLinkTypes.Add(linkType.ReferenceName, linkType);
                    ExtractLinkChangeActionsCallback += ((ILinkHandler)linkType).ExtractLinkChangeActions;
                }
            }
        }
Esempio n. 2
0
        public override void RegisterSupportedLinkTypes()
        {
            LinkType linkType = new WorkItemChangeListLinkType();

            SupportedLinkTypes.Add(linkType.ReferenceName, linkType);
            ExtractLinkChangeActionsCallback += ((ILinkHandler)linkType).ExtractLinkChangeActions;

            linkType = new WorkItemHyperlinkLinkType();
            SupportedLinkTypes.Add(linkType.ReferenceName, linkType);
            ExtractLinkChangeActionsCallback += ((ILinkHandler)linkType).ExtractLinkChangeActions;

            linkType = new WorkItemLatestFileLinkType();
            SupportedLinkTypes.Add(linkType.ReferenceName, linkType);
            ExtractLinkChangeActionsCallback += ((ILinkHandler)linkType).ExtractLinkChangeActions;

            linkType = new WorkItemRevisionFileLinkType();
            SupportedLinkTypes.Add(linkType.ReferenceName, linkType);
            ExtractLinkChangeActionsCallback += ((ILinkHandler)linkType).ExtractLinkChangeActions;

            linkType = new Tfs2010WorkItemRelatedLinkType();
            SupportedLinkTypes.Add(linkType.ReferenceName, linkType);
            ExtractLinkChangeActionsCallback += ((ILinkHandler)linkType).ExtractLinkChangeActions;

            foreach (RegisteredLinkType registeredLinkType in m_migrationSource.WorkItemStore.WorkItemStore.RegisteredLinkTypes)
            {
                Debug.Assert(!string.IsNullOrEmpty(registeredLinkType.Name));
                if (!TfsDefaultLinkType(registeredLinkType))
                {
                    linkType = new WorkItemExternalLinkType(registeredLinkType.Name);
                    SupportedLinkTypes.Add(linkType.ReferenceName, linkType);
                    ExtractLinkChangeActionsCallback += ((ILinkHandler)linkType).ExtractLinkChangeActions;
                }
            }

            // skipping WorkItemRelatedLinkType, using TFS2010 WorkItemLinkType(s)
            foreach (WorkItemLinkType wiLinkType in m_migrationSource.WorkItemStore.WorkItemStore.WorkItemLinkTypes)
            {
                Debug.Assert(!string.IsNullOrEmpty(wiLinkType.ReferenceName));

                ExtendedLinkProperties extendedLinkProperties = GetExtendedLinkProperties(wiLinkType);

                #region TFS 2010 specific logic
                if (!wiLinkType.ReferenceName.Equals(Tfs2010WorkItemRelatedLinkType.Tfs2010RelatedLinkTypeReferenceName, StringComparison.OrdinalIgnoreCase))
                {
                    // for backward compatibility, v1 'Related' Work Item Link Type has a special reference name
                    #endregion

                    linkType = new WorkItemLinkTypeBase(wiLinkType.ReferenceName,
                                                        wiLinkType.ReferenceName,
                                                        extendedLinkProperties,
                                                        m_migrationSource.WorkItemStore.WorkItemStore);

                    SupportedLinkTypes.Add(linkType.ReferenceName, linkType);
                    ExtractLinkChangeActionsCallback += ((ILinkHandler)linkType).ExtractLinkChangeActions;
                }
            }
        }
Esempio n. 3
0
        private int?ExtractFileLinkInfoExtId(WorkItem workItem, string uri)
        {
            ReadOnlyCollection <ExternalLink> myLinks = ExtractMyLinks(workItem);

            foreach (ExternalLink link in myLinks)
            {
                if (TFStringComparer.ArtiFactUrl.Equals(link.LinkedArtifactUri, uri))
                {
                    return(WorkItemExternalLinkType.ReflectFileLinkInfoExtId(link));
                }
            }

            return(null);
        }
Esempio n. 4
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);
        }