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;
        }
        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);
        }
        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;
        }
 private void ProtocolProviderFactory_ResolvingProtocolProvider(object sender, ResolvingProtocolProviderEventArgs e)
 {
     e.ProtocolProvider = new ProtocolProviderProxy(e.ProtocolProvider, this);
 }