📄 miscstyles.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.Collections.Specialized;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AspNetForums;
using AspNetForums.Components;
using System.ComponentModel;
namespace AspNetForums.Controls {
/******************************* SearchPagerStyle Web control ****************************
*
* SUMMARY:
* This class extends the TableItemStyle class and defines how the Search Pager
* should look and operate. The Search Pager is what allows the user to navigate
* through multiple pages of search results.
*
******************************************************************************************/
/// <summary>
/// This class extends the TableItemStyle class and defines how the Search Pager
/// should look and operate. The Search Pager is what allows the user to navigate
/// through multiple pages of search results.
/// </summary>
[ ToolboxItemAttribute(false) ]
public class SearchPagerStyle : TableItemStyle {
/********** DECLARE PRIVATE CONSTANTS **************/
const String _defaultNextPageText = "Next";
const String _defaultPrevPageText = "Prev";
const int _defaultPageButtonCount = 10;
/***************************************************/
/************ PROPERTY SET/GET STATEMENTS **************/
/// <summary>
/// This property indicates whether or not the pager is shown.
/// </summary>
public bool Visible {
get {
if (ViewState["spsVisible"] == null)
return true;
return (bool) ViewState["spsVisible"];
}
set { ViewState["spsVisible"] = value; }
}
/// <summary>
/// Specifies the pager's mode. The options are NextPrev (the default) or NumericPages.
/// </summary>
public PagerMode Mode {
get {
if (ViewState["spsMode"] == null)
return PagerMode.NextPrev;
return (PagerMode) ViewState["spsMode"];
}
set { ViewState["spsMode"] = value; }
}
/// <summary>
/// Specifies the text for the next page link when the Mode property is set to NextPrev.
/// <seealso cref="Mode"/>
/// </summary>
public String NextPageText {
get {
if (ViewState["spsNextPageText"] == null) return _defaultNextPageText;
return (String) ViewState["spsNextPageText"];
}
set { ViewState["spsNextPageText"] = value; }
}
/// <summary>
/// Specifies the text for the previous page link when the Mode property is set to NextPrev.
/// <seealso cref="Mode"/>
/// </summary>
public String PrevPageText {
get {
if (ViewState["spsPrevPageText"] == null) return _defaultPrevPageText;
return (String) ViewState["spsPrevPageText"];
}
set { ViewState["spsPrevPageText"] = value; }
}
/// <summary>
/// Specifies the position of the pager. The options are Top, Bottom, and TopAndBottom.
/// </summary>
public PagerPosition Position {
get {
if (ViewState["spsPosition"] == null)
return PagerPosition.TopAndBottom;
return (PagerPosition) ViewState["spsPosition"];
}
set { ViewState["spsPosition"] = value; }
}
/// <summary>
/// When the Mode property is set to NumericPages, this property specifies how many pages
/// should be shown in the list of pages to navigate to.
/// <seealso cref="Mode"/>
/// </summary>
public int PageButtonCount {
get {
if (ViewState["spsPageButtonCount"] == null) return _defaultPageButtonCount;
return (int) ViewState["spsPageButtonCount"];
}
set { ViewState["spsPageButtonCount"] = value; }
}
/*******************************************************/
}
/********************* DeletePostStyle Class ********************
This class extends the base Style class and provides stylistic and
advanced settings for the Delete Post panel. Not only can the developer
define stylistic settings here, but also specify the textual messages
to appear in the Delete Post confirmation panel.
*********************************************************************/
/// <summary>
/// This class extends the base Style class and provides stylistic and
/// advanced settings for the Delete Post panel. Not only can the developer
/// define stylistic settings here, but also specify the textual messages
/// to appear in the Delete Post confirmation panel.
/// </summary>
[ ToolboxItemAttribute(false) ]
public class DeletePostStyle : Style {
/********** DECLARE PRIVATE CONSTANTS **************/
const String _defaultDeletePostText = "Are you <b>sure</b> you want to <b>permanently delete</b> this post? Once you confirm, you will <b>not</b> be able to un-delete the post!"; // the default delete post message
const String _defaultReasonsTextBoxMessage = "If you do decide to delete the post, please provide the reason why in the textbox below:";
const bool _defaultShowReasonsTextBox = true; // whether or not to display the "Reasons for Deleting the Post" textbox
const int _defaultReasonsTextBoxColumns = 40; // how many columns to show in the text box
const int _defaultReasonsTextBoxRows = 8; // how many rows to show in the text box
/***************************************************/
/************ PROPERTY SET/GET STATEMENTS **************/
/// <summary>
/// If the ShowReasonsForDeletingTextBox property is set to true, a text box is displayed in
/// the Delete Post confirmation panel for the moderator to enter a reason why the post
/// is being deleted. This property, ReasonsTextBoxMessage, specifies the textual message
/// that should appear before the text box.
/// <seealso cref="ShowReasonsForDeletingTextBox"/>
/// </summary>
public String ReasonsTextBoxMessage {
get {
if (ViewState["deletePostStyleTextBoxMsg"] == null) return _defaultReasonsTextBoxMessage;
return (String) ViewState["deletePostStyleTextBoxMsg"];
}
set { ViewState["deletePostStyleTextBoxMsg"] = value; }
}
/// <summary>
/// Indicates the textual message that should appear on the Delete Post confirmation page, explaining
/// to the user the full ramifications of their actions.
/// </summary>
public String DeletePostText {
get {
if (ViewState["deletePostStyleDeletePostText"] == null) return _defaultDeletePostText;
return (String) ViewState["deletePostStyleDeletePostText"];
}
set { ViewState["deletePostStyleDeletePostText"] = value; }
}
/// <summary>
/// This property determines whether or not a text box should be displayed for the moderator to
/// explain why the post is being deleted.
/// </summary>
public bool ShowReasonsForDeletingTextBox {
get {
if (ViewState["deletePostStyleShowTextBox"] == null) return _defaultShowReasonsTextBox;
return (bool) ViewState["deletePostStyleShowTextBox"];
}
set { ViewState["deletePostStyleShowTextBox"] = value; }
}
/// <summary>
/// Determines how many columns the Reasons For Deleting the Post text box should contain.
/// The default is 40.
/// </summary>
public int ReasonsTextBoxColumns {
get {
if (ViewState["deletePostStyleTextBoxCols"] == null) return _defaultReasonsTextBoxColumns;
return (int) ViewState["deletePostStyleTextBoxCols"];
}
set { ViewState["deletePostStyleTextBoxCols"] = value; }
}
/// <summary>
/// Determines how many rows the Reasons For Deleting the Post text box should contain.
/// The default is 8.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -