public void AddRange(TopicIdentifyCollection value)
 {
     for (int i = 0; (i < value.Count); i = (i + 1))
     {
         this.Add((TopicIdentify)value.List[i]);
     }
 }
示例#2
0
 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);
 }
示例#5
0
文件: Caches.cs 项目: ichari/ichari
        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;
        }
示例#6
0
 public TopicIdentifyCollectionEnumerator(TopicIdentifyCollection mappings)
 {
     _temp       = ((IEnumerable)(mappings));
     _enumerator = _temp.GetEnumerator();
 }
示例#7
0
 public TopicIdentifyCollection(TopicIdentifyCollection value)
 {
     this.AddRange(value);
 }