📄 thememanager.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System.Collections;
using System.Collections.Specialized;
using System.IO;
using System.Web.Caching;
using CommunityServer.Blogs.Components;
using CommunityServer.Components;
using CommunityServer.Configuration;
using CommunityServer.Controls;
namespace CommunityServer.Blogs.Controls
{
/// <summary>
/// Summary description for ThemeManager.
/// </summary>
public class ThemeManager : BaseThemeManager
{
private NameValueCollection SkinList = new NameValueCollection();
private Hashtable ThemeList = new Hashtable();
public static string CacheKey = "WeblogThemeManager";
private ThemeManager()
{
}
public static ThemeManager Instance()
{
ThemeManager tm = CSCache.Get(CacheKey) as ThemeManager;
if (tm == null)
{
tm = new ThemeManager();
CacheDependency dep = new CacheDependency(null, new string[] { CSConfiguration.CacheKey });
CSCache.Insert(CacheKey, tm, dep);
}
return tm;
}
protected override ThemedApplicationKeyApplicationConfiguration Config
{
get { return WeblogConfiguration.Instance(); }
}
public static string SkinPath()
{
CSContext cntx = CSContext.Current;
if (cntx.IsWebRequest)
{
Weblog blog = Weblogs.GetWeblog(cntx.ApplicationKey);
string path = WeblogConfiguration.Instance().ThemeLocation + blog.Theme + "/";
if (path.EndsWith("/"))
path = path.Substring(0, path.Length - 1);
return path.Replace("~", Globals.ApplicationPath);
}
else
return string.Empty;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -