コード例 #1
0
        private static HttpEncoder GetCustomEncoderFromConfig()
        {
            HttpRuntimeSection httpRuntime = RuntimeConfig.GetAppConfig().HttpRuntime;
            Type userBaseType = ConfigUtil.GetType(httpRuntime.EncoderType, "encoderType", httpRuntime);

            ConfigUtil.CheckBaseType(typeof(HttpEncoder), userBaseType, "encoderType", httpRuntime);
            return((HttpEncoder)HttpRuntime.CreatePublicInstance(userBaseType));
        }
コード例 #2
0
        private static RequestValidator GetCustomValidatorFromConfig()
        {
            HttpRuntimeSection httpRuntime = RuntimeConfig.GetAppConfig().HttpRuntime;
            Type userBaseType = ConfigUtil.GetType(httpRuntime.RequestValidationType, "requestValidationType", httpRuntime);

            ConfigUtil.CheckBaseType(typeof(RequestValidator), userBaseType, "requestValidationType", httpRuntime);
            return((RequestValidator)HttpRuntime.CreatePublicInstance(userBaseType));
        }
コード例 #3
0
        private static RequestValidator GetCustomValidatorFromConfig()
        {
            // App since this is static per AppDomain
            RuntimeConfig      config            = RuntimeConfig.GetAppConfig();
            HttpRuntimeSection runtimeSection    = config.HttpRuntime;
            string             validatorTypeName = runtimeSection.RequestValidationType;

            // validate the type
            Type validatorType = ConfigUtil.GetType(validatorTypeName, "requestValidationType", runtimeSection);

            ConfigUtil.CheckBaseType(typeof(RequestValidator) /* expectedBaseType */, validatorType, "requestValidationType", runtimeSection);

            // instantiate
            RequestValidator validator = (RequestValidator)HttpRuntime.CreatePublicInstance(validatorType);

            return(validator);
        }
コード例 #4
0
        private static HttpEncoder GetCustomEncoderFromConfig()
        {
            // App since this is static per AppDomain
            RuntimeConfig      config          = RuntimeConfig.GetAppConfig();
            HttpRuntimeSection runtimeSection  = config.HttpRuntime;
            string             encoderTypeName = runtimeSection.EncoderType;

            // validate the type
            Type encoderType = ConfigUtil.GetType(encoderTypeName, "encoderType", runtimeSection);

            ConfigUtil.CheckBaseType(typeof(HttpEncoder) /* expectedBaseType */, encoderType, "encoderType", runtimeSection);

            // instantiate
            HttpEncoder encoder = (HttpEncoder)HttpRuntime.CreatePublicInstance(encoderType);

            return(encoder);
        }