static SessionStateSection()
        {
            allowCustomSqlDatabaseProp = new ConfigurationProperty("allowCustomSqlDatabase", typeof(bool), false);
            cookielessProp             = new ConfigurationProperty("cookieless", typeof(string), null);
            cookieNameProp             = new ConfigurationProperty("cookieName", typeof(string), "ASP.NET_SessionId");
            customProviderProp         = new ConfigurationProperty("customProvider", typeof(string), "");
            modeProp = new ConfigurationProperty("mode", typeof(SessionStateMode), SessionStateMode.InProc,
                                                 new GenericEnumConverter(typeof(SessionStateMode)), null,
                                                 ConfigurationPropertyOptions.None);
            partitionResolverTypeProp = new ConfigurationProperty("partitionResolverType", typeof(string), "");
            providersProp             = new ConfigurationProperty("providers", typeof(ProviderSettingsCollection), null,
                                                                  null, null, ConfigurationPropertyOptions.None);
            regenerateExpiredSessionIdProp = new ConfigurationProperty("regenerateExpiredSessionId", typeof(bool), true);
            sessionIDManagerTypeProp       = new ConfigurationProperty("sessionIDManagerType", typeof(string), "");
            sqlCommandTimeoutProp          = new ConfigurationProperty("sqlCommandTimeout", typeof(TimeSpan), TimeSpan.FromSeconds(30),
                                                                       PropertyHelper.TimeSpanSecondsOrInfiniteConverter, null,
                                                                       ConfigurationPropertyOptions.None);
            sqlConnectionStringProp   = new ConfigurationProperty("sqlConnectionString", typeof(string), DefaultSqlConnectionString);
            stateConnectionStringProp = new ConfigurationProperty("stateConnectionString", typeof(string), "tcpip=loopback:42424");
            stateNetworkTimeoutProp   = new ConfigurationProperty("stateNetworkTimeout", typeof(TimeSpan), TimeSpan.FromSeconds(10),
                                                                  PropertyHelper.TimeSpanSecondsOrInfiniteConverter,
                                                                  PropertyHelper.PositiveTimeSpanValidator,
                                                                  ConfigurationPropertyOptions.None);
            timeoutProp = new ConfigurationProperty("timeout", typeof(TimeSpan), TimeSpan.FromMinutes(20),
                                                    PropertyHelper.TimeSpanMinutesOrInfiniteConverter,
                                                    new TimeSpanValidator(new TimeSpan(0, 1, 0), TimeSpan.MaxValue),
                                                    ConfigurationPropertyOptions.None);
            useHostingIdentityProp = new ConfigurationProperty("useHostingIdentity", typeof(bool), true);

#if NET_4_0
            compressionEnabledProp         = new ConfigurationProperty("compressionEnabled", typeof(bool), false);
            sqlConnectionRetryIntervalProp = new ConfigurationProperty("sqlConnectionRetryIntervalProp", typeof(TimeSpan), TimeSpan.FromSeconds(0),
                                                                       PropertyHelper.TimeSpanSecondsOrInfiniteConverter,
                                                                       PropertyHelper.PositiveTimeSpanValidator,
                                                                       ConfigurationPropertyOptions.None);
#endif
            properties = new ConfigurationPropertyCollection();

            properties.Add(allowCustomSqlDatabaseProp);
            properties.Add(cookielessProp);
            properties.Add(cookieNameProp);
            properties.Add(customProviderProp);
            properties.Add(modeProp);
            properties.Add(partitionResolverTypeProp);
            properties.Add(providersProp);
            properties.Add(regenerateExpiredSessionIdProp);
            properties.Add(sessionIDManagerTypeProp);
            properties.Add(sqlCommandTimeoutProp);
            properties.Add(sqlConnectionStringProp);
            properties.Add(stateConnectionStringProp);
            properties.Add(stateNetworkTimeoutProp);
            properties.Add(timeoutProp);
            properties.Add(useHostingIdentityProp);
#if NET_4_0
            properties.Add(compressionEnabledProp);
            properties.Add(sqlConnectionRetryIntervalProp);
#endif

            elementProperty = new ConfigurationElementProperty(new CallbackValidator(typeof(SessionStateSection), ValidateElement));
        }
Ejemplo n.º 2
0
    public void DumpElementProperties()
    {
        foreach (object o in things)
        {
            Type         type  = o.GetType();
            PropertyInfo pinfo = type.GetProperty("ElementProperty", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);

            if (pinfo == null)
            {
                continue;
            }

            ConfigurationElementProperty p = (ConfigurationElementProperty)pinfo.GetValue(o, null);
            if (p == null)
            {
                Console.WriteLine("{0}.ElementProperty = null", type);
            }
            else if (p.Validator == null)
            {
                Console.WriteLine("{0}.ElementProperty (Validator) = null", type);
            }
            else
            {
                Console.WriteLine("{0}.ElementProperty (Validator) = {1} ({2})", type, p.Validator, p.Validator.CanValidate(type));
            }
        }
    }
        static PassportAuthentication()
        {
            redirectUrlProp = new ConfigurationProperty("redirectUrl", typeof(string), "internal");
            properties      = new ConfigurationPropertyCollection();

            properties.Add(redirectUrlProp);

            elementProperty = new ConfigurationElementProperty(new CallbackValidator(typeof(PassportAuthentication), ValidateElement));
        }
Ejemplo n.º 4
0
        static FormsAuthenticationConfiguration()
        {
            cookielessProp = new ConfigurationProperty("cookieless", typeof(HttpCookieMode), HttpCookieMode.UseDeviceProfile,
                                                       new GenericEnumConverter(typeof(HttpCookieMode)), PropertyHelper.DefaultValidator,
                                                       ConfigurationPropertyOptions.None);
            credentialsProp = new ConfigurationProperty("credentials", typeof(FormsAuthenticationCredentials), null,
                                                        null, PropertyHelper.DefaultValidator,
                                                        ConfigurationPropertyOptions.None);
            defaultUrlProp = new ConfigurationProperty("defaultUrl", typeof(string), "default.aspx",
                                                       TypeDescriptor.GetConverter(typeof(string)),
                                                       PropertyHelper.NonEmptyStringValidator,
                                                       ConfigurationPropertyOptions.None);
            domainProp = new ConfigurationProperty("domain", typeof(string), "");
            enableCrossAppRedirectsProp = new ConfigurationProperty("enableCrossAppRedirects", typeof(bool), false);
            loginUrlProp = new ConfigurationProperty("loginUrl", typeof(string), "login.aspx",
                                                     TypeDescriptor.GetConverter(typeof(string)),
                                                     PropertyHelper.NonEmptyStringValidator,
                                                     ConfigurationPropertyOptions.None);
            nameProp = new ConfigurationProperty("name", typeof(string), ".ASPXAUTH",
                                                 TypeDescriptor.GetConverter(typeof(string)),
                                                 PropertyHelper.NonEmptyStringValidator,
                                                 ConfigurationPropertyOptions.None);
            pathProp = new ConfigurationProperty("path", typeof(string), "/",
                                                 TypeDescriptor.GetConverter(typeof(string)),
                                                 PropertyHelper.NonEmptyStringValidator,
                                                 ConfigurationPropertyOptions.None);
            protectionProp = new ConfigurationProperty("protection", typeof(FormsProtectionEnum), FormsProtectionEnum.All,
                                                       new GenericEnumConverter(typeof(FormsProtectionEnum)),
                                                       PropertyHelper.DefaultValidator,
                                                       ConfigurationPropertyOptions.None);
            requireSSLProp        = new ConfigurationProperty("requireSSL", typeof(bool), false);
            slidingExpirationProp = new ConfigurationProperty("slidingExpiration", typeof(bool), true);
            timeoutProp           = new ConfigurationProperty("timeout", typeof(TimeSpan), TimeSpan.FromMinutes(30),
                                                              PropertyHelper.TimeSpanMinutesConverter,
                                                              new TimeSpanValidator(new TimeSpan(0, 1, 0), TimeSpan.MaxValue),
                                                              ConfigurationPropertyOptions.None);

            properties = new ConfigurationPropertyCollection();
            properties.Add(cookielessProp);
            properties.Add(credentialsProp);
            properties.Add(defaultUrlProp);
            properties.Add(domainProp);
            properties.Add(enableCrossAppRedirectsProp);
            properties.Add(loginUrlProp);
            properties.Add(nameProp);
            properties.Add(pathProp);
            properties.Add(protectionProp);
            properties.Add(requireSSLProp);
            properties.Add(slidingExpirationProp);
            properties.Add(timeoutProp);

            elementProperty = new ConfigurationElementProperty(new CallbackValidator(typeof(FormsAuthenticationConfiguration), ValidateElement));
        }
Ejemplo n.º 5
0
        static HttpModuleAction()
        {
            nameProp = new ConfigurationProperty("name", typeof(string), null,
                                                 TypeDescriptor.GetConverter(typeof(string)),
                                                 PropertyHelper.NonEmptyStringValidator,
                                                 ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
            typeProp   = new ConfigurationProperty("type", typeof(string), "hoho", ConfigurationPropertyOptions.IsRequired);
            properties = new ConfigurationPropertyCollection();
            properties.Add(nameProp);
            properties.Add(typeProp);

            elementProperty = new ConfigurationElementProperty(new CallbackValidator(typeof(HttpModuleAction), ValidateElement));
        }
        static SqlCacheDependencySection()
        {
            databasesProp = new ConfigurationProperty("databases", typeof(SqlCacheDependencyDatabaseCollection), null,
                                                      null, null, ConfigurationPropertyOptions.None);
            enabledProp  = new ConfigurationProperty("enabled", typeof(bool), true);
            pollTimeProp = new ConfigurationProperty("pollTime", typeof(int), 60000);
            properties   = new ConfigurationPropertyCollection();

            properties.Add(databasesProp);
            properties.Add(enabledProp);
            properties.Add(pollTimeProp);

            elementProperty = new ConfigurationElementProperty(new CallbackValidator(typeof(SqlCacheDependencySection), ValidateElement));
        }
Ejemplo n.º 7
0
        static SqlCacheDependencyDatabase()
        {
            connectionStringNameProp = new ConfigurationProperty("connectionStringName", typeof(string), null,
                                                                 TypeDescriptor.GetConverter(typeof(string)),
                                                                 PropertyHelper.NonEmptyStringValidator,
                                                                 ConfigurationPropertyOptions.IsRequired);
            nameProp = new ConfigurationProperty("name", typeof(string), null,
                                                 TypeDescriptor.GetConverter(typeof(string)),
                                                 PropertyHelper.NonEmptyStringValidator,
                                                 ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
            pollTimeProp = new ConfigurationProperty("pollTime", typeof(int), 60000);
            properties   = new ConfigurationPropertyCollection();

            properties.Add(connectionStringNameProp);
            properties.Add(nameProp);
            properties.Add(pollTimeProp);

            elementProperty = new ConfigurationElementProperty(new CallbackValidator(typeof(SqlCacheDependencyDatabase), ValidateElement));
        }
Ejemplo n.º 8
0
        static TagPrefixInfo()
        {
            tagPrefixProp = new ConfigurationProperty("tagPrefix", typeof(string), "/",
                                                      TypeDescriptor.GetConverter(typeof(string)),
                                                      PropertyHelper.NonEmptyStringValidator,
                                                      ConfigurationPropertyOptions.IsRequired);
            namespaceProp = new ConfigurationProperty("namespace", typeof(string));
            assemblyProp  = new ConfigurationProperty("assembly", typeof(string));
            tagNameProp   = new ConfigurationProperty("tagName", typeof(string));
            sourceProp    = new ConfigurationProperty("src", typeof(string));

            properties = new ConfigurationPropertyCollection();
            properties.Add(tagPrefixProp);
            properties.Add(namespaceProp);
            properties.Add(assemblyProp);
            properties.Add(tagNameProp);
            properties.Add(sourceProp);

            elementProperty = new ConfigurationElementProperty(new CallbackValidator(typeof(TagPrefixInfo), ValidateElement));
        }
Ejemplo n.º 9
0
        static BufferModeSettings()
        {
            IntegerValidator iv = new IntegerValidator(1, Int32.MaxValue);

            maxBufferSizeProp = new ConfigurationProperty("maxBufferSize", typeof(int), Int32.MaxValue,
                                                          PropertyHelper.InfiniteIntConverter, iv,
                                                          ConfigurationPropertyOptions.IsRequired);
            maxBufferThreadsProp = new ConfigurationProperty("maxBufferThreads", typeof(int), 1,
                                                             PropertyHelper.InfiniteIntConverter, iv,
                                                             ConfigurationPropertyOptions.None);
            maxFlushSizeProp = new ConfigurationProperty("maxFlushSize", typeof(int), Int32.MaxValue,
                                                         PropertyHelper.InfiniteIntConverter, iv,
                                                         ConfigurationPropertyOptions.IsRequired);
            nameProp = new ConfigurationProperty("name", typeof(string), "",
                                                 TypeDescriptor.GetConverter(typeof(string)), PropertyHelper.NonEmptyStringValidator,
                                                 ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
            regularFlushIntervalProp = new ConfigurationProperty("regularFlushInterval", typeof(TimeSpan), TimeSpan.FromSeconds(1),
                                                                 PropertyHelper.InfiniteTimeSpanConverter,
                                                                 PropertyHelper.PositiveTimeSpanValidator,
                                                                 ConfigurationPropertyOptions.IsRequired);
            urgentFlushIntervalProp = new ConfigurationProperty("urgentFlushInterval", typeof(TimeSpan), TimeSpan.FromSeconds(0),
                                                                PropertyHelper.InfiniteTimeSpanConverter, null,
                                                                ConfigurationPropertyOptions.IsRequired);
            urgentFlushThresholdProp = new ConfigurationProperty("urgentFlushThreshold", typeof(int), Int32.MaxValue,
                                                                 PropertyHelper.InfiniteIntConverter, iv,
                                                                 ConfigurationPropertyOptions.IsRequired);
            properties = new ConfigurationPropertyCollection();

            properties.Add(nameProp);
            properties.Add(maxBufferSizeProp);
            properties.Add(maxBufferThreadsProp);
            properties.Add(maxFlushSizeProp);
            properties.Add(regularFlushIntervalProp);
            properties.Add(urgentFlushIntervalProp);
            properties.Add(urgentFlushThresholdProp);

            elementProperty = new ConfigurationElementProperty(new CallbackValidator(typeof(BufferModeSettings), ValidateElement));
        }
Ejemplo n.º 10
0
        static ProcessModelSection()
        {
            autoConfigProp           = new ConfigurationProperty("autoConfig", typeof(bool), false);
            clientConnectedCheckProp = new ConfigurationProperty("clientConnectedCheck", typeof(TimeSpan), TimeSpan.FromSeconds(5),
                                                                 PropertyHelper.InfiniteTimeSpanConverter,
                                                                 PropertyHelper.DefaultValidator,
                                                                 ConfigurationPropertyOptions.None);
            comAuthenticationLevelProp = new ConfigurationProperty("comAuthenticationLevel", typeof(ProcessModelComAuthenticationLevel), ProcessModelComAuthenticationLevel.Connect,
                                                                   new GenericEnumConverter(typeof(ProcessModelComAuthenticationLevel)),
                                                                   PropertyHelper.DefaultValidator,
                                                                   ConfigurationPropertyOptions.None);
            comImpersonationLevelProp = new ConfigurationProperty("comImpersonationLevel", typeof(ProcessModelComImpersonationLevel), ProcessModelComImpersonationLevel.Impersonate,
                                                                  new GenericEnumConverter(typeof(ProcessModelComImpersonationLevel)),
                                                                  PropertyHelper.DefaultValidator,
                                                                  ConfigurationPropertyOptions.None);
            cpuMaskProp     = new ConfigurationProperty("cpuMask", typeof(int), (int)(int.MaxValue & 0xfffffff));
            enableProp      = new ConfigurationProperty("enable", typeof(bool), true);
            idleTimeoutProp = new ConfigurationProperty("idleTimeout", typeof(TimeSpan), TimeSpan.MaxValue,
                                                        PropertyHelper.InfiniteTimeSpanConverter,
                                                        PropertyHelper.DefaultValidator,
                                                        ConfigurationPropertyOptions.None);
            logLevelProp = new ConfigurationProperty("logLevel", typeof(ProcessModelLogLevel), ProcessModelLogLevel.Errors,
                                                     new GenericEnumConverter(typeof(ProcessModelLogLevel)),
                                                     PropertyHelper.DefaultValidator,
                                                     ConfigurationPropertyOptions.None);
            maxAppDomainsProp = new ConfigurationProperty("maxAppDomains", typeof(int), 2000,
                                                          TypeDescriptor.GetConverter(typeof(int)),
                                                          PropertyHelper.IntFromOneToMax_1Validator,
                                                          ConfigurationPropertyOptions.None);
            maxIoThreadsProp = new ConfigurationProperty("maxIoThreads", typeof(int), 20,
                                                         TypeDescriptor.GetConverter(typeof(int)),
                                                         PropertyHelper.IntFromOneToMax_1Validator,
                                                         ConfigurationPropertyOptions.None);
            maxWorkerThreadsProp = new ConfigurationProperty("maxWorkerThreads", typeof(int), 20,
                                                             TypeDescriptor.GetConverter(typeof(int)),
                                                             PropertyHelper.IntFromOneToMax_1Validator,
                                                             ConfigurationPropertyOptions.None);
            memoryLimitProp  = new ConfigurationProperty("memoryLimit", typeof(int), 60);
            minIoThreadsProp = new ConfigurationProperty("minIoThreads", typeof(int), 1,
                                                         TypeDescriptor.GetConverter(typeof(int)),
                                                         PropertyHelper.IntFromOneToMax_1Validator,
                                                         ConfigurationPropertyOptions.None);
            minWorkerThreadsProp = new ConfigurationProperty("minWorkerThreads", typeof(int), 1,
                                                             TypeDescriptor.GetConverter(typeof(int)),
                                                             PropertyHelper.IntFromOneToMax_1Validator,
                                                             ConfigurationPropertyOptions.None);
            passwordProp      = new ConfigurationProperty("password", typeof(string), "AutoGenerate");
            pingFrequencyProp = new ConfigurationProperty("pingFrequency", typeof(TimeSpan), TimeSpan.MaxValue,
                                                          PropertyHelper.InfiniteTimeSpanConverter,
                                                          PropertyHelper.DefaultValidator,
                                                          ConfigurationPropertyOptions.None);
            pingTimeoutProp = new ConfigurationProperty("pingTimeout", typeof(TimeSpan), TimeSpan.MaxValue,
                                                        PropertyHelper.InfiniteTimeSpanConverter,
                                                        PropertyHelper.DefaultValidator,
                                                        ConfigurationPropertyOptions.None);
            requestLimitProp = new ConfigurationProperty("requestLimit", typeof(int), Int32.MaxValue,
                                                         PropertyHelper.InfiniteIntConverter,
                                                         PropertyHelper.IntFromZeroToMaxValidator,
                                                         ConfigurationPropertyOptions.None);
            requestQueueLimitProp = new ConfigurationProperty("requestQueueLimit", typeof(int), 5000,
                                                              PropertyHelper.InfiniteIntConverter,
                                                              PropertyHelper.IntFromZeroToMaxValidator,
                                                              ConfigurationPropertyOptions.None);
            responseDeadlockIntervalProp = new ConfigurationProperty("responseDeadlockInterval", typeof(TimeSpan), TimeSpan.FromMinutes(3),
                                                                     PropertyHelper.InfiniteTimeSpanConverter,
                                                                     PropertyHelper.PositiveTimeSpanValidator,
                                                                     ConfigurationPropertyOptions.None);
            responseRestartDeadlockIntervalProp = new ConfigurationProperty("responseRestartDeadlockInterval", typeof(TimeSpan), TimeSpan.FromMinutes(3),
                                                                            PropertyHelper.InfiniteTimeSpanConverter,
                                                                            PropertyHelper.DefaultValidator,
                                                                            ConfigurationPropertyOptions.None);
            restartQueueLimitProp = new ConfigurationProperty("restartQueueLimit", typeof(int), 10,
                                                              PropertyHelper.InfiniteIntConverter,
                                                              PropertyHelper.IntFromZeroToMaxValidator,
                                                              ConfigurationPropertyOptions.None);
            serverErrorMessageFileProp = new ConfigurationProperty("serverErrorMessageFile", typeof(string), "");
            shutdownTimeoutProp        = new ConfigurationProperty("shutdownTimeout", typeof(TimeSpan), TimeSpan.FromSeconds(5),
                                                                   PropertyHelper.InfiniteTimeSpanConverter,
                                                                   PropertyHelper.PositiveTimeSpanValidator,
                                                                   ConfigurationPropertyOptions.None);
            timeoutProp = new ConfigurationProperty("timeout", typeof(TimeSpan), TimeSpan.MaxValue,
                                                    PropertyHelper.InfiniteTimeSpanConverter,
                                                    PropertyHelper.DefaultValidator,
                                                    ConfigurationPropertyOptions.None);
            userNameProp  = new ConfigurationProperty("userName", typeof(string), "machine");
            webGardenProp = new ConfigurationProperty("webGarden", typeof(bool), false);
            properties    = new ConfigurationPropertyCollection();

            properties.Add(autoConfigProp);
            properties.Add(clientConnectedCheckProp);
            properties.Add(comAuthenticationLevelProp);
            properties.Add(comImpersonationLevelProp);
            properties.Add(cpuMaskProp);
            properties.Add(enableProp);
            properties.Add(idleTimeoutProp);
            properties.Add(logLevelProp);
            properties.Add(maxAppDomainsProp);
            properties.Add(maxIoThreadsProp);
            properties.Add(maxWorkerThreadsProp);
            properties.Add(memoryLimitProp);
            properties.Add(minIoThreadsProp);
            properties.Add(minWorkerThreadsProp);
            properties.Add(passwordProp);
            properties.Add(pingFrequencyProp);
            properties.Add(pingTimeoutProp);
            properties.Add(requestLimitProp);
            properties.Add(requestQueueLimitProp);
            properties.Add(responseDeadlockIntervalProp);
            properties.Add(responseRestartDeadlockIntervalProp);
            properties.Add(restartQueueLimitProp);
            properties.Add(serverErrorMessageFileProp);
            properties.Add(shutdownTimeoutProp);
            properties.Add(timeoutProp);
            properties.Add(userNameProp);
            properties.Add(webGardenProp);

            elementProperty = new ConfigurationElementProperty(new CallbackValidator(typeof(ProcessModelSection), ValidateElement));
        }