當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。