📄 themedropdownlist.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using System.Web;
using System.IO;
using System.Web.UI.WebControls;
using CommunityServer.Components;
using CommunityServer.Configuration;
namespace CommunityServer.Controls {
public class ThemeDropDownList : DropDownList {
public ThemeDropDownList() {
HttpContext context = CSContext.Current.Context;
string[] dirs = Directory.GetDirectories( context.Request.PhysicalApplicationPath + CSConfiguration.GetConfig().FilesPath + "\\themes" );
foreach (string s in dirs) {
DirectoryInfo dirInfo = new DirectoryInfo(s);
// check to ensure we skip any directories that start
// with an underscore.
//
if (dirInfo.Name.Length > 0) {
if (!dirInfo.Name.StartsWith("_" ) && string.Compare(dirInfo.Name, "blogs", true) != 0 && string.Compare(dirInfo.Name,"galleries",true) != 0) {
// Add directories
//
Items.Add(new ListItem(dirInfo.Name, dirInfo.Name));
}
}
}
}
public override string SelectedValue {
get {
return base.SelectedValue;
}
set {
if (Items.FindByValue(value) == null)
Items.FindByValue("default").Selected = true;
else
base.SelectedValue = value;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -