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

            if (value != null)
            {
                address = NSJSFunction.DelegateToFunctionPtr(value);
            }
            return(InternalNew(machine, address));
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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");
                }
            }
Exemplo n.º 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))));
 }
Exemplo n.º 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)));
 }