예제 #1
0
        public void ShowConfiguration(IWatchItem item)
        {
            try
            {
                if (!_Pebble.EventListeners.ContainsKey("showConfiguration"))
                {
                    return;
                }

                var jsfunction = _Pebble.EventListeners["showConfiguration"];

                System.Func <Jint.Native.JsValue, Jint.Native.JsValue[], Jint.Native.JsValue> _func = jsfunction as System.Func <Jint.Native.JsValue, Jint.Native.JsValue[], Jint.Native.JsValue>;

                Jint.Native.JsValue   A = new JsValue(1);
                Jint.Native.JsValue[] B = new Jint.Native.JsValue[1];

                Jint.Native.Json.JsonParser _jsp = new Jint.Native.Json.JsonParser(_JintEngine);
                B[0] = _jsp.Parse("{}");

                Jint.Native.JsValue C = _func.Invoke(A, B);
            }
            catch (Jint.Runtime.JavaScriptException exp)
            {
                String Exception = String.Format("{0}" + Environment.NewLine + "Line: {1}" + Environment.NewLine + "Source: {2}",
                                                 exp.Message,
                                                 exp.LineNumber,
                                                 _JavascriptLines[exp.LineNumber - 1]);

                throw new System.Exception(Exception);
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }
        private void PebbleJS_OpenURL(object sender, EventArgs e)
        {
            PebbleKitJS.URLEventArgs _uea = (PebbleKitJS.URLEventArgs)e;
            _WatchAppConfig = _uea.WatchItem;

            ConfigWebView.Navigate(new Uri(_uea.URL));
            ConfigWebView.Visibility = Visibility.Visible;
        }
예제 #3
0
 public Pebble(IWatchItem _ParentItem)
 {
     ParentItem = _ParentItem;
 }
예제 #4
0
 public PebbleKitJS(IWatchItem ParentItem)
 {
     _ParentItem = ParentItem;
     _Pebble     = new Pebble(_ParentItem);
 }
예제 #5
0
 public LocalStorage(IWatchItem ParentItem)
 {
     StorageContainer = new Dictionary <Guid, Dictionary <string, string> >();
     _ParentItem      = ParentItem;
 }