本文整理汇总了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();
}
示例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;
}
}