CreateExternalObject() 공개 정적인 메소드

Creates a new Object that stores some external data
Requires an active script context.
public static CreateExternalObject ( IntPtr data, JsObjectFinalizeCallback finalizer ) : IeJsValue
data System.IntPtr External data that the object will represent. May be null.
finalizer JsObjectFinalizeCallback A callback for when the object is finalized. May be null.
리턴 IeJsValue
예제 #1
0
        private IeJsValue CreateExternalObjectFromObject(object value)
        {
            GCHandle handle = GCHandle.Alloc(value);

            _externalObjects.Add(value);

            IeJsValue objValue = IeJsValue.CreateExternalObject(
                GCHandle.ToIntPtr(handle), _externalObjectFinalizeCallback);
            Type type = value.GetType();

            ProjectFields(objValue, type, true);
            ProjectProperties(objValue, type, true);
            ProjectMethods(objValue, type, true);
            FreezeObject(objValue);

            return(objValue);
        }