/// <summary> /// init methods cache. /// </summary> /// <param name="type">include method's class type</param> public static void Register(Type type) { if (!RegisteredType.Contains(type)) { MethodInfo[] ms = type.GetMethods(BindingFlags.Public | BindingFlags.Instance); object instance = Activator.CreateInstance(type); foreach (MethodInfo m in ms) { var conext = new MethodContext(instance, m); methods.Add(m.Name, conext); } RegisteredType.Add(type); } }
/// <summary> /// init methods cache. /// </summary> /// <param name="type">include method's class type</param> public static void Register(Type type) { if (!RegisteredType.Contains(type)) { MethodInfo[] ms = type.GetMethods(BindingFlags.Public | BindingFlags.Instance); object instance = Activator.CreateInstance(type); foreach (MethodInfo m in ms) { var conext = new MethodContext(instance, m); methods.Add(m.Name, conext); } RegisteredType.Add(type); } }