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)); }
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)); } }
internal Link(Tfs.Link link) : base(link.Comment, (BaseLinkType)link.BaseType) { }
internal LinkProxy(Tfs.Link link) { _link = link; }