示例#1
0
 /// <summary>
 /// 接口注册
 /// </summary>
 /// <param name="types">类型数组</param>
 public void Register(params Type[] types)
 {
     foreach (var type in types)
     {
         var interfaces = type.GetInterfaces();
         foreach (var inter in interfaces)
         {
             if (DicToRegister.ContainsValue(inter.FullName))
             {
                 continue;
             }
             DicToRegister.Add(type, inter.FullName);
         }
     }
 }
示例#2
0
 /// <summary>
 /// 接口注册
 /// </summary>
 /// <param name="fromType">来源类型</param>
 /// <param name="toType">目标类型</param>
 public void Register(Type fromType, Type toType)
 {
     DicToRegister.Add(toType, fromType.FullName);
 }