本文整理汇总了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);
}
示例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);
}
示例3: TraceSection
static TraceSection() {
_properties = new ConfigurationPropertyCollection();
_properties.Add(_propListeners);
_properties.Add(_propAutoFlush);
_properties.Add(_propIndentSize);
_properties.Add(_propUseGlobalLock);
}
示例4: BuildProperties
private static ConfigurationPropertyCollection BuildProperties() {
ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
properties.Add(_propEnabled);
properties.Add(_propEnableForReading);
properties.Add(_propEnableForWriting);
return properties;
}
示例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);
}
示例6: ProtectedConfigurationSection
static ProtectedConfigurationSection()
{
// Property initialization
_properties = new ConfigurationPropertyCollection();
_properties.Add(_propProviders);
_properties.Add(_propDefaultProvider);
}
示例7: NameValueConfigurationElement
static NameValueConfigurationElement()
{
// Property initialization
_properties = new ConfigurationPropertyCollection();
_properties.Add(_propName);
_properties.Add(_propValue);
}
示例8: TemplateElement
static TemplateElement()
{
_Properties = new ConfigurationPropertyCollection();
_Properties.Add(_Name);
_Properties.Add(_Path);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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 ();
}
示例14: ConnectionStringSettings
static ConnectionStringSettings() {
// Property initialization
_properties = new ConfigurationPropertyCollection();
_properties.Add(_propName);
_properties.Add(_propConnectionString);
_properties.Add(_propProviderName);
}
示例15: ProviderSettings
public ProviderSettings()
{
_properties = new ConfigurationPropertyCollection();
_properties.Add(_propName);
_properties.Add(_propType);
_PropertyNameCollection = null;
}