本文整理汇总了C#中SchemaType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# SchemaType.ToString方法的具体用法?C# SchemaType.ToString怎么用?C# SchemaType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SchemaType
的用法示例。
在下文中一共展示了SchemaType.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSetter
private static OguAndADObjectSetterBase GetSetter(ObjectModifyType modifyType, SchemaType schemaType)
{
string schemaTypeName = schemaType.ToString();
string cacheKey = "OguAndADObjectSetterBase" + "-" + modifyType.ToString() + "+" + schemaTypeName;
return (OguAndADObjectSetterBase)ObjectContextCache.Instance.GetOrAddNewValue(cacheKey, (cache, key) =>
{
SchemaMappingInfo mappingInfo = PermissionCenterToADSynchronizeSettings.GetConfig().SchemaMappings.GetSchemaMappingInfo(schemaTypeName);
OguAndADObjectSetterBase setter = null;
if (mappingInfo.ModifyOperations.ContainsKey(modifyType.ToString()))
{
SetterObjectMappingConfigurationElement objSetterMappingElement = mappingInfo.ModifyOperations[modifyType.ToString()];
setter = (OguAndADObjectSetterBase)PropertySettersSettings.GetConfig().ObjectSetters[objSetterMappingElement.OperationName].CreateInstance();
}
cache.Add(cacheKey, setter);
return setter;
});
}
示例2: CreateObject
/// <summary>
/// 创建机构人员组对象
/// </summary>
/// <param name="type">需要创建的对象类型</param>
/// <returns></returns>
public IOguObject CreateObject(SchemaType type)
{
OguBaseImpl oBase = null;
switch (type)
{
case SchemaType.Users:
oBase = new OguUserImpl();
break;
case SchemaType.Organizations:
oBase = new OguOrganizationImpl();
break;
case SchemaType.OrganizationsInRole:
oBase = new OguOrganizationInRoleImpl();
break;
case SchemaType.Groups:
oBase = new OguGroupImpl();
break;
default:
throw new InvalidOperationException(string.Format(Resource.InvalidObjectTypeCreation, type.ToString()));
}
return oBase;
}