Ejemplo n.º 1
0
        public override async Task <Tuple <bool, INuGetResource> > TryCreate(SourceRepository source, CancellationToken token)
        {
            MetadataResourceV3 curResource = null;
            var regResource = await source.GetResourceAsync <RegistrationResourceV3>(token);

            if (regResource != null)
            {
                var httpSourceResource = await source.GetResourceAsync <HttpSourceResource>(token);

                curResource = new MetadataResourceV3(httpSourceResource.HttpSource, regResource);
            }

            return(new Tuple <bool, INuGetResource>(curResource != null, curResource));
        }
        public override async Task<Tuple<bool, INuGetResource>> TryCreate(SourceRepository source, CancellationToken token)
        {
            MetadataResourceV3 curResource = null;
            RegistrationResourceV3 regResource = await source.GetResourceAsync<RegistrationResourceV3>(token);

            if (regResource != null)
            {
                var messageHandlerResource = await source.GetResourceAsync<HttpHandlerResource>(token);
                DataClient client = new DataClient(messageHandlerResource.MessageHandler);

                curResource = new MetadataResourceV3(client, regResource);
            }

            return new Tuple<bool, INuGetResource>(curResource != null, curResource);
        }
Ejemplo n.º 3
0
        public override async Task <Tuple <bool, INuGetResource> > TryCreate(SourceRepository source, CancellationToken token)
        {
            MetadataResourceV3     curResource = null;
            RegistrationResourceV3 regResource = await source.GetResourceAsync <RegistrationResourceV3>(token);

            if (regResource != null)
            {
                var messageHandlerResource = await source.GetResourceAsync <HttpHandlerResource>(token);

                DataClient client = new DataClient(messageHandlerResource.MessageHandler);

                curResource = new MetadataResourceV3(client, regResource);
            }

            return(new Tuple <bool, INuGetResource>(curResource != null, curResource));
        }