示例#1
0
 public static IntPtr GetCookie(Delegate d)
 {
     if (d == null)
     {
         throw new ArgumentNullException("d");
     }
     return(NSJSFunction.DelegateToFunctionPtr(d));
 }
示例#2
0
        public static NSJSFunction New(NSJSVirtualMachine machine, NSJSFunctionCallback2 value)
        {
            IntPtr address = NULL;

            if (value != null)
            {
                address = NSJSFunction.DelegateToFunctionPtr(value);
            }
            return(InternalNew(machine, address));
        }
示例#3
0
        private void InternalJoin(Delegate callback, object state)
        {
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }
            IntPtr ptr = MarshalAs.ObjectToIUnknown(state);

            nsjs_virtualmachine_join(this.Handle, NSJSFunction.DelegateToFunctionPtr(callback), ptr);
        }
示例#4
0
        private void InternalJoin(Delegate callback, IntPtr state)
        {
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }
            IntPtr machine  = this.Handle;
            IntPtr function = NSJSFunction.DelegateToFunctionPtr(callback);

            nsjs_virtualmachine_join(machine, function, state);
        }
示例#5
0
            private ExtensionObjectTemplate(Delegate constructor)
            {
                IntPtr address = NULL;

                if (constructor != null)
                {
                    address = NSJSFunction.DelegateToFunctionPtr(constructor);
                }
                this.Handle = nsjs_virtualmachine_extension_object_template_new(address);
                if (this.Handle == NULL)
                {
                    throw new InvalidOperationException("Unable to create handle");
                }
            }
示例#6
0
 private bool InternalSet(string key, Delegate value)
 {
     if (value == null)
     {
         throw new ArgumentNullException("value");
     }
     return(this.Set(key, (name) => nsjs_localvalue_object_property_set_function(this.Isolate, this.Handle, name, NSJSFunction.DelegateToFunctionPtr(value))));
 }
示例#7
0
 private bool InternalSet(string name, Delegate value, PropertyAttribute attributes)
 {
     return(Handling <bool>(name, (s) => nsjs_virtualmachine_extension_object_template_set_function(this.Handle, s, NSJSFunction.DelegateToFunctionPtr(value), attributes)));
 }