Пример #1
0
 /**
  * Return a derivative of SDKTestDefault
  */
 public SDKTestDefault ReturnADerivedObject()
 {
     return(Engine.JsWithReturn(() =>
     {
         dynamic returnValue = this.impl.returnADerivedObject();
         return (Engine.IsNullOrUndefined(returnValue) ? null : SDKTestDefault.NativeInstanceForObject(returnValue));
     }));
 }
 /**
  * Test derived classes
  */
 public static SDKTestDefault GetDerived()
 {
     return(Engine.JsWithReturn(() =>
     {
         dynamic returnValue = Engine.GetJsClass("SDKTestDefaultSubclass").getDerived();
         return (Engine.IsNullOrUndefined(returnValue) ? null : SDKTestDefault.NativeInstanceForObject(returnValue));
     }));
 }
        /**
         * Test derived classes
         */
        public static SDKTestDefault GetDerived()
        {
            JsValue[] args    = new JsValue[] {};
            var       jsClass = Engine.GetJsClass("SDKTestDefaultSubclass");
            var       func    = jsClass.Get("getDerived").As <FunctionInstance>();

            return(Engine.JsWithReturn(() => {
                var returnValue = func.Call(jsClass, args);
                return ((returnValue.IsNull() || returnValue.IsUndefined()) ? null : SDKTestDefault.NativeInstanceForObject(returnValue.AsObject()));
            }));
        }
Пример #4
0
        } /**
           * Return a derivative of SDKTestDefault
           */

        public SDKTestDefault ReturnADerivedObject()
        {
            JsValue[] args = new JsValue[] {};

            var func = this.impl.Get("returnADerivedObject").As <FunctionInstance>();

            return(Engine.JsWithReturn(() => {
                var returnValue = func.Call(this.impl, args);
                return ((returnValue.IsNull() || returnValue.IsUndefined()) ? null : SDKTestDefault.NativeInstanceForObject(returnValue.AsObject()));
            }));
        } /**
Пример #5
0
 private Action <dynamic> WrapDelegate(FakeEventDelegate _delegate)
 {
     return(new Action <dynamic>((item) => {
         _delegate(this, (Engine.IsNullOrUndefined(item) ? null : SDKTestDefault.NativeInstanceForObject(item)));
     }));
 }
Пример #6
0
 /**
  * Return one SDKTestDefault and one derived
  */
 public List <SDKTestDefault> ReturnBaseAndDerived()
 {
     return(Engine.JsWithReturn(() =>
     {
         dynamic returnValue = this.impl.returnBaseAndDerived();
         return Engine.Converter.ToNativeArray((object)returnValue, (element) => (Engine.IsNullOrUndefined(element) ? null : SDKTestDefault.NativeInstanceForObject(element)));
     }));
 }
Пример #7
0
 private ClrFunctionInstance WrapDelegate(FakeEventDelegate _delegate)
 {
     return(Engine.AsJsFunction(new Func <JsValue, JsValue[], JsValue>((thisObject, args) => {
         _delegate(this, ((args[0].IsNull() || args[0].IsUndefined()) ? null : SDKTestDefault.NativeInstanceForObject(args[0].AsObject())));
         return JsValue.Undefined;
     })));
 }
Пример #8
0
        } /**
           * Return one SDKTestDefault and one derived
           */

        public List <SDKTestDefault> ReturnBaseAndDerived()
        {
            JsValue[] args = new JsValue[] {};

            var func = this.impl.Get("returnBaseAndDerived").As <FunctionInstance>();

            return(Engine.JsWithReturn(() => {
                var returnValue = func.Call(this.impl, args);
                return Engine.Converter.ToNativeArray(returnValue, new Func <JsValue, SDKTestDefault>((element) => ((element.IsNull() || element.IsUndefined()) ? null : SDKTestDefault.NativeInstanceForObject(element.AsObject()))));
            }));
        } /**