本文整理汇总了C#中IUser.HasNotValue方法的典型用法代码示例。如果您正苦于以下问题:C# IUser.HasNotValue方法的具体用法?C# IUser.HasNotValue怎么用?C# IUser.HasNotValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUser
的用法示例。
在下文中一共展示了IUser.HasNotValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnNavigatedTo
public override async Task OnNavigatedTo(object navigationParameter)
{
modUser = navigationParameter as IUser;
if (modUser.HasNotValue())
return;
IsBusy = true;
IEnumerable<IDialog> dialogs = await modIWebService.GetDialogWithFriend(modUser);
this.Dialogs = new ObservableCollection<DialogVm>(dialogs.Select(x => new DialogVm(x)));
this.OnPropertyChanged(x => x.Dialogs);
IsBusy = false;
}
示例2: GetUserInfoRequest
public async Task<IUser> GetUserInfoRequest(IUser user, enSocialNetwork socialNetwork)
{
if (user.HasNotValue())
return null;
switch (socialNetwork)
{
case enSocialNetwork.VK:
return await GetVkUserInfoRequest(user);
case enSocialNetwork.Twitter:
return await GetTwitterInfoRequest(user);
default:
break;
}
return null;
}
示例3: GetUserInfoRequest
public async Task<IUser> GetUserInfoRequest(IUser user, enSocialNetwork socialNetwork)
{
if (user.HasNotValue())
return null;
Account accCurrent = Account.Deserialize(user.SerializeInfo);
if (accCurrent.HasNotValue())
return null;
if (String.IsNullOrWhiteSpace(user.Uid))
return null;
var request = new OAuth2Request("GET", new Uri("https://api.vk.com/method/users.get"), null, accCurrent);
request.Parameters.Add("uids", user.Uid);
var res = await request.GetResponseAsync();
var responseText = res.GetResponseText();
var users = JsonConvert.DeserializeObject<XamarinSocialApp.Droid.Data.VkData.VkUsers>(responseText);
var jsonUser = users.response.First();
return new DataUser() { FirstName = jsonUser.first_name, LastName = jsonUser.last_name, ID = jsonUser.uid, Uid = jsonUser.uid };
}
示例4: OnNavigatedTo
public override async Task OnNavigatedTo(object navigationParameter)
{
PageDialogWithFriendNavParams param = navigationParameter as PageDialogWithFriendNavParams;
if (param.HasNotValue())
return;
modUser = param.User;
if (modUser.HasNotValue())
return;
modFriend = param.Friend;
IsBusy = true;
IDialog dialog = await modIWebService.GetDialogWithFriend(modUser, modFriend);
this.Messages = new ObservableCollection<MessageVm>(dialog.Messages.Select(x => new MessageVm(x)));
this.OnPropertyChanged(x => x.Messages);
Messenger.Default.Register<MessagesUI.MessageNewMessageWasSentToMe>(this, OnNewMessageWasSentToMe);
Messenger.Default.Register<MessagesUI.MessageNewMyMessageWasSent>(this, OnMessageNewMyMessageWasSent);
IsBusy = false;
}
示例5: OnNavigatedTo
public override async Task OnNavigatedTo(object navigationParameter)
{
modUser = navigationParameter as IUser;
if (modUser.HasNotValue())
return;
IEnumerable<IUser> friends = await modIWebService.GetUserFriends(modUser);
if (friends == null)
return;
IsBusy = true;
this.Friends = new ObservableCollection<FriendsVm>(friends.Select(x => new FriendsVm(x)));
this.OnPropertyChanged(x => x.Friends);
IsBusy = false;
}