Beispiel #1
0
 public static bool TryGetWikipediaServiceUri(Uri uri, out Uri wikipediaServiceUri)
 {
     wikipediaServiceUri = null;
     if (WikipediaLinkPreviewBuilder.IsWikipediaUri(uri))
     {
         string wikipediaServiceUrl = WikipediaLinkPreviewBuilder.GetWikipediaServiceUrl(uri);
         if (wikipediaServiceUrl != null)
         {
             wikipediaServiceUri = new Uri(wikipediaServiceUrl);
         }
     }
     return(wikipediaServiceUri != null);
 }
        public static LinkPreviewDataProvider GetDataProvider(GetLinkPreviewRequest request, RequestDetailsLogger logger, bool activeViewsConvergenceEnabled)
        {
            Uri uri = LinkPreviewDataProvider.CreateUri(request.Url);
            LinkPreviewDataProvider result;
            Uri uri2;

            if (activeViewsConvergenceEnabled && OEmbedVideoPreviewBuilder.IsOEmbedVideoUri(uri, logger))
            {
                result = new OEmbedDataProvider(uri, request, logger);
            }
            else if (WikipediaLinkPreviewBuilder.TryGetWikipediaServiceUri(uri, out uri2))
            {
                result = new WikipediaDataProvider(uri2, request, logger);
            }
            else
            {
                result = new WebPageDataProvider(uri, request, logger);
            }
            return(result);
        }
Beispiel #3
0
        // Token: 0x06001955 RID: 6485 RVA: 0x00058434 File Offset: 0x00056634
        public override GetLinkPreviewResponse CreatePreview(DataProviderInformation dataProviderInformation)
        {
            LinkPreviewBuilder linkPreviewBuilder = new WikipediaLinkPreviewBuilder(this.request, ((WebPageInformation)dataProviderInformation).Text, this.logger, dataProviderInformation.ResponseUri);

            return(linkPreviewBuilder.Execute());
        }