Пример #1
0
        internal static void set(IntPtr gcHandlePtr, out int __retval, IntPtr name_str, int name_length, IntPtr @object, out int object_release, IntPtr value, out int value_release, out IntPtr exception_str, out int exception_length, out IntPtr exception_gc_handle)
        {
            var self = (CfxV8Accessor)System.Runtime.InteropServices.GCHandle.FromIntPtr(gcHandlePtr).Target;

            if (self == null || self.CallbacksDisabled)
            {
                __retval            = default(int);
                object_release      = 1;
                value_release       = 1;
                exception_str       = IntPtr.Zero;
                exception_length    = 0;
                exception_gc_handle = IntPtr.Zero;
                return;
            }
            var e = new CfxV8AccessorSetEventArgs(name_str, name_length, @object, value);

            self.m_Set?.Invoke(self, e);
            e.m_isInvalid  = true;
            object_release = e.m_object_wrapped == null? 1 : 0;
            value_release  = e.m_value_wrapped == null? 1 : 0;
            if (e.m_exception_wrapped != null && e.m_exception_wrapped.Length > 0)
            {
                var exception_pinned = new PinnedString(e.m_exception_wrapped);
                exception_str       = exception_pinned.Obj.PinnedPtr;
                exception_length    = exception_pinned.Length;
                exception_gc_handle = exception_pinned.Obj.GCHandlePtr();
            }
            else
            {
                exception_str       = IntPtr.Zero;
                exception_length    = 0;
                exception_gc_handle = IntPtr.Zero;
            }
            __retval = e.m_returnValue ? 1 : 0;
        }
Пример #2
0
        internal static void set(IntPtr gcHandlePtr, out int __retval, IntPtr name_str, int name_length, IntPtr @object, IntPtr value, ref IntPtr exception_str, ref int exception_length)
        {
            var self = (CfxV8Accessor)System.Runtime.InteropServices.GCHandle.FromIntPtr(gcHandlePtr).Target;

            if (self == null || self.CallbacksDisabled)
            {
                __retval = default(int);
                return;
            }
            var e            = new CfxV8AccessorSetEventArgs(name_str, name_length, @object, value, exception_str, exception_length);
            var eventHandler = self.m_Set;

            if (eventHandler != null)
            {
                eventHandler(self, e);
            }
            e.m_isInvalid = true;
            if (e.m_object_wrapped == null)
            {
                CfxApi.cfx_release(e.m_object);
            }
            if (e.m_value_wrapped == null)
            {
                CfxApi.cfx_release(e.m_value);
            }
            if (e.m_exception_changed)
            {
                var exception_pinned = new PinnedString(e.m_exception_wrapped);
                exception_str    = exception_pinned.Obj.PinnedPtr;
                exception_length = exception_pinned.Length;
            }
            __retval = e.m_returnValue ? 1 : 0;
        }
Пример #3
0
 internal static void EventCall(object sender, CfxV8AccessorSetEventArgs e)
 {
     var call = new CfxV8AccessorSetBrowserProcessCall();
     call.sender = RemoteProxy.Wrap((CfxBase)sender);
     call.eventArgsId = AddEventArgs(e);
     call.RequestExecution(RemoteClient.connection);
     RemoveEventArgs(call.eventArgsId);
 }