public void AddRange(TopicIdentifyCollection value) { for (int i = 0; (i < value.Count); i = (i + 1)) { this.Add((TopicIdentify)value.List[i]); } }
public TopicIdentifyCollectionEnumerator(TopicIdentifyCollection mappings) { _temp = ((IEnumerable)(mappings)); _enumerator = _temp.GetEnumerator(); }
public TopicIdentifyCollection(TopicIdentifyCollection value) { this.AddRange(value); }
public static Discuz.Common.Generic.List<TopicIdentify> GetTopicIdentifyCollection() #endif { Discuz.Cache.DNTCache cache = Discuz.Cache.DNTCache.GetCacheService(); #if NET1 TopicIdentifyCollection topicidentifyList = cache.RetrieveObject("/TopicIdentifys") as TopicIdentifyCollection; #else Discuz.Common.Generic.List<TopicIdentify> topicidentifyList = cache.RetrieveObject("/TopicIdentifys") as Discuz.Common.Generic.List<TopicIdentify>; #endif if (topicidentifyList == null) { #if NET1 topicidentifyList = new TopicIdentifyCollection(); #else topicidentifyList = new Discuz.Common.Generic.List<TopicIdentify>(); #endif IDataReader reader = DatabaseProvider.GetInstance().GetTopicsIdentifyItem(); StringBuilder jsArray = new StringBuilder("<script type='text/javascript'>var topicidentify = { "); while (reader.Read()) { TopicIdentify topic = new TopicIdentify(); topic.Identifyid = Int32.Parse(reader["identifyid"].ToString()); topic.Name = reader["name"].ToString(); topic.Filename = reader["filename"].ToString(); topicidentifyList.Add(topic); jsArray.AppendFormat("'{0}':'{1}',", reader["identifyid"].ToString(), reader["filename"].ToString()); } reader.Close(); jsArray.Remove(jsArray.Length - 1, 1); jsArray.Append("};</script>"); cache.AddObject("/TopicIdentifys", topicidentifyList); cache.AddObject("/TopicIndentifysJsArray", jsArray.ToString()); } return topicidentifyList; }