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


C# Usr.Link方法代码示例

本文整理汇总了C#中Bobs.Usr.Link方法的典型用法代码示例。如果您正苦于以下问题:C# Usr.Link方法的具体用法?C# Usr.Link怎么用?C# Usr.Link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bobs.Usr的用法示例。


在下文中一共展示了Usr.Link方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getSpottedDisplayHtml

		private string getSpottedDisplayHtml(Usr usr)
		{
			if (usr.NickName != "")
			{
				return usr.Link();
			}
			if (Usr.Current != null)
			{
				try
				{
					Buddy b = new Buddy(Usr.Current.K, usr.K);
					return "<span onmouseover=\"stt('" + usr.Email + "');\" onmouseout=\"htm();\">" + (b.SkeletonName != "" ? b.SkeletonName : usr.Email.TruncateWithDots(10) )+ "</span>";
					
				}
				catch (BobNotFound) { }
			}

			return null;
		}
开发者ID:davelondon,项目名称:dontstayin,代码行数:19,代码来源:Photo.cs

示例2: dsiTagReplacement


//.........这里部分代码省略.........
						height = [height]
						nsfw = [true | false] (optional)
						play = [true | false] (optional)
						loop = [true | false] (optional)
						menu = [true | false] (optional)
						quality = [low | autolow | autohigh | medium | high | best] (optional)
						scale = [default | noorder | exactfit] (optional)
						align = [l | t | r | b] (optional)
						salign = [l | t | r | b | tl | tr | bl | br] (optional)
						wmode = [window | opaque | transparent] (optional)
						bgcolor = [colour] (optional)
						base = [base-url] (optional)
						flashvars = [flashvars] (optional)
						/>
					*/
					string swfUrl = attributes.ContainsKey("src") ? attributes["src"] : null;
					return getFlashAttributesFromSgml(uniqueId, swfUrl, attributes);
					#endregion
				}
				else if (tagName == "dsi:quote")
				{
					#region dsi:quote
					Usr u = null;
					try
					{
						u = new Usr(int.Parse(refAtt));
					}
					catch { }

					if (u != null)
					{
						StringBuilder sb = new StringBuilder();
						sb.Append("<div class=\"QuoteName\">");
						sb.Append(u.Link());
						sb.Append(" said:");
						sb.Append("</div>");
						sb.Append("<div class=\"QuoteBody\">");
						return sb.ToString();
					}
					else
					{
						return "<div class=\"QuoteBody\">";
					}
					#endregion
				}
				else if (tagName == "dsi:object" || tagName == "dsi:link")
				{
					#region dsi:object, dsi:link
					/*
					<dsi:object
						type = [usr | event | venue | place | group | brand | photo | misc]
						ref = [object-k]
						style = [
							content: {text* | icon | text-under-icon};   // for type=usr, event, venue, place, group, brand
							details: {none* | venue | place | country};  // for type=event, venue, place
							date: {false* | true};                       // for type=event
							snip: {number};                              // for type=event
							rollover: {true* | false}                    // for type=usr, photo
							photo: {icon* | thumb | web}                 // for type=photo
							link: {true* | false}
						]
					/>
					*/

					string app = attributes.ContainsKey("app") ? (attributes["app"] == "home" ? null : attributes["app"]) : null;
					string date = attributes.ContainsKey("date") ? attributes["date"].Replace('-', '/') : null;
开发者ID:davelondon,项目名称:dontstayin,代码行数:67,代码来源:HtmlRenderer.cs

示例3: loginAndSetAuthCookie

		static void loginAndSetAuthCookie(Usr u, Hashtable returnValue, string facebookAccessToken)
		{
			//normal login stuff
			u.LoginCount++;
			u.DateTimeLastAccess = DateTime.Now;
			if (facebookAccessToken.Length > 0)
				u.FacebookAccessToken = facebookAccessToken;
			u.Update();
			u.LogInAsThisUserDontSetCookieNew();
			

			Hashtable authUsr = new Hashtable();
			authUsr["NickName"] = u.NickName;
			if (u.NickName.Length > 0)
				authUsr["Link"] = u.Link();
			authUsr["Email"] = u.Email;
			authUsr["HasNullPassword"] = u.HasNullPassword;
			returnValue["AuthUsr"] = authUsr;

			returnValue["AuthCookie"] = getAuthCookie(u.GetAuthCookie(), u.K);

		}
开发者ID:davelondon,项目名称:dontstayin,代码行数:22,代码来源:Login.ascx.cs

示例4: GetUserByFacebookUID

		public static Hashtable GetUserByFacebookUID(int autoLoginUsrK, string autoLoginUsrLoginString)
		{

			var facebook = new FacebookGraphAPI(Facebook.Apps.Dsi);
			
			Hashtable ret = new Hashtable();
			ret["FacebookUIDMatch"] = false;
			ret["FacebookAutoLoginUsrMatch"] = false;
			ret["FacebookEmailMatch"] = false;
			ret["FacebookEmailMatchToCurrentUser"] = false;

			#region add data about the AutoLoginUsr (so we can display this if we don't end up logged in as it)
			if (autoLoginUsrK > 0)
			{
				Usr u = null;
				try
				{
					u = new Usr(autoLoginUsrK);
				}
				catch { }

				if (u != null)
				{
					Hashtable autoLoginUsrHash = new Hashtable();

					autoLoginUsrHash["NickName"] = u.NickName;

					if (u.LoginString.ToLower() == autoLoginUsrLoginString.ToLower())
					{
						autoLoginUsrHash["LoginStringMatch"] = true;
						autoLoginUsrHash["Email"] = u.Email;
					}
					else
						autoLoginUsrHash["LoginStringMatch"] = false;
					
					if (u.NickName.Length > 0)
						autoLoginUsrHash["Link"] = u.Link();

					autoLoginUsrHash["HasNullPassword"] = u.HasNullPassword;
					ret["AutoLoginUsr"] = autoLoginUsrHash;
				}
			}
			#endregion

			#region try to find usr linked by UID
			Query qUID = new Query();
			qUID.QueryCondition = new Q(Usr.Columns.FacebookUID, facebook.Uid);
			UsrSet usUID = new UsrSet(qUID);
			if (usUID.Count > 0)
			{
				Usr u = usUID[0];

				if (!u.IsEmailVerified && 
					autoLoginUsrK > 0 && 
					autoLoginUsrK == u.K &&
					u.LoginString.ToLower() == autoLoginUsrLoginString.ToLower())
				{
					u.IsEmailVerified = true;
					u.Update();
				}

				ret["FacebookUIDMatch"] = true;
				loginAndSetAuthCookie(u, ret, facebook.AccessToken);
				return ret;
			}
			#endregion

			#region if we have a forced usr (auto login link), we should link it immediatly
			if (autoLoginUsrK > 0)
			{
				Usr u = null;
				try
				{
					u = new Usr(autoLoginUsrK);
				}
				catch
				{
				}

				if (u != null && u.LoginString.ToLower() == autoLoginUsrLoginString.ToLower() && !u.EnhancedSecurity)
				{
					if (!u.IsEmailVerified)
					{
						u.IsEmailVerified = true;
						u.Update();
					}

					ret["FacebookAutoLoginUsrMatch"] = true;
					return ret;
				}
			}
			#endregion

			#region if we have a user that matches the email from facebook, we should suggest it, but not log in
			var user = facebook.GetObject("me", null);
			string email = user.Value<string>("email");

			if (email.Length > 0)
			{
				Query qEmail = new Query();
//.........这里部分代码省略.........
开发者ID:davelondon,项目名称:dontstayin,代码行数:101,代码来源:Login.ascx.cs

示例5: Invite

		public Return Invite(Usr TargetUsr, GroupUsr TargetGroupUsr, Usr PerformingUsr, GroupUsr PerformingGroupUsr, 
			string InviteMessage, bool InviteByEmail)
		{
			Return r = new Return();

			string targetUsr = "";
			if (InviteByEmail && TargetUsr.NickName.Length==0)
				targetUsr = TargetUsr.Email;
			else
				targetUsr = TargetUsr.Link();

			if (this.Restriction.Equals(Group.RestrictionEnum.Custom))
			{
				r.Success=false;
				r.MessageHtml="The "+this.FriendlyName+" group is a special group - the membership "+
					"is automatically controlled. You can't invite people to this group.";
				return r;
			}

			if (!PerformingUsr.IsAdmin && (PerformingGroupUsr==null || !PerformingGroupUsr.IsMember))
			{
				r.Success=false;
				r.MessageHtml="You're not a member of the "+this.FriendlyName+" group!";
				return r;
			}

			if (TargetGroupUsr==null)
			{
				if (this.Restriction.Equals(Group.RestrictionEnum.Moderator))
				{
					//nothing now
					//if the current user is a moderator, we add an invite request. 
					//If the current user isn't a mod, we add a recommend.
					if (PerformingUsr.CanGroupMemberAdmin(PerformingGroupUsr))
					{
						InvitePrivate(TargetUsr, TargetGroupUsr, PerformingUsr, PerformingGroupUsr, InviteMessage);
						r.Success=true;
						r.MessageHtml="You have invited "+targetUsr+" to the "+
							this.FriendlyName+" group. They will be sent a message shortly.";
					}
					else
					{
						RecommendPrivate(TargetUsr, TargetGroupUsr, PerformingUsr, PerformingGroupUsr, InviteMessage);
						r.Success=true;
						r.MessageHtml="Since "+this.FriendlyName+" is a restricted group, only "+
							"moderators may send invites. "+targetUsr+" has been recommended "+
							"as a possible member. A moderator will decide whether to send the invite.";
					}
				}
				else
				{
					InvitePrivate(TargetUsr, TargetGroupUsr, PerformingUsr, PerformingGroupUsr, InviteMessage);
					r.Success=true;
					r.MessageHtml="You have invited "+targetUsr+" to the "+this.FriendlyName+" group. "+
						"They will be sent a message shortly.";
				}
			}
			else if (TargetGroupUsr.Status.Equals(GroupUsr.StatusEnum.Member))
			{
				// This person is a member of the group
				r.Success=false;
				r.MessageHtml=targetUsr+" is already a member of the "+this.FriendlyName+" group.";
			}
			else if (TargetGroupUsr.Status.Equals(GroupUsr.StatusEnum.Request))
			{
				// This person has requested membership
				// if the current user is a moderator, we must enable the request. 
				// If the current user isn't a mod, we must show an error.
				if (this.Restriction.Equals(Group.RestrictionEnum.Moderator))
				{
					if (PerformingUsr.CanGroupMemberAdmin(PerformingGroupUsr))
					{
						JoinPrivate(TargetUsr, TargetGroupUsr, PerformingUsr, PerformingGroupUsr);
						r.Success=true;
						r.MessageHtml=targetUsr+" had already requested to join the "+
							this.FriendlyName+" group, so we've instantly made them a member.";
					}
					else
					{
						r.Success=false;
						r.MessageHtml=targetUsr+" has already requested to be a member "+
							"of this group. The group moderators will deal with the request and either accept or "+
							"deny the request.";
					}
				}
				else
				{
					JoinPrivate(TargetUsr, TargetGroupUsr, PerformingUsr, PerformingGroupUsr);
					r.Success=true;
					r.MessageHtml=targetUsr+" had already requested to join the "+
						this.FriendlyName+" group, so we've instantly made them a member.";
				}
			}
			else if (TargetGroupUsr.Status.Equals(GroupUsr.StatusEnum.RequestRejected))
			{
				// A previous membership request was denied
				// if the current user is a moderator, we must enable them straight away. 
				// If the current user isn't a mod, we must show an error.
				if (PerformingUsr.CanGroupMemberAdmin(PerformingGroupUsr))
				{
//.........这里部分代码省略.........
开发者ID:davelondon,项目名称:dontstayin,代码行数:101,代码来源:Group.cs


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