⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gallerythreadquery.cs

📁 本系统是在asp版《在线文件管理器》的基础上设计制作
💻 CS
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System.Collections;
using CommunityServer.Components;

namespace CommunityServer.Galleries.Components
{
	/// <summary>
	/// Summary description for EntryQuery.
	/// </summary>
	public class GalleryThreadQuery
	{

		public GalleryThreadQuery() { }

		#region Query Properties

		/// <summary>
		/// Calendar to filter by
		/// </summary>
		public int SectionID = -1;

		/// <summary>
		/// Group to filter by
		/// </summary>
		public int GroupID = -1;

		/// <summary>
		/// Current Page
		/// </summary>
		public int PageIndex = 0;

		/// <summary>
		/// # of threads per request
		/// </summary>
		public int PageSize = 20;

		/// <summary>
		/// CategoryID to filter by
		/// </summary>
		public int CategoryID = 0;

		/// <summary>
		/// Return posts that are in no categories
		/// </summary>
		public bool HasNoCategories = false;

		/// <summary>
		/// User to filter by
		/// </summary>
		public int UserID = 0;

		/// <summary>
		/// Filter by if the calendar is current enabled
		/// </summary>
		public bool IsGalleryEnabled = true;

		public bool OnlyApproved = true;

		/// <summary>
		/// How to sort
		/// </summary>
		public SortOrder SortOrder = SortOrder.Ascending;

		/// <summary>
		/// Column to sort by
		/// </summary>
		public GalleryThreadSortBy SortBy = GalleryThreadSortBy.PictureDate;

		/// <summary>
		/// Should the category data be returned as a seperate table.
		/// </summary>
		public bool IncludeCategories = false;


		public ArrayList FilterByList = null;


		#endregion
		
		#region Has/Helpers

		/// <summary>
		/// Are we filtering by a category?
		/// </summary>
		public bool HasCategory
		{
			get { return CategoryID > 0; }
		}

		/// <summary>
		/// Are we filtering by a specific blog?
		/// </summary>
		public bool HasFolder
		{
			get { return SectionID > -1; }
		}

		/// <summary>
		/// Are we filtering by a specific group?
		/// </summary>
		public bool HasGroup
		{
			get { return GroupID > -1; }
		}

		string _filterKey = null;
		public string FilterKey
		{
			get
			{
				if(_filterKey == null)
					if(FilterByList != null && FilterByList.Count > 0)
					{
						string[] ids = new string[FilterByList.Count];
						for(int i = 0; i < FilterByList.Count; i++)
							ids[i] = ((Section)FilterByList[i]).SectionID.ToString();

						_filterKey = string.Join(",", ids);
					}
					else
						_filterKey = string.Empty;

				return _filterKey;
			}
		}

		/// <summary>
		/// Unquie key represeting the current query
		/// </summary>
		public string Key
		{
			get
			{
				return string.Format("Pictures-S:{0}-PI{1}-PS:{2}-C:{3}-GSB:{4}-SO:{5}-IC:{6}-U:{7}-GID:{8}-F:{9}",
					SectionID,PageIndex,PageSize,CategoryID,SortBy,SortOrder,IncludeCategories,UserID,GroupID,FilterKey);
			}
		}

		#endregion

	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -