AjScript.Language.DynamicObject.IsNativeMethod C# (CSharp) 메소드

IsNativeMethod() 공개 메소드

public IsNativeMethod ( string name ) : bool
name string
리턴 bool
        public virtual bool IsNativeMethod(string name)
        {
            return nativeMethods.Contains(name);
        }

Usage Example

예제 #1
0
        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"));
        }