/// <summary>
		/// Adds the contents of another <see cref="ThemeInfoCollection">ThemeInfoCollection</see> to the end of the collection.
		/// </summary>
		/// <param name="value">A <see cref="ThemeInfoCollection">ThemeInfoCollection</see> containing the Components to add to the collection. </param>
		public void AddRange(ThemeInfoCollection value) 
		{
			for (int i = 0;	(i < value.Count); i = (i +	1))	
			{
				this.Add((ThemeInfo)value.List[i]);
			}
		}
 /// <summary>
 /// Adds the contents of another <see cref="ThemeInfoCollection">ThemeInfoCollection</see> to the end of the collection.
 /// </summary>
 /// <param name="value">A <see cref="ThemeInfoCollection">ThemeInfoCollection</see> containing the Components to add to the collection. </param>
 public void AddRange(ThemeInfoCollection value)
 {
     for (int i = 0; (i < value.Count); i = (i + 1))
     {
         this.Add((ThemeInfo)value.List[i]);
     }
 }
Exemple #3
0
        /// <summary>
        /// 输出主题
        /// </summary>
        /// <returns></returns>
		private string OutPutTheme()
		{

#if NET1
			ThemeInfoCollection tic = SpaceProvider.GetThemeInfos();
            ThemeInfoCollection ticCategory = new ThemeInfoCollection();
            ThemeInfoCollection ticResult = new ThemeInfoCollection();
#else
            Discuz.Common.Generic.List<ThemeInfo> tic = SpaceProvider.GetThemeInfos();
            Discuz.Common.Generic.List<ThemeInfo> ticCategory = new Discuz.Common.Generic.List<ThemeInfo>();
            Discuz.Common.Generic.List<ThemeInfo> ticResult = new Discuz.Common.Generic.List<ThemeInfo>();
#endif
			StringBuilder sb = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\" ?> \r\n");
		
   
			foreach (ThemeInfo ti in tic) //把分类级的ThemeInfo捡出来
			{
				if (ti.Type != 0)
					break;
				ticCategory.Add(ti);
			}
			sb.Append("<Skin> \r\n");
			foreach (ThemeInfo ti in ticCategory) //根据每个分类找其下属主题
			{
				sb.AppendFormat("<Category name=\"{0}\" themeid=\"{1}\"> \r\n", ti.Name, ti.ThemeId);
				ticResult.Add(ti);
				foreach (ThemeInfo t in tic)
				{
					if (t.Type == ti.ThemeId)
						sb.AppendFormat("<Theme themeid=\"{0}\" name=\"{1}\" directory=\"{2}\" createdate=\"{3}\" copyright=\"{4}\" author=\"{5}\" /> \r\n", t.ThemeId, t.Name, t.Directory, t.CreateDate, t.CopyRight, t.Author);
				}
				sb.Append("</Category> \r\n");
			}

//			foreach (ThemeInfo ti in ticResult)
//			{
//				sb.AppendFormat("<Theme themeid=\"{0}\" name=\"{1}\" directory=\"{2}\" createdate=\"{3}\" copyright=\"{4}\" author=\"{5}\"> \r\n", ti.ThemeId, ti.Name, ti.Directory, ti.CreateDate, ti.CopyRight, ti.Author);
//				if (ti.Type == 0)
//					sb.AppendFormat("<Category name=\"{0}\" /> \r\n", ti.Name);
//				sb.Append("</Theme> \r\n");
//			}
			sb.Append("</Skin> \r\n");

			return sb.ToString();
		}
 /// <summary>
 /// Initializes a new instance of the <see cref="ThemeInfoCollection">ThemeInfoCollection</see> class containing the elements of the specified source collection.
 /// </summary>
 /// <param name="value">A <see cref="ThemeInfoCollection">ThemeInfoCollection</see> with which to initialize the collection.</param>
 public ThemeInfoCollection(ThemeInfoCollection value)
 {
     this.AddRange(value);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ThemeInfoCollectionEnumerator">ThemeInfoCollectionEnumerator</see> class referencing the specified <see cref="ThemeInfoCollection">ThemeInfoCollection</see> object.
 /// </summary>
 /// <param name="mappings">The <see cref="ThemeInfoCollection">ThemeInfoCollection</see> to enumerate.</param>
 public ThemeInfoCollectionEnumerator(ThemeInfoCollection mappings)
 {
     _temp       = ((IEnumerable)(mappings));
     _enumerator = _temp.GetEnumerator();
 }
		/// <summary>
		/// Initializes a new instance of the <see cref="ThemeInfoCollection">ThemeInfoCollection</see> class containing the elements of the specified source collection.
		/// </summary>
		/// <param name="value">A <see cref="ThemeInfoCollection">ThemeInfoCollection</see> with which to initialize the collection.</param>
		public ThemeInfoCollection(ThemeInfoCollection value)	
		{
			this.AddRange(value);
		}
			/// <summary>
			/// Initializes a new instance of the <see cref="ThemeInfoCollectionEnumerator">ThemeInfoCollectionEnumerator</see> class referencing the specified <see cref="ThemeInfoCollection">ThemeInfoCollection</see> object.
			/// </summary>
			/// <param name="mappings">The <see cref="ThemeInfoCollection">ThemeInfoCollection</see> to enumerate.</param>
			public ThemeInfoCollectionEnumerator(ThemeInfoCollection mappings)
			{
				_temp =	((IEnumerable)(mappings));
				_enumerator = _temp.GetEnumerator();
			}