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


C# User.IsMe方法代码示例

本文整理汇总了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;
			}
		}
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:26,代码来源:ListOfTableViewCell.cs

示例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
			{

			}
		}
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:41,代码来源:ProfileHeaderFragment.cs

示例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);
			}
		}
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:21,代码来源:TenServiceHelper.cs

示例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
				{
//.........这里部分代码省略.........
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:101,代码来源:TenServiceHelper.cs

示例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();
		}
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:11,代码来源:TenServiceHelper.cs


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