public FindMethod ( String name, Object parameters ) : |
||
name | String | |
parameters | Object | |
리턴 |
public System.Reflection.MethodInfo FindMethod(string name, object[] parameters) { var methodInfo = _classMap.FindMethod(name, parameters); if (methodInfo == null) { return(new DynamicMethodInfo(_type, name)); } else { return(methodInfo); } }
/// <summary> Gets the method defined by <code>name</code> and /// <code>params</code> for the Class <code>c</code>. /// /// </summary> /// <param name="c">Class in which the method search is taking place /// </param> /// <param name="name">Name of the method being searched for /// </param> /// <param name="params">An array of Objects (not Classes) that describe the /// the parameters /// /// </param> /// <returns> The desired Method object. /// </returns> /// <throws> IllegalArgumentException When the parameters passed in can not be used for introspection. </throws> /// <throws> MethodMap.AmbiguousException When the method map contains more than one match for the requested signature. </throws> public virtual MethodEntry GetMethod(Type c, string name, object[] parameters) { if (c == null) { throw new System.ArgumentException("class object is null!"); } IIntrospectorCache ic = IntrospectorCache; ClassMap classMap = ic.Get(c); if (classMap == null) { classMap = ic.Put(c); } return(classMap.FindMethod(name, parameters)); }
public virtual MethodInfo GetMethod(Type c, string name, object[] parameters) { if (c == null) { throw new System.Exception("Introspector.getMethod(): Class method key was null: " + name); } ClassMap classMap = null; lock (this.classMethodMaps) { classMap = (ClassMap)this.classMethodMaps[c]; if (classMap == null) { if (this.cachedClassNames.Contains(c.FullName)) { this.ClearCache(); } classMap = this.CreateClassMap(c); } } return(classMap.FindMethod(name, parameters)); }