📄 settings.cs
字号:
/// Gets the Password Reset Message File.
/// </summary>
public static string PasswordResetMessageFile {
get { return PublicDirectory + "PasswordResetMessage.cs"; }
}
#endregion
#region Basic Settings and Associated Data
/// <summary>
/// Gets or sets the Title of the Wiki.
/// </summary>
public static string WikiTitle {
get {
string title;
lock(config) {
if(config.TryGetValue("WikiTitle", out title)) return title;
else return "ScrewTurn Wiki";
}
}
set {
lock(config) {
config["WikiTitle"] = value;
}
}
}
/// <summary>
/// Gets or sets the SMTP Server.
/// </summary>
public static string SmtpServer {
get {
string server;
lock(config) {
if(config.TryGetValue("SmtpServer", out server)) return server;
else return "smtp.server.com";
}
}
set {
lock(config) {
config["SmtpServer"] = value;
}
}
}
/// <summary>
/// Gets or sets the SMTP Server Username.
/// </summary>
public static string SmtpUsername {
get {
string su;
lock(config) {
if(config.TryGetValue("SmtpUsername", out su)) return su;
else return "";
}
}
set {
lock(config) {
config["SmtpUsername"] = value;
}
}
}
/// <summary>
/// Gets or sets the SMTP Server Password.
/// </summary>
public static string SmtpPassword {
get {
string sp;
lock(config) {
if(config.TryGetValue("SmtpPassword", out sp)) return sp;
else return "";
}
}
set {
lock(config) {
config["SmtpPassword"] = value;
}
}
}
/// <summary>
/// Gets or sets the SMTP Server Port.
/// </summary>
public static int SmtpPort {
get {
string sp;
lock(config) {
if(config.TryGetValue("SmtpPort", out sp)) return int.Parse(sp);
else return -1;
}
}
set {
lock(config) {
config["SmtpPort"] = value.ToString();
}
}
}
/// <summary>
/// Gets or sets a value specifying whether to enable SSL in SMTP.
/// </summary>
public static bool SmtpSsl {
get {
string ss;
lock(config) {
if(config.TryGetValue("SmtpSsl", out ss)) return ss.ToLower().Equals("yes");
else return false;
}
}
set {
lock(config) {
config["SmtpSsl"] = value ? "YES" : "NO";
}
}
}
/// <summary>
/// Gets or sets a value specifying whether the access to the Wiki is public or not (in this case users won't need to login in order to edit pages).
/// </summary>
public static bool PublicAccess {
get {
string pa;
lock(config) {
if(config.TryGetValue("PublicAccess", out pa)) return pa.ToLower().Equals("yes");
else return false;
}
}
set {
lock(config) {
config["PublicAccess"] = value ? "YES" : "NO";
}
}
}
/// <summary>
/// Gets or sets a value specifying whether the access to the Wiki is private or not (in this case users won't be able to view pages unless they are logged in).
/// </summary>
public static bool PrivateAccess {
get {
string pa;
lock(config) {
if(config.TryGetValue("PrivateAccess", out pa)) return pa.ToLower().Equals("yes");
else return false;
}
}
set {
lock(config) {
config["PrivateAccess"] = value ? "YES" : "NO";
}
}
}
/// <summary>
/// Gets or sets a value specifying whether, in Public Access mode, anonymous file management is allowed.
/// </summary>
public static bool FileManagementInPublicAccessAllowed {
get {
string fmpa;
lock(config) {
if(config.TryGetValue("FileManagementInPublicAccessAllowed", out fmpa)) return fmpa.ToLower().Equals("yes");
else return false;
}
}
set {
lock(config) {
config["FileManagementInPublicAccessAllowed"] = value ? "YES" : "NO";
}
}
}
/// <summary>
/// Gets or sets a value specifying whether Users can create new accounts or not (in this case Register.aspx won't be available).
/// </summary>
public static bool UsersCanRegister {
get {
string ucr;
lock(config) {
if(config.TryGetValue("UsersCanRegister", out ucr)) return ucr.ToLower().Equals("yes");
else return true;
}
}
set {
lock(config) {
config["UsersCanRegister"] = value ? "YES" : "NO";
}
}
}
/// <summary>
/// Gets or sets a value specifying whether to disable the Captcha control in the Registration Page.
/// </summary>
public static bool DisableCaptchaControl {
get {
string dc;
lock(config) {
if(config.TryGetValue("DisableCaptchaControl", out dc)) return dc.ToLower().Equals("yes");
else return false;
}
}
set {
lock(config) {
config["DisableCaptchaControl"] = value ? "YES" : "NO";
}
}
}
/// <summary>
/// Gets or sets the Account Activation Mode.
/// </summary>
public static string AccountActivationMode {
get {
string aa;
lock(config) {
if(config.TryGetValue("AccountActivationMode", out aa)) return aa;
else return "EMAIL";
}
}
set {
string aa = "";
switch(value.ToLower()) {
case "email":
aa = "EMAIL";
break;
case "admin":
aa = "ADMIN";
break;
case "auto":
aa = "AUTO";
break;
default:
throw new ArgumentException("Invalid Account Activation Mode.");
}
lock(config) {
config["AccountActivationMode"] = aa;
}
}
}
/// <summary>
/// Gets or sets a value specifying whether or not Users can create new Page.
/// </summary>
public static bool UsersCanCreateNewPages {
get {
string ucc;
lock(config) {
if(config.TryGetValue("UsersCanCreateNewPages", out ucc)) return ucc.ToLower().Equals("yes");
else return true;
}
}
set {
lock(config) {
config["UsersCanCreateNewPages"] = value ? "YES" : "NO";
}
}
}
/// <summary>
/// Gets or sets a value specifying whether or not users can view uploaded Files.
/// </summary>
public static bool UsersCanViewFiles {
get {
string ucvf;
lock(config) {
if(config.TryGetValue("UsersCanViewFiles", out ucvf)) return ucvf.ToLower().Equals("yes");
else return true;
}
}
set {
lock(config) {
config["UsersCanViewFiles"] = value ? "YES" : "NO";
}
}
}
/// <summary>
/// Gets or sets a value specifying whether or not users can upload Files.
/// </summary>
public static bool UsersCanUploadFiles {
get {
string ucuf;
lock(config) {
if(config.TryGetValue("UsersCanUploadFiles", out ucuf)) return ucuf.ToLower().Equals("yes");
else return true;
}
}
set {
lock(config) {
config["UsersCanUploadFiles"] = value ? "YES" : "NO";
}
}
}
/// <summary>
/// Gets or sets a value specifying whether or not users can delete Files.
/// </summary>
public static bool UsersCanDeleteFiles {
get {
string ucdf;
lock(config) {
if(config.TryGetValue("UsersCanDeleteFiles", out ucdf)) return ucdf.ToLower().Equals("yes");
else return true;
}
}
set {
lock(config) {
config["UsersCanDeleteFiles"] = value ? "YES" : "NO";
}
}
}
/// <summary>
/// Gets or sets a value specifying whether or not users can create new Categories.
/// </summary>
public static bool UsersCanCreateNewCategories {
get {
string ucc;
lock(config) {
if(config.TryGetValue("UsersCanCreateNewCategories", out ucc)) return ucc.ToLower().Equals("yes");
else return true;
}
}
set {
lock(config) {
config["UsersCanCreateNewCategories"] = value ? "YES" : "NO";
}
}
}
/// <summary>
/// Gets or sets a value specifying whether or not users can manage Page Categories.
/// </summary>
public static bool UsersCanManagePageCategories {
get {
string ucm;
lock(config) {
if(config.TryGetValue("UsersCanManagePageCategories", out ucm)) return ucm.ToLower().Equals("yes");
else return true;
}
}
set {
lock(config) {
config["UsersCanManagePageCategories"] = value ? "YES" : "NO";
}
}
}
/// <summary>
/// Gets or sets the Default Language.
/// </summary>
public static string DefaultLanguage {
get {
string l;
lock(config) {
if(config.TryGetValue("DefaultLanguage", out l)) return l;
else return "en-US";
}
}
set {
lock(config) {
config["DefaultLanguage"] = value;
}
}
}
/// <summary>
/// Gets or sets the Default Timezone.
/// </summary>
public static string DefaultTimezone {
get {
string dt;
lock(config) {
if(config.TryGetValue("DefaultTimezone", out dt)) return dt;
else return "0";
}
}
set {
lock(config) {
config["DefaultTimezone"] = value;
}
}
}
/// <summary>
/// Gets or sets the DateTime format.
/// </summary>
public static string DateTimeFormat {
get {
string dtf;
lock(config) {
if(config.TryGetValue("DateTimeFormat", out dtf)) return dtf;
else return "yyyy'/'MM'/'dd' 'HH':'mm";
}
}
set {
lock(config) {
config["DateTimeFormat"] = value;
}
}
}
/// <summary>
/// Gets or sets the main URL of the Wiki.
/// </summary>
public static string MainUrl {
get {
string url;
lock(config) {
if(config.TryGetValue("MainUrl", out url)) {
return url + (!url.EndsWith("/") ? "/" : "");
}
else return "http://www.server.com/";
}
}
set {
lock(config) {
config["MainUrl"] = value;
}
}
}
/// <summary>
/// Gets the correct path to use with Cookies.
/// </summary>
public static string CookiePath {
get {
return HttpContext.Current.Request.ApplicationPath;
}
}
/// <summary>
/// Gets or sets the Contact Email.
/// </summary>
public static string ContactEmail {
get {
string email;
lock(config) {
if(config.TryGetValue("ContactEmail", out email)) return email;
else return "info@server.com";
}
}
set {
lock(config) {
config["ContactEmail"] = value;
}
}
}
/// <summary>
/// Gets or sets the Sender Email.
/// </summary>
public static string SenderEmail {
get {
string email;
lock(config) {
if(config.TryGetValue("SenderEmail", out email)) return email;
else return "no-reply@server.com";
}
}
set {
lock(config) {
config["SenderEmail"] = value;
}
}
}
/// <summary>
/// Gets or sets the Defaul Page of the Wiki.
/// </summary>
public static string DefaultPage {
get {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -