本文整理汇总了C#中ApiResponse.GetTypedResponse方法的典型用法代码示例。如果您正苦于以下问题:C# ApiResponse.GetTypedResponse方法的具体用法?C# ApiResponse.GetTypedResponse怎么用?C# ApiResponse.GetTypedResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApiResponse
的用法示例。
在下文中一共展示了ApiResponse.GetTypedResponse方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CallCompleted
public void CallCompleted(ApiResponse result)
{
RadioGroup radioGrupo = new RadioGroup();
List<GetSurveyQuestionsResponse> response = result.GetTypedResponse<List<GetSurveyQuestionsResponse>>();
foreach (GetSurveyQuestionsResponse item in response)
{
radioGrupo = new RadioGroup();
radioGrupo.Text(item.des);
radioGrupo.IdPregunta = item.qid;
foreach (var itemAnswers in item.answers)
{
RadioButton radio = new RadioButton();
radio.Style = App.Current.Resources["RadioBridgstone"] as Style; ;
radio.Content = itemAnswers.des;
radio.Name = itemAnswers.aid.ToString();
radio.Margin = new Thickness(10, 0, 0, 0);
radio.Foreground = new SolidColorBrush(Color.FromArgb(0xFF, 0x47, 0x44, 0x44));
radio.BorderBrush = new SolidColorBrush(Color.FromArgb(0xFF, 0x8C, 0x8A, 0x8B));
radioGrupo.addChildren(radio);
}
stackBody.Children.Add(radioGrupo);
}
}
示例2: CallCompleted
public void CallCompleted(ApiResponse result)
{
int dia = 0;
DateTime comienzoEvento;
Accordion accActual = new Accordion();
RowAccordion fila;
List<GetScheduleResponse> response = result.GetTypedResponse<List<GetScheduleResponse>>();
comienzoEvento = SettingsManager.EventSingleton.start;
foreach (GetScheduleResponse item in response)
{
if (item.day != dia)
{
accActual = new Accordion();
accActual.Titulo = comienzoEvento.AddDays(dia).ToString("dd MMMM yyyy", new CultureInfo("es-ES"));
accActual.Descripcion = item.place;
stackBody.Children.Add(accActual);
fila = accActual.AddRow();
fila.Hora = item.start;
fila.Titulo = item.title;
fila.Descripcion = item.place;
}
else
{
fila = accActual.AddRow();
fila.Hora = item.start;
fila.Titulo = item.title;
fila.Descripcion = item.place;
}
dia = item.day;
}
//if (!string.IsNullOrEmpty(response.name))
//{
// TODO: Save the information in the localstorage.
//SettingsManager.LoggedUserSingleton = response;
//SettingsManager.SaveSetting(SettingsManager.SettingsConstants.LOGGED_USER.ToString(), JsonConvert.SerializeObject(response));
//Frame.Navigate(typeof(Home));
//}
//else
//{
// // TODO: Display an error.
//}
}
示例3: CallCompleted
public void CallCompleted(ApiResponse result)
{
SetAssistResponse response = result.GetTypedResponse<SetAssistResponse>();
if (!string.IsNullOrEmpty(response.name))
{
// TODO: Save the information in the localstorage.
SettingsManager.LoggedUserSingleton = response;
SettingsManager.SaveSetting(SettingsManager.SettingsConstants.LOGGED_USER.ToString(), JsonConvert.SerializeObject(response));
Frame.Navigate(typeof(Home));
}
else
{
// TODO: Display an error.
}
}
示例4: CallCompleted2
public void CallCompleted2(ApiResponse result)
{
Debug.WriteLine(result.GetTypedResponse<GetEventResponse>().title);
}
示例5: CallCompleted
private async void CallCompleted(ApiResponse result)
{
SetUserQuestionRequest response = result.GetTypedResponse<SetUserQuestionRequest>();
txtMensaje.Text = "";
var dialog = new MessageDialog("Consulta enviada con éxito.");
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;
}
}
示例6: CallNotificationsCompleted
public void CallNotificationsCompleted(ApiResponse result)
{
List<GetNotificationsResponse> response = result.GetTypedResponse<List<GetNotificationsResponse>>();
if (response != null)
{
//TODO: Save the information in the localstorage.
SettingsManager.NotificationsSingleton = response;
if (response.Count > 0) response.Remove(response.Last());
SettingsManager.SaveSetting(SettingsManager.SettingsConstants.NOTIFICATIONS.ToString(), JsonConvert.SerializeObject(response));
}
else
{
// TODO: Display an error.
}
}
示例7: CallCompleted
public void CallCompleted(ApiResponse result)
{
GetEventResponse response = result.GetTypedResponse<GetEventResponse>();
if (response != null)
{
//TODO: Save the information in the localstorage.
SettingsManager.EventSingleton = response;
SettingsManager.SaveSetting(SettingsManager.SettingsConstants.EVENT.ToString(), JsonConvert.SerializeObject(response));
}
else
{
// TODO: Display an error.
}
}