예제 #1
0
        // --------------------------------------------------------------------------------------------------------------------

        /// <summary>
        /// Returns an existing or new handle to wrap the proxy reference.
        /// </summary>
        internal Handle _GetHandle(HandleProxy* hp)
        {
            _DoWorkStep(); // (attempt to dispose of at least one handle on each call to attempt to keep reusing handles whenever possible)

            if (hp == null) return null;

            if (hp->ManagedHandleID >= 0)
                return _Handles[hp->ManagedHandleID].Object._Reset();

            Handle handle;

            switch (hp->ValueType)
            {
                case JSValueType.Bool: handle = new Handle<bool>(this); break;
                case JSValueType.Date: handle = new Handle<DateTime>(this); break;
                case JSValueType.Int32: handle = new Handle<Int32>(this); break;
                case JSValueType.Number: handle = new Handle<double>(this); break;
                case JSValueType.String: handle = new Handle<string>(this); break;

                case JSValueType.CompilerError: handle = new Handle<string>(this); break;
                case JSValueType.ExecutionError: handle = new Handle<string>(this); break;
                case JSValueType.InternalError: handle = new Handle<string>(this); break;

                default: handle = new Handle<object>(this); break;
            }

            handle._Initialize(hp);

            lock (_Handles) // (whole list may be affected internally, so this needs to be thread protected)
            {
                hp->ManagedHandleID = handle._ID = _Handles.Add(new ObservableWeakReference<Handle>(handle));
            }

            return handle;
        }
예제 #2
0
 public static extern bool DeleteObjectPropertyByIndex(HandleProxy* proxy, Int32 index);
예제 #3
0
 public static unsafe extern void SetObjectTemplateProperty(NativeObjectTemplateProxy* proxy, string name, HandleProxy* value, V8PropertyAttributes attributes = V8PropertyAttributes.None);
예제 #4
0
 public static extern void UpdateHandleValue(HandleProxy* handle);
예제 #5
0
 public static extern void MakeStrongHandle(HandleProxy* handleProxy);
예제 #6
0
 public static extern HandleProxy* CreateArray(NativeV8EngineProxy* engine, HandleProxy** items = null, Int32 length = 0);
예제 #7
0
 public static extern HandleProxy* CreateFunctionInstance(NativeFunctionTemplateProxy* functionTemplateProxy, Int32 objId, Int32 argCount = 0, HandleProxy** args = null);
예제 #8
0
 public static extern V8PropertyAttributes GetPropertyAttributes(HandleProxy* proxy, string name);
예제 #9
0
 public static extern HandleProxy* GetObjectPrototype(HandleProxy* handleProxy);
예제 #10
0
 public static extern void ConnectObject(HandleProxy* handleProxy, Int32 objId, void* templateProxy = null);
예제 #11
0
 public static extern HandleProxy* V8ExecuteCompiledScript(NativeV8EngineProxy* engine, HandleProxy* script);
예제 #12
0
 public static unsafe extern HandleProxy* CreateFunctionInstance(NativeFunctionTemplateProxy* functionTemplateProxy, Int32 objID, Int32 argCount, HandleProxy** args);
예제 #13
0
 public static unsafe extern HandleProxy* GetPropertyNames(HandleProxy* proxy);
예제 #14
0
 public static extern void SetObjectAccessor(HandleProxy* proxy, Int32 managedObjectId, string name,
     ManagedAccessorGetter getter, ManagedAccessorSetter setter,
     V8AccessControl access, V8PropertyAttributes attributes);
예제 #15
0
 public static extern HandleProxy* Call(HandleProxy* subject, string functionName, HandleProxy* _this, Int32 argCount, HandleProxy** args);
예제 #16
0
 public static extern HandleProxy* GetOwnPropertyNames(HandleProxy* proxy);
예제 #17
0
 public static extern bool SetObjectPropertyByName(HandleProxy* proxy, string name, HandleProxy* value, V8PropertyAttributes attributes = V8PropertyAttributes.None);
예제 #18
0
 public static extern Int32 GetArrayLength(HandleProxy* proxy);
예제 #19
0
 public static extern bool SetObjectPropertyByIndex(HandleProxy* proxy, Int32 index, HandleProxy* value);
예제 #20
0
 public static extern void SetFunctionTemplateProperty(NativeFunctionTemplateProxy* proxy, string name, HandleProxy* value, V8PropertyAttributes attributes = V8PropertyAttributes.None);
예제 #21
0
 public static extern HandleProxy* GetObjectPropertyByName(HandleProxy* proxy, string name);
예제 #22
0
 public static extern void MakeWeakHandle(HandleProxy* handleProxy);
예제 #23
0
 public static extern HandleProxy* GetObjectPropertyByIndex(HandleProxy* proxy, Int32 index);
예제 #24
0
 public static extern void DisposeHandleProxy(HandleProxy* handle);
예제 #25
0
 public static extern bool DeleteObjectPropertyByName(HandleProxy* proxy, string name);
예제 #26
0
 public static extern int GetHandleManagedObjectID(HandleProxy* handle);
예제 #27
0
 public static unsafe extern void ConnectObject(HandleProxy* handleProxy, Int32 objID, void* templateProxy);