Ejemplo n.º 1
0
 public void SetReturnValue(NSJSFunctionCallback2 callback)
 {
     if (callback == null)
     {
         this.SetReturnValue(NSJSValue.Null(this.VirtualMachine));
         return;
     }
     this.SetReturnValue(NSJSFunction.New(This.VirtualMachine, callback));
 }
Ejemplo 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));
        }
Ejemplo n.º 3
0
 static DataTableGateway()
 {
     NSJSVirtualMachine.ExtensionObjectTemplate owner = new NSJSVirtualMachine.
                                                        ExtensionObjectTemplate();
     ClassTemplate = owner;
     owner.Set("New", NSJSPinnedCollection.Pinned <NSJSFunctionCallback2>(New));
     owner.Set("Invalid", NSJSPinnedCollection.Pinned <NSJSFunctionCallback2>(Invalid));
     g_CloseProc            = NSJSPinnedCollection.Pinned <NSJSFunctionCallback2>(Close);
     g_SelectProc           = NSJSPinnedCollection.Pinned <NSJSFunctionCallback2>(Select);
     g_ExecuteNonQueryProc  = NSJSPinnedCollection.Pinned <NSJSFunctionCallback2>(ExecuteNonQuery);
     g_DeriveParametersProc = NSJSPinnedCollection.Pinned <NSJSFunctionCallback2>(DeriveParameters);
     g_BeginTransactionProc = NSJSPinnedCollection.Pinned <NSJSFunctionCallback>(BeginTransaction);
 }
Ejemplo n.º 4
0
 public virtual void DefineProperty(string key, NSJSFunctionCallback get, NSJSFunctionCallback2 set)
 {
     this.InternalDefineProperty(key, (machine, function) =>
     {
         NSJSValue[] s = new NSJSValue[]
         {
             this,
             NSJSString.New(machine, key),
             get == null ? NSJSValue.Undefined(machine) : NSJSFunction.New(machine, get),
             set == null ? NSJSValue.Undefined(machine) : NSJSFunction.New(machine, set),
         };
         function.Call(s);
     });
 }
Ejemplo n.º 5
0
 public virtual bool Set(string key, NSJSFunctionCallback2 value)
 {
     return(InternalSet(key, value));
 }
Ejemplo n.º 6
0
 public virtual bool Set(string name, NSJSFunctionCallback2 value, PropertyAttribute attributes = PropertyAttribute.None)
 {
     return(InternalSet(name, value, attributes));
 }
Ejemplo n.º 7
0
 public ExtensionObjectTemplate(NSJSFunctionCallback2 constructor) : this((Delegate)constructor)
 {
 }