/// <summary> /// Adds the contents of another <see cref="PollOptionInfoCollection">PollOptionInfoCollection</see> to the end of the collection. /// </summary> /// <param name="value">A <see cref="PollOptionInfoCollection">PollOptionInfoCollection</see> containing the Components to add to the collection. </param> public void AddRange(PollOptionInfoCollection value) { for (int i = 0; (i < value.Count); i = (i + 1)) { this.Add((PollOptionInfo)value.List[i]); } }
public void AddRange(PollOptionInfoCollection value) { for (int i = 0; i < value.Count; i++) { this.Add((PollOption)value.List[i]); } }
/// <summary> /// Initializes a new instance of the <see cref="PollOptionInfoCollection">PollOptionInfoCollection</see> class containing the elements of the specified source collection. /// </summary> /// <param name="value">A <see cref="PollOptionInfoCollection">PollOptionInfoCollection</see> with which to initialize the collection.</param> public PollOptionInfoCollection(PollOptionInfoCollection value) { this.AddRange(value); }
/// <summary> /// Initializes a new instance of the <see cref="PollOptionInfoCollectionEnumerator">PollOptionInfoCollectionEnumerator</see> class referencing the specified <see cref="PollOptionInfoCollection">PollOptionInfoCollection</see> object. /// </summary> /// <param name="mappings">The <see cref="PollOptionInfoCollection">PollOptionInfoCollection</see> to enumerate.</param> public PollOptionInfoCollectionEnumerator(PollOptionInfoCollection mappings) { _temp = ((IEnumerable)(mappings)); _enumerator = _temp.GetEnumerator(); }
/// <summary> /// 通过主题ID获取相应的投票信息 /// </summary> /// <param name="tid">主题id</param> /// <returns>投票选项集合</returns> public static PollOptionInfoCollection GetPollOptionInfoCollection(int tid) { PollOptionInfoCollection pollinfocoll = new PollOptionInfoCollection(); IDataReader idatareader = DatabaseProvider.GetInstance().GetPollOptionList(tid); PollOptionInfo polloptioninfo; while (idatareader.Read()) { polloptioninfo = new PollOptionInfo(); polloptioninfo.Polloptionid = Utils.StrToInt(idatareader["polloptionid"], 0); polloptioninfo.Displayorder = Utils.StrToInt(idatareader["displayorder"], 0); polloptioninfo.Pollid = Utils.StrToInt(idatareader["pollid"], 0); polloptioninfo.Polloption = idatareader["polloption"].ToString().Trim(); polloptioninfo.Tid = Utils.StrToInt(idatareader["tid"], 0); polloptioninfo.Voternames = idatareader["voternames"].ToString().Trim(); polloptioninfo.Votes = Utils.StrToInt(idatareader["votes"], 0); pollinfocoll.Add(polloptioninfo); } idatareader.Close(); return pollinfocoll; }
public PollOptionInfoCollectionEnumerator(PollOptionInfoCollection mappings) { this._temp = mappings; this._enumerator = this._temp.GetEnumerator(); }