private IJavaScriptValue Echo(JavaScriptEngine source, bool construct, IJavaScriptValue thisValue, IEnumerable<IJavaScriptValue> args) { string arg = args.First().ToString(); arg = arg.Replace("{", "{{").Replace("}", "}}"); Log.Message(string.Format(arg, (object[])args.Skip(1).ToArray())); if (arg == "toast promise done") { Assert.Succeeded(); } return source.UndefinedValue; }
private IJavaScriptValue EchoForProjectedNamespace(JavaScriptEngine source, bool construct, IJavaScriptValue thisValue, IEnumerable<IJavaScriptValue> args) { string arg = args.First().ToString(); arg = arg.Replace("{", "{{").Replace("}", "}}"); Debug.WriteLine(string.Format(arg, (object[])args.Skip(1).ToArray())); if (arg == "toast promise done") { successSignal.SetResult(0); } return source.UndefinedValue; }
private IJavaScriptValue Echo(JavaScriptEngine source, bool construct, IJavaScriptValue thisValue, IEnumerable <IJavaScriptValue> args) { string arg = args.First().ToString(); arg = arg.Replace("{", "{{").Replace("}", "}}"); Log.Message(string.Format(arg, (object[])args.Skip(1).ToArray())); if (arg == "toast promise done") { Assert.Succeeded(); } return(source.UndefinedValue); }
public bool SetProperty(string name, IJavaScriptValue value) { ThrowIfDisposed(); PropertyInfo property; var nativeObject = NativeObject; if (nativeObject == null || !_properties.TryGetValue(name, out property)) { return(false); } var convertedValue = value.GetConvertedValue(property); property.SetValue(nativeObject, convertedValue, null); return(true); }
private IJavaScriptValue Echo(JavaScriptEngine source, bool construct, IJavaScriptValue thisValue, IEnumerable <IJavaScriptValue> args) { Log.Message(string.Format(args.First().ToString(), (object[])args.Skip(1).ToArray())); return(source.UndefinedValue); }
private IJavaScriptValue Echo(JavaScriptEngine source, bool construct, IJavaScriptValue thisValue, IEnumerable<IJavaScriptValue> args) { Log.Message(string.Format(args.First().ToString(), (object[])args.Skip(1).ToArray())); return source.UndefinedValue; }
private IJavaScriptValue Success(JavaScriptEngine source, bool construct, IJavaScriptValue thisValue, IEnumerable <IJavaScriptValue> args) { successSignal.SetResult(0); return(source.UndefinedValue); }
private IJavaScriptValue EchoForProjectedNamespace(JavaScriptEngine source, bool construct, IJavaScriptValue thisValue, IEnumerable <IJavaScriptValue> args) { string arg = args.First().ToString(); arg = arg.Replace("{", "{{").Replace("}", "}}"); Debug.WriteLine(string.Format(arg, (object[])args.Skip(1).ToArray())); if (arg == "toast promise done") { successSignal.SetResult(0); } return(source.UndefinedValue); }
private IJavaScriptValue MessageDialog(JavaScriptEngine source, bool construct, IJavaScriptValue thisValue, IEnumerable <IJavaScriptValue> args) { if (!construct) { var undefined = source.UndefinedValue; source.SetException(source.CreateTypeError("Must call as a constructor.")); return(undefined); } var dlg = new MessageDialog(args.First().ToString()); return(source.Converter.FromWindowsRuntimeObject(dlg)); }
private IJavaScriptValue EchoForNoNamespace(JavaScriptEngine source, bool construct, IJavaScriptValue thisValue, IEnumerable <IJavaScriptValue> args) { string arg = args.First().ToString(); Assert.AreEqual("callback completed", arg); successSignal.SetResult(0); return(source.UndefinedValue); }
private IJavaScriptValue Failure(JavaScriptEngine source, bool construct, IJavaScriptValue thisValue, IEnumerable <IJavaScriptValue> args) { Assert.Fail(); return(source.UndefinedValue); }
private IJavaScriptValue Success(JavaScriptEngine source, bool construct, IJavaScriptValue thisValue, IEnumerable<IJavaScriptValue> args) { successSignal.SetResult(0); return source.UndefinedValue; }
private IJavaScriptValue MessageDialog(JavaScriptEngine source, bool construct, IJavaScriptValue thisValue, IEnumerable<IJavaScriptValue> args) { if (!construct) { var undefined = source.UndefinedValue; source.SetException(source.CreateTypeError("Must call as a constructor.")); return undefined; } var dlg = new MessageDialog(args.First().ToString()); return source.Converter.FromWindowsRuntimeObject(dlg); }
private IJavaScriptValue EchoForNoNamespace(JavaScriptEngine source, bool construct, IJavaScriptValue thisValue, IEnumerable<IJavaScriptValue> args) { string arg = args.First().ToString(); Assert.AreEqual("callback completed", arg); successSignal.SetResult(0); return source.UndefinedValue; }
private IJavaScriptValue Failure(JavaScriptEngine source, bool construct, IJavaScriptValue thisValue, IEnumerable<IJavaScriptValue> args) { Assert.Fail(); return source.UndefinedValue; }