📄 gallerythemedcontrol.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System.Web.UI;
using CommunityServer.Controls;
using CommunityServer.Galleries.Components;
namespace CommunityServer.Galleries.Controls
{
/// <summary>
/// Summary description for WeblogThemedControl.
/// </summary>
public abstract class GalleryThemedControl : GalleryTemplatedWebControl
{
public GalleryThemedControl()
{
GalleryConfig = GalleryConfiguration.Instance();
}
protected GalleryConfiguration GalleryConfig = null;
protected override string ThemeName
{
get { return CurrentGallery.Theme; }
}
/// <summary>
/// All skins should be found in the skin directory and named after the control.
/// </summary>
protected override string ExternalSkinFileName
{
get { return string.Format("Skins/Skin-{0}.ascx", this.GetType().Name); }
}
/// <summary>
/// Overriding CreateChildControls allows us to replace control logic with our true hierarchal loading. (ie, A control can have a
/// parent other than default)
/// </summary>
protected override void CreateChildControls()
{
Controls.Clear();
bool _skinLoaded = false;
if(SkinTemplate != null )
{
SkinTemplate.InstantiateIn( this );
_skinLoaded = true;
}
if(!_skinLoaded && this.Page != null)
{
string path = ThemeManager.Instance().SkinPath(this.ThemeName, ExternalSkinFileName);
Control skin = this.Page.LoadControl( path );
this.Controls.Add( skin );
_skinLoaded = true;
}
if(_skinLoaded)
AttachChildControls();
}
protected void SetPageTitle(string text)
{
Title.Set(string.Format("{0} : {1}", CurrentGallery.Name,text), Context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -