예제 #1
0
        private async void onLoaded(object sender, RoutedEventArgs routedEventArgs)
        {
            await ApiData.GetApiData();

            await Speechservice.SpeechService.Startup();

            Browser.Navigate(new Uri("http://localhost/home.html"));

            speechRecognition.StartRecognizing();

            TimeSpan period = TimeSpan.FromMinutes(30);

            ThreadPoolTimer.CreatePeriodicTimer(async source =>
            {
                Debug.WriteLine("API Daten werden aktualisiert.");

                await ApiData.GetApiData();

                await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    Browser.Refresh();
                });

                Debug.WriteLine("Anzeige aktualisiert.");
            }, period);
        }
예제 #2
0
        ApiViewData GetModel(string apiname)
        {
            ApiViewData model = new ApiViewData();

            model.Title = apiname;
            model.Data  = db.GetApiData(apiname);
            MomaDataSet.MembersRow row = model.Data.Members[0];
            model.Name   = row.Name;
            model.Status = Util.GetStatus(row);
            if (!row.IsTODOCommentNull())
            {
                model.Comment = row.TODOComment;
            }
            return(model);
        }
        private static async Task ProcessPostRequest(PostQuery requestPostQuery)
        {
            try
            {
                if (requestPostQuery.Value.Count == 0)
                {
                    return;
                }

                bool breakLoop = false;

                foreach (KeyValuePair <string, string> keyValuePair in requestPostQuery.Value)
                {
                    if (breakLoop)
                    {
                        break;
                    }

                    switch (keyValuePair.Key)
                    {
                    case "upperleft":
                        await SetModule(Modules.Upperleft, keyValuePair.Value);

                        break;

                    case "upperright":
                        await SetModule(Modules.Upperright, keyValuePair.Value);

                        break;

                    case "middleleft":
                        await SetModule(Modules.Middleleft, keyValuePair.Value);

                        break;

                    case "middleright":
                        await SetModule(Modules.Middleright, keyValuePair.Value);

                        break;

                    case "lowerleft":
                        await SetModule(Modules.Lowerleft, keyValuePair.Value);

                        break;

                    case "lowerright":
                        await SetModule(Modules.Lowerright, keyValuePair.Value);

                        break;

                    case "City":
                    case "Postal":
                    case "State":
                    case "Country":
                    case "Language":
                        await SetLocation(requestPostQuery.Value);

                        breakLoop = true;
                        break;
                    }
                }

                #pragma warning disable 4014
                ApiData.GetApiData();
                #pragma warning restore 4014
            }
            catch (Exception exception)
            {
                Log.Log.WriteException(exception);
            }
        }