コード例 #1
0
        private static IProtocolProvider InternalGetProvider(string uri)
        {
            Type type = GetProviderType(uri);

            IProtocolProvider provider = CreateFromType(type);

            if (ResolvingProtocolProvider != null)
            {
                ResolvingProtocolProviderEventArgs e = new ResolvingProtocolProviderEventArgs(provider, uri);
                ResolvingProtocolProvider(null, e);
                provider = e.ProtocolProvider;
            }

            return provider;
        }
コード例 #2
0
        private static IProtocolProvider InternalGetProvider(string uri)
        {
            Type type = GetProviderType(uri);

            IProtocolProvider provider = CreateFromType(type);

            if (ResolvingProtocolProvider != null)
            {
                ResolvingProtocolProviderEventArgs e = new ResolvingProtocolProviderEventArgs(provider, uri);
                ResolvingProtocolProvider(null, e);
                provider = e.ProtocolProvider;
            }

            return(provider);
        }
コード例 #3
0
        public static IProtocolProvider CreateProvider(Type providerType, Downloader downloader)
        {
            IProtocolProvider provider = CreateFromType(providerType);

            if (ResolvingProtocolProvider != null)
            {
                ResolvingProtocolProviderEventArgs e = new ResolvingProtocolProviderEventArgs(provider, null);
                ResolvingProtocolProvider(null, e);
                provider = e.ProtocolProvider;
            }

            if (downloader != null)
            {
                provider.Initialize(downloader);
            }

            return provider;
        }
コード例 #4
0
        public static IProtocolProvider CreateProvider(Type providerType, Downloader downloader)
        {
            IProtocolProvider provider = CreateFromType(providerType);

            if (ResolvingProtocolProvider != null)
            {
                ResolvingProtocolProviderEventArgs e = new ResolvingProtocolProviderEventArgs(provider, null);
                ResolvingProtocolProvider(null, e);
                provider = e.ProtocolProvider;
            }

            if (downloader != null)
            {
                provider.Initialize(downloader);
            }

            return(provider);
        }