当前位置: 首页>>代码示例>>C#>>正文


C# Entities.GetTypedResponse方法代码示例

本文整理汇总了C#中Entities.GetTypedResponse方法的典型用法代码示例。如果您正苦于以下问题:C# Entities.GetTypedResponse方法的具体用法?C# Entities.GetTypedResponse怎么用?C# Entities.GetTypedResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Entities的用法示例。


在下文中一共展示了Entities.GetTypedResponse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetAnswerCallCompleted

        private void SetAnswerCallCompleted(Entities.ApiResponse obj)
        {
            SetAnswerLogResponse resp = obj.GetTypedResponse<SetAnswerLogResponse>();

            if (resp.anscorrect)
            {
                
                var dialog = new MessageDialog(String.Format("Respuesta Correcta!. Tiempo {0} segundos.", segundosEnResponder));
                dialog.ShowAsync();
            }
            else
            {
                var dialog = new MessageDialog(String.Format("Respuesta incorrecta!. Tiempo {0} segundos.", segundosEnResponder));
                dialog.ShowAsync();
            }

            segundosEnResponder = 0;
            stackOptions.Children.Clear();
            txtQuestion.Text = "Esperando próxima pregunta...";
            timer.Start();

        }
开发者ID:amasolini,项目名称:brid-wp,代码行数:22,代码来源:Trivia.xaml.cs

示例2: CallCompleted

        private async void CallCompleted(Entities.ApiResponse obj)
        {
            try
            {
                answerReceived = DateTime.Now;

                if (obj.JsonResponse != "null")
                {
                    GetGameQuestionsResponse response = obj.GetTypedResponse<GetGameQuestionsResponse>();
                    //stackOptions.Children.Add()
                    timer.Stop();

                    if (response.qid == 100)
                    {

                        var dialog = new MessageDialog("El juego ha finalizado. Chequea el ranking para ver si estas entre los 10 ganadores!");
                        dialog.Commands.Add(new UICommand { Label = "Volver", Id = 0 });

                        // Handles the messagedialog answer.
                        var res = await dialog.ShowAsync();
                        if ((int)res.Id == 0)
                        {
                            Frame.Navigate(typeof(Home));
                            return;
                        }
                    }

                    if (response.answers.Count > 0)
                    {
                        txtQuestion.Text = response.des;
                        BotonTrivia btnTrivia;

                        foreach (GetGameAnswersResponse answer in response.answers)
                        {
                            btnTrivia = new BotonTrivia();

                            btnTrivia.Content = answer.des;
                            btnTrivia.Name = "btnAnswer" + answer.aid;
                            btnTrivia.IsCorrect = (answer.anscorrect == 1);
                            btnTrivia.AnswerId = answer.aid;
                            btnTrivia.QuestionId = answer.qid;

                            var padding = new Thickness();
                            padding.Left = 10;
                            padding.Right = 10;
                            btnTrivia.Margin = padding;

                            btnTrivia.Click += btnTrivia_Click;

                            stackOptions.Children.Add(btnTrivia);
                        }

                    }
                    else
                    {
                        if (!timer.IsEnabled)
                        {
                            timer.Start();
                        }
                    }
                }
                else
                {
                    stackOptions.Children.Clear();
                    txtQuestion.Text = "Esperando próxima pregunta...";
                    timer.Start();
                }
                    

            }
            catch (Exception)
            {

                throw;
            }


        }
开发者ID:amasolini,项目名称:brid-wp,代码行数:78,代码来源:Trivia.xaml.cs


注:本文中的Entities.GetTypedResponse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。