예제 #1
0
        public ILink Map(Tfs.Link link)
        {
            if (link.BaseType == Tfs.BaseLinkType.RelatedLink)
            {
                var relatedLink = (Tfs.RelatedLink)link;
                return(ExceptionHandlingDynamicProxyFactory.Create <IRelatedLink>(new RelatedLinkProxy(relatedLink)));
            }
            if (link.BaseType == Tfs.BaseLinkType.Hyperlink)
            {
                var hyperlink = (Tfs.Hyperlink)link;
                return(ExceptionHandlingDynamicProxyFactory.Create <IHyperlink>(new HyperlinkProxy(hyperlink)));
            }

            throw new ArgumentException("Unknown link type", nameof(link));
        }
예제 #2
0
파일: LinkMapper.cs 프로젝트: xul8tr/Qwiq
        internal ILink Map(Tfs.Link link)
        {
            switch (link.BaseType)
            {
            case Tfs.BaseLinkType.RelatedLink:
                var relatedLink = (Tfs.RelatedLink)link;
                return(ExceptionHandlingDynamicProxyFactory.Create <IRelatedLink>(new RelatedLink(relatedLink)));

            case Tfs.BaseLinkType.Hyperlink:
                var hyperlink = (Tfs.Hyperlink)link;
                return(ExceptionHandlingDynamicProxyFactory.Create <IHyperlink>(new Hyperlink(hyperlink)));

            case Tfs.BaseLinkType.ExternalLink:
                var externalLink = (Tfs.ExternalLink)link;
                return(ExceptionHandlingDynamicProxyFactory.Create <IExternalLink>(new ExternalLink(externalLink)));

            default:
                throw new ArgumentException("Unknown link type", nameof(link));
            }
        }
예제 #3
0
 internal Link(Tfs.Link link)
     : base(link.Comment, (BaseLinkType)link.BaseType)
 {
 }
예제 #4
0
 internal LinkProxy(Tfs.Link link)
 {
     _link = link;
 }