/// <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); } } }
/// <summary> /// 接口注册 /// </summary> /// <param name="fromType">来源类型</param> /// <param name="toType">目标类型</param> public void Register(Type fromType, Type toType) { DicToRegister.Add(toType, fromType.FullName); }