当前位置: 首页>>代码示例>>C#>>正文


C# ConfigurationPropertyCollection.Add方法代码示例

本文整理汇总了C#中System.Configuration.ConfigurationPropertyCollection.Add方法的典型用法代码示例。如果您正苦于以下问题:C# ConfigurationPropertyCollection.Add方法的具体用法?C# ConfigurationPropertyCollection.Add怎么用?C# ConfigurationPropertyCollection.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Configuration.ConfigurationPropertyCollection的用法示例。


在下文中一共展示了ConfigurationPropertyCollection.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HttpCookiesSection

               /*         <!--
               httpCookies Attributes:
                 httpOnlyCookies="[true|false]" - enables output of the "HttpOnly" cookie attribute
                 requireSSL="[true|false]" - enables output of the "secure" cookie attribute as described in RFC 2109
                 domain="[domain]" - enables output of the "domain" cookie attribute set to the specified value
               -->
               <httpCookies
                   httpOnlyCookies="false"
                   requireSSL="false"
       />
 */
       static HttpCookiesSection() {
           // Property initialization
           _properties = new ConfigurationPropertyCollection();
           _properties.Add(_propHttpOnlyCookies);
           _properties.Add(_propRequireSSL);
           _properties.Add(_propDomain);
       }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:18,代码来源:HttpCookiesSection.cs

示例2: CommandCacheDependencyElement

        /// <summary>
        /// Initializes the <see cref="CacheRegionElement"/> class.
        /// </summary>
        static CommandCacheDependencyElement()
        {
            //building the properties collection and overriding the properties property apparently
            //increases performace considerably
            properties = new ConfigurationPropertyCollection();

            var nameProperty = new ConfigurationProperty("name", typeof (string), String.Empty,
                                                         ConfigurationPropertyOptions.IsKey);

            properties.Add(nameProperty);

            var commandProperty = new ConfigurationProperty("command", typeof (string), String.Empty,
                                                            ConfigurationPropertyOptions.IsRequired);

            properties.Add(commandProperty);

            var connectionNameProperty = new ConfigurationProperty("connectionName", typeof (string), String.Empty,
                                                                   ConfigurationPropertyOptions.None);

            properties.Add(connectionNameProperty);

            var isSprocProperty = new ConfigurationProperty("isStoredProcedure", typeof (bool), false,
                                                            ConfigurationPropertyOptions.None);

            properties.Add(isSprocProperty);

            var providerTypeProperty = new ConfigurationProperty("connectionStringProviderType", typeof (System.Type), null,
                                                                 new TypeNameConverter(),
                                                                 new SubclassTypeValidator(typeof (IConnectionStringProvider)),
                                                                 ConfigurationPropertyOptions.None);

            properties.Add(providerTypeProperty);
        }
开发者ID:mpielikis,项目名称:nhibernate-contrib,代码行数:36,代码来源:CommandCacheDependencyElement.cs

示例3: TraceSection

 static TraceSection() {
     _properties = new ConfigurationPropertyCollection();
     _properties.Add(_propListeners);
     _properties.Add(_propAutoFlush);
     _properties.Add(_propIndentSize);
     _properties.Add(_propUseGlobalLock);
 }
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:7,代码来源:TraceSection.cs

示例4: BuildProperties

 private static ConfigurationPropertyCollection BuildProperties() {
     ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
     properties.Add(_propEnabled);
     properties.Add(_propEnableForReading);
     properties.Add(_propEnableForWriting);
     return properties;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:ScriptingProfileServiceSection.cs

示例5: ConnectionElement

        /// <summary>
        /// Predefines the valid properties and prepares
        /// the property collection.
        /// </summary>
        static ConnectionElement()
        {
            // Predefine properties here
            s_propName = new ConfigurationProperty(
                "name",
                typeof(string),
                null,
                ConfigurationPropertyOptions.IsRequired
            );

            s_propCS = new ConfigurationProperty(
                "connectionString",
                typeof(string),
                null,
                ConfigurationPropertyOptions.IsRequired
            );

            s_propType = new ConfigurationProperty(
                "type",
                typeof(string),
                "SqlServer",
                ConfigurationPropertyOptions.None
            );

            s_properties = new ConfigurationPropertyCollection();

            s_properties.Add(s_propName);
            s_properties.Add(s_propCS);
            s_properties.Add(s_propType);
        }
开发者ID:REMSLogic,项目名称:REMSLogic,代码行数:34,代码来源:ConnectionElement.cs

示例6: ProtectedConfigurationSection

 static ProtectedConfigurationSection()
 {
     // Property initialization
     _properties = new ConfigurationPropertyCollection();
     _properties.Add(_propProviders);
     _properties.Add(_propDefaultProvider);
 }
开发者ID:kichalla,项目名称:systemconfigurationport,代码行数:7,代码来源:ProtectedConfigurationSection.cs

示例7: NameValueConfigurationElement

 static NameValueConfigurationElement()
 {
     // Property initialization
     _properties = new ConfigurationPropertyCollection();
     _properties.Add(_propName);
     _properties.Add(_propValue);
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:7,代码来源:namevalueconfigurationelement.cs

示例8: TemplateElement

        static TemplateElement()
        {
            _Properties = new ConfigurationPropertyCollection();

            _Properties.Add(_Name);
            _Properties.Add(_Path);
        }
开发者ID:Cocotus,项目名称:NiL.WBE,代码行数:7,代码来源:TemplateConfigurationHandler.cs

示例9: SqlCacheDependencyDatabase

        static SqlCacheDependencyDatabase() {
            // Property initialization
            _properties = new ConfigurationPropertyCollection();

            _propName =
                new ConfigurationProperty("name",
                                            typeof(string),
                                            null,
                                            null,
                                            StdValidatorsAndConverters.NonEmptyStringValidator,
                                            ConfigurationPropertyOptions.IsRequired | 
                                            ConfigurationPropertyOptions.IsKey);
            
            _propConnectionStringName =
                new ConfigurationProperty("connectionStringName",
                                            typeof(string),
                                            null,
                                            null,
                                            StdValidatorsAndConverters.NonEmptyStringValidator,
                                            ConfigurationPropertyOptions.IsRequired);

            _propPollTime = new ConfigurationProperty("pollTime", 
                                            typeof(int), 
                                            60000, 
                                            ConfigurationPropertyOptions.None);

            _properties.Add(_propName);
            _properties.Add(_propConnectionStringName);
            _properties.Add(_propPollTime);
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:30,代码来源:SqlCacheDependencyDatabase.cs

示例10: MachineKeySection

		static MachineKeySection ()
		{
			decryptionProp = new ConfigurationProperty ("decryption", typeof (string), "Auto",
								    PropertyHelper.WhiteSpaceTrimStringConverter,
								    PropertyHelper.NonEmptyStringValidator,
								    ConfigurationPropertyOptions.None);
			decryptionKeyProp = new ConfigurationProperty ("decryptionKey", typeof (string), "AutoGenerate,IsolateApps",
								       PropertyHelper.WhiteSpaceTrimStringConverter,
								       PropertyHelper.NonEmptyStringValidator,
								       ConfigurationPropertyOptions.None);
			validationProp = new ConfigurationProperty ("validation", typeof (string), "HMACSHA256",
								    PropertyHelper.WhiteSpaceTrimStringConverter,
								    PropertyHelper.NonEmptyStringValidator,
								    ConfigurationPropertyOptions.None);
			validationKeyProp = new ConfigurationProperty ("validationKey", typeof (string), "AutoGenerate,IsolateApps",
								       PropertyHelper.WhiteSpaceTrimStringConverter,
								       PropertyHelper.NonEmptyStringValidator,
								       ConfigurationPropertyOptions.None);

			properties = new ConfigurationPropertyCollection ();

			properties.Add (decryptionProp);
			properties.Add (decryptionKeyProp);
			properties.Add (validationProp);
			properties.Add (validationKeyProp);

			Config.AutoGenerate (MachineKeyRegistryStorage.KeyType.Encryption);
			Config.AutoGenerate (MachineKeyRegistryStorage.KeyType.Validation);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:29,代码来源:MachineKeySection.cs

示例11: CacheRegionElement

		/// <summary>
		/// Initializes the <see cref="CacheRegionElement"/> class.
		/// </summary>
		static CacheRegionElement()
		{
			//building the properties collection and overriding the properties property apparently
			//increases performace considerably
			properties = new ConfigurationPropertyCollection();

			var nameProperty = new ConfigurationProperty("name", typeof (string), String.Empty,
			                                             ConfigurationPropertyOptions.IsKey);

			properties.Add(nameProperty);

			var relativeExpirationProperty = new ConfigurationProperty("relativeExpiration", typeof (TimeSpan?), null,
			                                                           new TimeSpanSecondsConverter(), null,
			                                                           ConfigurationPropertyOptions.None);

			properties.Add(relativeExpirationProperty);

			var timeOfDayExpirationProperty = new ConfigurationProperty("timeOfDayExpiration", typeof (TimeSpan?), null, null,
			                                                            new NullableTimeSpanValidator(new TimeSpan(0, 0, 0),
			                                                                                          new TimeSpan(23, 59, 59),
			                                                                                          false),
			                                                            ConfigurationPropertyOptions.None);

			properties.Add(timeOfDayExpirationProperty);

			var priorityProperty = new ConfigurationProperty("priority", typeof (CacheItemPriority), CacheItemPriority.Default,
			                                                 ConfigurationPropertyOptions.None);

			properties.Add(priorityProperty);

			var dependenciesProperty = new ConfigurationProperty("dependencies", typeof (CacheDependenciesElement), null,
			                                                     ConfigurationPropertyOptions.None);

			properties.Add(dependenciesProperty);
		}
开发者ID:polyzois,项目名称:NHibernate.Diegose,代码行数:38,代码来源:CacheRegionElement.cs

示例12: ExampleSection

        /// <summary>
        /// Predefines the valid properties and prepares
        /// the property collection.
        /// </summary>
        static ExampleSection()
        {
            // Predefine properties here
            s_propString = new ConfigurationProperty(
                "stringValue",
                typeof(string),
                null,
                ConfigurationPropertyOptions.IsRequired
            );

            s_propBool = new ConfigurationProperty(
                "boolValue",
                typeof(bool),
                false,
                ConfigurationPropertyOptions.None
            );

            s_propTimeSpan = new ConfigurationProperty(
                "timeSpanValue",
                typeof(TimeSpan),
                null,
                ConfigurationPropertyOptions.None
            );

            s_properties = new ConfigurationPropertyCollection();

            s_properties.Add(s_propString);
            s_properties.Add(s_propBool);
            s_properties.Add(s_propTimeSpan);
        }
开发者ID:sgh1986915,项目名称:.net-braintree-spa,代码行数:34,代码来源:AuthenticationToggle.cs

示例13: MachineKeySection

		static MachineKeySection ()
		{
			decryptionProp = new ConfigurationProperty ("decryption", typeof (string), "Auto",
								    PropertyHelper.WhiteSpaceTrimStringConverter,
								    PropertyHelper.NonEmptyStringValidator,
								    ConfigurationPropertyOptions.None);
			decryptionKeyProp = new ConfigurationProperty ("decryptionKey", typeof (string), "AutoGenerate,IsolateApps",
								       PropertyHelper.WhiteSpaceTrimStringConverter,
								       PropertyHelper.NonEmptyStringValidator,
								       ConfigurationPropertyOptions.None);
			validationProp = new ConfigurationProperty ("validation", typeof (MachineKeyValidation), MachineKeyValidation.SHA1,
								    new MachineKeyValidationConverter (),
								    PropertyHelper.DefaultValidator,
								    ConfigurationPropertyOptions.None);
			validationKeyProp = new ConfigurationProperty ("validationKey", typeof (string), "AutoGenerate,IsolateApps",
								       PropertyHelper.WhiteSpaceTrimStringConverter,
								       PropertyHelper.NonEmptyStringValidator,
								       ConfigurationPropertyOptions.None);

			properties = new ConfigurationPropertyCollection ();

			properties.Add (decryptionProp);
			properties.Add (decryptionKeyProp);
			properties.Add (validationProp);
			properties.Add (validationKeyProp);

			MachineKeySectionUtils.AutoGenKeys ();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:28,代码来源:MachineKeySection.cs

示例14: ConnectionStringSettings

 static ConnectionStringSettings() {
     // Property initialization
     _properties = new ConfigurationPropertyCollection();
     _properties.Add(_propName);
     _properties.Add(_propConnectionString);
     _properties.Add(_propProviderName);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:ConnectionStringSettings.cs

示例15: ProviderSettings

 public ProviderSettings()
 {
     _properties = new ConfigurationPropertyCollection();
     _properties.Add(_propName);
     _properties.Add(_propType);
     _PropertyNameCollection = null;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:ProviderSettings.cs


注:本文中的System.Configuration.ConfigurationPropertyCollection.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。