本文整理汇总了C#中IConfig.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# IConfig.ContainsKey方法的具体用法?C# IConfig.ContainsKey怎么用?C# IConfig.ContainsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IConfig
的用法示例。
在下文中一共展示了IConfig.ContainsKey方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPredefinedPropertyKey
private static string GetPredefinedPropertyKey(string property, IConfig config) {
string result = null;
if(config.ContainsKey("predefinedProperties", property)) {
result = config.GetValue("predefinedProperties", property);
}
return result;
}
示例2: SetEmailAttribute
private static void SetEmailAttribute(IConfig configSection, UsersConfig users) {
if(configSection.ContainsKey("users", "emailAttribute")) {
users.EmailAttribute = configSection.GetValue("users", "emailAttribute");
}
}
示例3: SetBase
private static void SetBase(IConfig configSection, GroupsConfig groups) {
if(configSection.ContainsKey("groups", "base")) {
groups.Base = configSection.GetValue("groups", "base");
}
}
示例4: SetSizeLimit
private static void SetSizeLimit(IConfig configSection, ServerConfig server) {
if(configSection.ContainsKey("sizeLimit")) {
var sizeLimit = configSection.GetValue<int>("sizeLimit");
server.SizeLimit = sizeLimit;
}
}
示例5: SetTimeLimit
private static void SetTimeLimit(IConfig configSection, ServerConfig server) {
if(configSection.ContainsKey("timeLimit")) {
var timeLimit = configSection.GetValue<int>("timeLimit");
server.TimeLimit = TimeSpan.FromSeconds(timeLimit);
}
}
示例6: SetPassword
private static void SetPassword(IConfig configSection, ServerConfig server) {
if(configSection.ContainsKey("password")) {
server.Password = configSection.GetValue("password");
}
}
示例7: SetAuthenticationTypes
private static void SetAuthenticationTypes(IConfig configSection, ServerConfig server) {
if(configSection.ContainsKey("authenticationTypes")) {
var authenticationTypes = configSection.GetValueArray("authenticationTypes", "authenticationType");
foreach(var authenticationType in authenticationTypes) {
server.AuthenticationTypes |=
(AuthenticationTypes)Enum.Parse(typeof(AuthenticationTypes), authenticationType, true);
}
}
}
示例8: SetPropertySortingSupport
private static void SetPropertySortingSupport(IConfig configSection, ServerConfig server) {
if(configSection.ContainsKey("propertySortingSupport")) {
server.PropertySortingSupport = configSection.GetValue<bool>("propertySortingSupport");
}
}
示例9: SetDescriptionAttribute
private static void SetDescriptionAttribute(IConfig configSection, UsersConfig users) {
if(configSection.ContainsKey("users", "descriptionAttribute")) {
users.DescriptionAttribute = configSection.GetValue("users", "descriptionAttribute");
}
}
示例10: SetNameType
private static void SetNameType(IConfig configSection, GroupsConfig groups) {
if(configSection.ContainsKey("groups", "nameType")) {
var nameType = configSection.GetValue("groups", "nameType");
groups.NameType = (NameType)Enum.Parse(typeof(NameType), nameType, true);
}
}
示例11: SetAttributeDefinitionList
private static void SetAttributeDefinitionList(IConfig configSection, GroupsConfig groups) {
var containsCustomAttributes = configSection.ContainsKey("groups", "attributes");
var attributes = new List<IAttributeDefinition>(groups.Attributes);
if(containsCustomAttributes) {
attributes.Clear();
}
attributes.Attach(groups.MembershipAttribute, true);
if(containsCustomAttributes) {
var attributeValues = configSection.GetValueArray("groups/attributes", "attribute");
foreach(var attribute in attributeValues) {
var excludeFromNameSearch = false;
var attributeKey = String.Format("groups/attributes/attribute[@value='{0}']", attribute);
if(configSection.ContainsAttribute(attributeKey, "excludeFromNameSearch")) {
excludeFromNameSearch = configSection.GetAttribute<bool>(attributeKey, "excludeFromNameSearch");
}
attributes.Attach(attribute, excludeFromNameSearch);
}
}
groups.Attributes = attributes;
}
示例12: SetMembershipAttribute
private static void SetMembershipAttribute(IConfig configSection, GroupsConfig groups) {
if(configSection.ContainsKey("groups", "membershipAttribute")) {
groups.MembershipAttribute = configSection.GetValue("groups", "membershipAttribute");
}
}
示例13: SetRdnInPath
private void SetRdnInPath(IConfig configSection, GroupsConfig groups) {
if(configSection.ContainsKey("groups", "rdnInPath")) {
groups.RdnInPath = configSection.GetValue<bool>("groups", "rdnInPath");
}
}
示例14: SetRdnAttribute
private static void SetRdnAttribute(IConfig configSection, GroupsConfig groups) {
if(configSection.ContainsKey("groups", "rdnAttribute")) {
groups.RdnAttribute = configSection.GetValue("groups", "rdnAttribute");
}
}
示例15: SetCreationDateAttribute
private static void SetCreationDateAttribute(IConfig configSection, UsersConfig users) {
if(configSection.ContainsKey("users", "creationDateAttribute")) {
users.CreationDateAttribute = configSection.GetValue("users", "creationDateAttribute");
}
}