本文整理汇总了C#中User.IsMe方法的典型用法代码示例。如果您正苦于以下问题:C# User.IsMe方法的具体用法?C# User.IsMe怎么用?C# User.IsMe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User
的用法示例。
在下文中一共展示了User.IsMe方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindDataToCell
public void BindDataToCell(User user, NSIndexPath indexPath, UITableView tableView){
CellUserImage.Layer.CornerRadius = 8;
CellUserImage.ClipsToBounds = true;
CellUserImage.SetImage (NSUrl.FromString (StringUtils.GetProfileImageURL(user)), UIImage.FromBundle("MyProfile"), delegate(UIImage image, NSError error, SDImageCacheType cacheType, NSUrl imageUrl) {
});
CellUsernameLabel.Text = user.username;
CellActionButton.SetImage(user.friended);
CellActionButton.RemoveTarget(null, null, UIControlEvent.TouchUpInside);
CellActionButton.TouchUpInside += async delegate {
bool results = await TenServiceHelper.SendFollowRequest(user, CellActionButton);
if (results)
{
tableView.ReloadRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.None);
}
};
if (user.IsMe()){
CellActionButton.Hidden = true;
} else {
CellActionButton.Hidden = false;
}
}
示例2: FetchHeaderData
async public Task FetchHeaderData()
{
try
{
Profile result;
if (User.IsMe())
{
result = await TenServices.FullProfile(Globe.SharedInstance.User, true);
}
else {
result = await TenServices.FullProfile(User, false);
}
User = result.user;
Master.User = User;
await Master.FetchTableData();
if (!User.IsMe())
{
if (User.blocked)
{
UserIsBlocked(false);
}
else {
UserIsNotBlocked(result);
}
}
else {
UserIsNotBlocked(result);
}
}
catch (RESTError)
{
}
finally
{
}
}
示例3: GoToGuestProfile
public static void GoToGuestProfile(User user)
{
if (user.IsMe())
{//cannot visit own profile via guest class
return;
}
if (user.idUser != Globe.SharedInstance.User.idUser)
{
user.username = StringUtils.TrimUnwantedCharactersFromUsername(user.username);
ProfileViewController vc = (ProfileViewController)((AppDelegate)UIApplication.SharedApplication.Delegate).TabBarController.Storyboard.InstantiateViewController("ProfileViewController");
vc.Guest = user;
UITabBarController TabBarController = ((AppDelegate)UIApplication.SharedApplication.Delegate).TabBarController;
UINavigationController NavigationController = ((UINavigationController)TabBarController.ViewControllers[TabBarController.SelectedIndex]);
((NavigationController.ViewControllers[NavigationController.ViewControllers.Length - 1])).NavigationController.PushViewController(vc, true);
}
}
示例4: SendFollowRequest
public static async Task<bool> SendFollowRequest(User user, UIButton followButton)
{
if (user.IsMe())
{
return false;
}
//unfriend
if (user.friended == Strings.friended_friended)
{
user.friended = Strings.friended_none;
followButton.SetImage(UIImage.FromBundle("Follow"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Follow"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Follow"), UIControlState.Normal);
try
{
bool result = await TenServices.SendUnfollowRequest(user);
if (!result)
{
if (user.isprivate)
{
user.friended = Strings.friended_pending;
followButton.SetImage(UIImage.FromBundle("Requested"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Requested"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Requested"), UIControlState.Normal);
}
else {
user.friended = Strings.friended_friended;
followButton.SetImage(UIImage.FromBundle("Following"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Following"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Following"), UIControlState.Normal);
}
}
return result;
}
catch (RESTError)
{
if (user.isprivate)
{
user.friended = Strings.friended_pending;
followButton.SetImage(UIImage.FromBundle("Requested"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Requested"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Requested"), UIControlState.Normal);
}
else {
user.friended = Strings.friended_friended;
followButton.SetImage(UIImage.FromBundle("Following"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Following"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Following"), UIControlState.Normal);
}
}
}
else if (user.friended == Strings.friended_pending)
{
user.friended = Strings.friended_none;
followButton.SetImage(UIImage.FromBundle("Follow"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Follow"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Follow"), UIControlState.Normal);
try
{
bool results = await TenServices.CancelFollowRequest(user);
if (!results)
{
user.friended = Strings.friended_pending;
followButton.SetImage(UIImage.FromBundle("Requested"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Requested"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Requested"), UIControlState.Normal);
}
return results;
}
catch (RESTError)
{
user.friended = Strings.friended_pending;
followButton.SetImage(UIImage.FromBundle("Requested"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Requested"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Requested"), UIControlState.Normal);
}
}
//friend
else {
if (user.isprivate)
{
user.friended = Strings.friended_pending;
followButton.SetImage(UIImage.FromBundle("Requested"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Requested"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Requested"), UIControlState.Normal);
}
else {
user.friended = Strings.friended_friended;
followButton.SetImage(UIImage.FromBundle("Following"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Following"), UIControlState.Normal);
followButton.SetImage(UIImage.FromBundle("Following"), UIControlState.Normal);
}
try
{
//.........这里部分代码省略.........
示例5: GoToGuestProfile
public static void GoToGuestProfile (Android.Support.V4.App.FragmentManager fragmentManager, int containerId, User user)
{
if (user.IsMe())
{
return;
}
ProfileFragment fragment = new ProfileFragment();
fragment.Guest = user;
fragmentManager.BeginTransaction().Add(containerId, fragment).AddToBackStack(null).Commit();
}