Exemple #1
0
        internal static void AddPrefix(string prefix, string typeName)
        {
            Type type = Type.GetType(typeName);

            if (type == null)
            {
                throw new ArgumentException(string.Format("Type {0} not found", typeName));
            }
            WebRequest.AddPrefix(prefix, type);
        }
Exemple #2
0
        private static void AddDynamicPrefix(string protocol, string implementor)
        {
            Type type = typeof(WebRequest).Assembly.GetType("System.Net." + implementor);

            if (type == null)
            {
                return;
            }
            WebRequest.AddPrefix(protocol, type);
        }