Ejemplo n.º 1
0
 /// <summary>
 /// 获得活动目录实体的架构类型名
 /// </summary>
 /// <param name="type">实体类型</param>
 /// <returns></returns>
 static protected internal string GetEntitySchemaClassType(Type type)
 {
     foreach (object attribute in type.GetCustomAttributes(false))
     {
         DirectorySchemaAttribute schemaAttribute = attribute as DirectorySchemaAttribute;
         if (schemaAttribute != null)
         {
             return(schemaAttribute.Type);
         }
     }
     return(null);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 获得活动目录实体的架构类型名
 /// </summary>
 /// <typeparam name="T">活动目录实体类型</typeparam>
 /// <returns>架构类型名</returns>
 static protected string GetEntitySchemaClassName <T>() where T : IDirectoryEntity
 {
     foreach (object attribute in typeof(T).GetCustomAttributes(false))
     {
         DirectorySchemaAttribute schemaAttribute = attribute as DirectorySchemaAttribute;
         if (schemaAttribute != null)
         {
             return(schemaAttribute.Schema);
         }
     }
     return(null);
 }