// PUBLIC FUNCTIONS EXPOSED TO JAVASCRIPT as io.nodekit.process.* public void nextTick(NKScriptValue callback) { Task.Factory.StartNew(() => { callback.callWithArguments(new object[] { }); }); }
public void close() { if (_nsTimer != null) { _nsTimer.Cancel(); _nsTimer = null; } _repeatPeriod = 0; _handler = null; this.getNKScriptValue().invokeMethod("dispose", new object[] { }); }
public void showMessageBox(NKE_BrowserWindow browserWindow, Dictionary<string, object> options, NKScriptValue callback) { string caption = NKOptions.itemOrDefault(options, "title", ""); string message = NKOptions.itemOrDefault(options, "message", ""); string [] buttonArray = NKOptions.itemOrDefault(options, "buttons", new string[] { "OK" }); string detail = NKOptions.itemOrDefault(options, "detail", ""); MessageBoxIcon icon; switch (detail) { case "info": icon = MessageBoxIcon.Information; break; case "warning": icon = MessageBoxIcon.Warning; break; case "error": icon = MessageBoxIcon.Error; break; default: icon = MessageBoxIcon.None; break; } MessageBoxButtons buttons = buttons = MessageBoxButtons.OK; if ((Array.IndexOf(buttonArray, "OK") > -1) && (Array.IndexOf(buttonArray, "Cancel") > -1)) buttons = MessageBoxButtons.OKCancel; else if (Array.IndexOf(buttonArray, "OK") > -1) buttons = MessageBoxButtons.OK; else if ((Array.IndexOf(buttonArray, "Abort") > -1) && (Array.IndexOf(buttonArray, "Retry") > -1) && (Array.IndexOf(buttonArray, "Ignore") > -1)) buttons = MessageBoxButtons.AbortRetryIgnore; else if ((Array.IndexOf(buttonArray, "Yes") > -1) && (Array.IndexOf(buttonArray, "No") > -1) && (Array.IndexOf(buttonArray, "Cancel") > -1)) buttons = MessageBoxButtons.YesNoCancel; else if ((Array.IndexOf(buttonArray, "Yes") > -1) && (Array.IndexOf(buttonArray, "No") > -1)) buttons = MessageBoxButtons.YesNo; else if ((Array.IndexOf(buttonArray, "Retry") > -1) && (Array.IndexOf(buttonArray, "Cancel") > -1)) buttons = MessageBoxButtons.RetryCancel; DialogResult result = MessageBox.Show(message, caption, buttons, icon); if (callback != null) callback.callWithArguments(new object[] { result.ToString() }); }
public void showMessageBox(NKE_BrowserWindow browserWindow, Dictionary<string, object> options, NKScriptValue callback) { string title = NKOptions.itemOrDefault(options, "title", ""); string message = NKOptions.itemOrDefault(options, "message", ""); string[] buttonArray = NKOptions.itemOrDefault(options, "buttons", new string[] { "OK" }); string detail = NKOptions.itemOrDefault(options, "detail", ""); MessageDialog msgbox = new MessageDialog(message, title); msgbox.Commands.Clear(); int count = 0; foreach (var item in buttonArray) { msgbox.Commands.Add(new UICommand { Label = item, Id = count++ }); } var t = msgbox.ShowAsync(); if (callback != null) t.AsTask().ContinueWith((u) => callback.callWithArguments(new object[] { u.Result.Label })); }
public void savePage(string fullstring, string saveType, NKScriptValue callback) { throw new NotImplementedException(); }
public void close() { if (_nsTimer != null) { _nsTimer.Stop(); _nsTimer.Dispose(); _nsTimer = null; } _repeatPeriod = 0; _handler = null; this.getNKScriptValue().invokeMethod("dispose", new object[] { }); }
public void showSaveDialog(NKE_BrowserWindow browserWindow, Dictionary<string, object> options, NKScriptValue callback) { throw new NotImplementedException(); }
public void unregisterServiceWorker(NKScriptValue callback) { throw new NotImplementedException(); }
public void setOnTimeout(NKScriptValue handler) { _handler = handler; }
internal static void setNKScriptValue(this object obj, NKScriptValue value) { if (value != null) dictionary[obj] = value; else dictionary.Remove(obj); }
public void printToPDF(Dictionary<string, object> options, NKScriptValue callback) { throw new NotImplementedException(); }
public void showSaveDialog(NKE_BrowserWindow browserWindow, Dictionary <string, object> options, NKScriptValue callback) { throw new NotImplementedException(); }
public void showMessageBox(NKE_BrowserWindow browserWindow, Dictionary <string, object> options, NKScriptValue callback) { string title = NKOptions.itemOrDefault(options, "title", ""); string message = NKOptions.itemOrDefault(options, "message", ""); string[] buttonArray = NKOptions.itemOrDefault(options, "buttons", new string[] { "OK" }); string detail = NKOptions.itemOrDefault(options, "detail", ""); MessageDialog msgbox = new MessageDialog(message, title); msgbox.Commands.Clear(); int count = 0; foreach (var item in buttonArray) { msgbox.Commands.Add(new UICommand { Label = item, Id = count++ }); } var t = msgbox.ShowAsync(); if (callback != null) { t.AsTask().ContinueWith((u) => callback.callWithArguments(new object[] { u.Result.Label })); } }
public void beginFrameSubscription(NKScriptValue callback) { throw new NotImplementedException(); }
public void capturePage(Dictionary <string, object> rect, NKScriptValue callback) { throw new NotImplementedException(); }
public void hookWindowMessage(int message, NKScriptValue callback) { throw new NotImplementedException(); }
public void capturePage(Dictionary<string, object> rect, NKScriptValue callback) { throw new NotImplementedException(); }
public void showMessageBox(NKE_BrowserWindow browserWindow, Dictionary <string, object> options, NKScriptValue callback) { string caption = NKOptions.itemOrDefault(options, "title", ""); string message = NKOptions.itemOrDefault(options, "message", ""); string [] buttonArray = NKOptions.itemOrDefault(options, "buttons", new string[] { "OK" }); string detail = NKOptions.itemOrDefault(options, "detail", ""); MessageBoxIcon icon; switch (detail) { case "info": icon = MessageBoxIcon.Information; break; case "warning": icon = MessageBoxIcon.Warning; break; case "error": icon = MessageBoxIcon.Error; break; default: icon = MessageBoxIcon.None; break; } MessageBoxButtons buttons = buttons = MessageBoxButtons.OK; if ((Array.IndexOf(buttonArray, "OK") > -1) && (Array.IndexOf(buttonArray, "Cancel") > -1)) { buttons = MessageBoxButtons.OKCancel; } else if (Array.IndexOf(buttonArray, "OK") > -1) { buttons = MessageBoxButtons.OK; } else if ((Array.IndexOf(buttonArray, "Abort") > -1) && (Array.IndexOf(buttonArray, "Retry") > -1) && (Array.IndexOf(buttonArray, "Ignore") > -1)) { buttons = MessageBoxButtons.AbortRetryIgnore; } else if ((Array.IndexOf(buttonArray, "Yes") > -1) && (Array.IndexOf(buttonArray, "No") > -1) && (Array.IndexOf(buttonArray, "Cancel") > -1)) { buttons = MessageBoxButtons.YesNoCancel; } else if ((Array.IndexOf(buttonArray, "Yes") > -1) && (Array.IndexOf(buttonArray, "No") > -1)) { buttons = MessageBoxButtons.YesNo; } else if ((Array.IndexOf(buttonArray, "Retry") > -1) && (Array.IndexOf(buttonArray, "Cancel") > -1)) { buttons = MessageBoxButtons.RetryCancel; } DialogResult result = MessageBox.Show(message, caption, buttons, icon); if (callback != null) { callback.callWithArguments(new object[] { result.ToString() }); } }
public void printToPDF(Dictionary <string, object> options, NKScriptValue callback) { throw new NotImplementedException(); }