/// <summary> /// Copies the elements of the specified <see cref="ShowtopicPagePostInfo">ShowtopicPagePostInfo</see> array to the end of the collection. /// </summary> /// <param name="value">An array of type <see cref="ShowtopicPagePostInfo">ShowtopicPagePostInfo</see> containing the Components to add to the collection.</param> public void AddRange(ShowtopicPagePostInfo[] value) { for (int i = 0; (i < value.Length); i = (i + 1)) { this.Add(value[i]); } }
/// <summary> /// Gets a value indicating whether the collection contains the specified <see cref="ShowtopicPagePostInfoCollection">ShowtopicPagePostInfoCollection</see>. /// </summary> /// <param name="value">The <see cref="ShowtopicPagePostInfoCollection">ShowtopicPagePostInfoCollection</see> to search for in the collection.</param> /// <returns><b>true</b> if the collection contains the specified object; otherwise, <b>false</b>.</returns> public bool Contains(ShowtopicPagePostInfo value) { return this.List.Contains(value); }
/// <summary> /// Initializes a new instance of the <see cref="ShowtopicPagePostInfoCollection">ShowtopicPagePostInfoCollection</see> class containing the specified array of <see cref="ShowtopicPagePostInfo">ShowtopicPagePostInfo</see> Components. /// </summary> /// <param name="value">An array of <see cref="ShowtopicPagePostInfo">ShowtopicPagePostInfo</see> Components with which to initialize the collection. </param> public ShowtopicPagePostInfoCollection(ShowtopicPagePostInfo[] value) { this.AddRange(value); }
public int Add(ShowtopicPagePostInfo value) { return this.List.Add(value); }
public void Remove(ShowtopicPagePostInfo value) { List.Remove(value); }
public void Insert(int index, ShowtopicPagePostInfo value) { List.Insert(index, value); }
/// <summary> /// Gets the index in the collection of the specified <see cref="ShowtopicPagePostInfoCollection">ShowtopicPagePostInfoCollection</see>, if it exists in the collection. /// </summary> /// <param name="value">The <see cref="ShowtopicPagePostInfoCollection">ShowtopicPagePostInfoCollection</see> to locate in the collection.</param> /// <returns>The index in the collection of the specified object, if found; otherwise, -1.</returns> public int IndexOf(ShowtopicPagePostInfo value) { return this.List.IndexOf(value); }
/// <summary> /// Copies the collection Components to a one-dimensional <see cref="T:System.Array">Array</see> instance beginning at the specified index. /// </summary> /// <param name="array">The one-dimensional <see cref="T:System.Array">Array</see> that is the destination of the values copied from the collection.</param> /// <param name="index">The index of the array at which to begin inserting.</param> public void CopyTo(ShowtopicPagePostInfo[] array, int index) { this.List.CopyTo(array, index); }
/// <summary> /// 装载ShowtopicPagePostInfo对象 /// </summary> /// <param name="reader"></param> /// <returns></returns> private static ShowtopicPagePostInfo LoadSingleShowtopicPagePostInfo(IDataReader reader) { ShowtopicPagePostInfo postInfo = new ShowtopicPagePostInfo(); postInfo.Pid = Int32.Parse(reader["pid"].ToString()); postInfo.Attachment = Int32.Parse(reader["attachment"].ToString()); postInfo.Fid = TypeConverter.ObjectToInt(reader["fid"]); postInfo.Title = reader["title"].ToString().Trim(); postInfo.Layer = Int32.Parse(reader["layer"].ToString()); postInfo.Message = reader["message"].ToString().TrimEnd(); postInfo.Lastedit = reader["lastedit"].ToString().Trim(); postInfo.Postdatetime = reader["postdatetime"].ToString().Trim(); postInfo.Poster = reader["poster"].ToString().Trim(); postInfo.Posterid = Int32.Parse(reader["posterid"].ToString()); postInfo.Invisible = Int32.Parse(reader["invisible"].ToString()); postInfo.Usesig = Int32.Parse(reader["usesig"].ToString()); postInfo.Htmlon = Int32.Parse(reader["htmlon"].ToString()); postInfo.Smileyoff = Int32.Parse(reader["smileyoff"].ToString()); postInfo.Parseurloff = Int32.Parse(reader["parseurloff"].ToString()); postInfo.Bbcodeoff = Int32.Parse(reader["bbcodeoff"].ToString()); postInfo.Rate = Int32.Parse(reader["rate"].ToString()); postInfo.Ratetimes = Int32.Parse(reader["ratetimes"].ToString()); postInfo.Ubbmessage = reader["message"].ToString().TrimEnd(); if (postInfo.Posterid > 0) { postInfo.Oltime = reader["oltime"].ToString().Trim(); postInfo.Lastvisit = reader["lastvisit"].ToString().Trim(); postInfo.Nickname = reader["nickname"].ToString().Trim(); postInfo.Username = reader["username"].ToString().Trim(); postInfo.Groupid = Utils.StrToInt(reader["groupid"], 0); postInfo.Spaceid = Utils.StrToInt(reader["spaceid"], 0); postInfo.Gender = Utils.StrToInt(reader["gender"], 2); postInfo.Bday = reader["bday"].ToString().Trim(); postInfo.Showemail = Utils.StrToInt(reader["showemail"], 0); postInfo.Digestposts = Utils.StrToInt(reader["digestposts"], 0); postInfo.Credits = Utils.StrToInt(reader["credits"], 0); postInfo.Extcredits1 = TypeConverter.StrToFloat(reader["extcredits1"].ToString()); postInfo.Extcredits2 = TypeConverter.StrToFloat(reader["extcredits2"].ToString()); postInfo.Extcredits3 = TypeConverter.StrToFloat(reader["extcredits3"].ToString()); postInfo.Extcredits4 = TypeConverter.StrToFloat(reader["extcredits4"].ToString()); postInfo.Extcredits5 = TypeConverter.StrToFloat(reader["extcredits5"].ToString()); postInfo.Extcredits6 = TypeConverter.StrToFloat(reader["extcredits6"].ToString()); postInfo.Extcredits7 = TypeConverter.StrToFloat(reader["extcredits7"].ToString()); postInfo.Extcredits8 = TypeConverter.StrToFloat(reader["extcredits8"].ToString()); postInfo.Posts = Utils.StrToInt(reader["posts"], 0); postInfo.Joindate = reader["joindate"].ToString().Trim(); postInfo.Lastactivity = reader["lastactivity"].ToString().Trim(); postInfo.Userinvisible = Int32.Parse(reader["invisible"].ToString()); postInfo.Avatar = reader["avatar"].ToString(); postInfo.Avatarwidth = Utils.StrToInt(reader["avatarwidth"], 0); postInfo.Avatarheight = Utils.StrToInt(reader["avatarheight"], 0); postInfo.Medals = reader["medals"].ToString(); postInfo.Signature = reader["signature"].ToString(); postInfo.Location = reader["location"].ToString(); postInfo.Customstatus = reader["customstatus"].ToString(); postInfo.Website = reader["website"].ToString(); postInfo.Icq = reader["icq"].ToString(); postInfo.Qq = reader["qq"].ToString(); postInfo.Msn = reader["msn"].ToString(); postInfo.Yahoo = reader["yahoo"].ToString(); postInfo.Skype = reader["skype"].ToString(); //部分属性需要根据不同情况来赋值 //根据用户自己的设置决定是否显示邮箱地址 if (postInfo.Showemail == 0) postInfo.Email = ""; else postInfo.Email = reader["email"].ToString().Trim(); // 最后活动时间50分钟内的为在线, 否则不在线 if (Utils.StrDateDiffMinutes(postInfo.Lastactivity, 50) < 0) postInfo.Onlinestate = 1; else postInfo.Onlinestate = 0; //作者ID为-1即表明作者为游客, 为了区分会直接公开显示游客发帖时的IP, 这里将IP最后一位修改为* postInfo.Ip = reader["ip"].ToString().Trim(); } else { postInfo.Nickname = "游客"; postInfo.Username = "******"; postInfo.Groupid = 7; postInfo.Showemail = 0; postInfo.Digestposts = 0; postInfo.Credits = 0; postInfo.Extcredits1 = 0; postInfo.Extcredits2 = 0; postInfo.Extcredits3 = 0; postInfo.Extcredits4 = 0; postInfo.Extcredits5 = 0; postInfo.Extcredits6 = 0; postInfo.Extcredits7 = 0; postInfo.Extcredits8 = 0; postInfo.Posts = 0; postInfo.Joindate = "2006-9-1 1:1:1"; postInfo.Lastactivity = "2006-9-1 1:1:1"; ; postInfo.Userinvisible = 0; postInfo.Avatar = ""; postInfo.Avatarwidth = 0; postInfo.Avatarheight = 0; postInfo.Medals = ""; postInfo.Signature = ""; postInfo.Location = ""; postInfo.Customstatus = ""; postInfo.Website = ""; postInfo.Icq = ""; postInfo.Qq = ""; postInfo.Msn = ""; postInfo.Yahoo = ""; postInfo.Skype = ""; //部分属性需要根据不同情况来赋值 postInfo.Email = ""; postInfo.Onlinestate = 1; postInfo.Medals = ""; postInfo.Ip = reader["ip"].ToString().Trim(); if (postInfo.Ip.IndexOf('.') > -1) { postInfo.Ip = postInfo.Ip.Substring(0, postInfo.Ip.LastIndexOf(".") + 1) + "*"; } } return postInfo; }