public IsNativeMethod ( string name ) : bool | ||
name | string | |
Résultat | bool |
public virtual bool IsNativeMethod(string name)
{
return nativeMethods.Contains(name);
}
public void DetectNativeMethods() { DynamicObject dynobj = new DynamicObject(); Assert.IsTrue(dynobj.IsNativeMethod("ToString")); Assert.IsTrue(dynobj.IsNativeMethod("GetHashCode")); Assert.IsTrue(dynobj.IsNativeMethod("Equals")); Assert.IsTrue(dynobj.IsNativeMethod("GetValue")); Assert.IsTrue(dynobj.IsNativeMethod("SetValue")); Assert.IsTrue(dynobj.IsNativeMethod("GetNames")); Assert.IsTrue(dynobj.IsNativeMethod("Invoke")); Assert.IsFalse(dynobj.IsNativeMethod("Foo")); }