Beispiel #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;
                }
            }
        }
Beispiel #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;
                }
            }
        }