Пример #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);