public void AddRange(TopicIdentifyCollection value)
 {
     for (int i = 0; (i < value.Count); i = (i + 1))
     {
         this.Add((TopicIdentify)value.List[i]);
     }
 }
Beispiel #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);
 }
Beispiel #5
0
        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;
        }
Beispiel #6
0
 public TopicIdentifyCollectionEnumerator(TopicIdentifyCollection mappings)
 {
     _temp       = ((IEnumerable)(mappings));
     _enumerator = _temp.GetEnumerator();
 }
Beispiel #7
0
 public TopicIdentifyCollection(TopicIdentifyCollection value)
 {
     this.AddRange(value);
 }