📄 gallerytemplatedwebcontrol.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using CommunityServer.Components;
using CommunityServer.Controls;
using CommunityServer.Galleries.Components;
namespace CommunityServer.Galleries.Controls
{
/// <summary>
/// Base class for skinned gallery controls.
/// </summary>
public abstract class GalleryTemplatedWebControl : TemplatedWebControl
{
private User _currentUser = null;
private Gallery _currentGallery = null;
private PostCategory _currentCategory = null;
private Picture _currentPicture = null;
public GalleryTemplatedWebControl():base()
{
_currentUser = CSContext.Current.User;
}
/// <exclude />
protected override String ExternalSkinFileName
{
get
{
return string.Format("/Galleries/Skin-{0}.ascx",this.GetType().Name);
}
}
public virtual User CurrentUser
{
get { return _currentUser; }
}
public virtual Gallery CurrentGallery
{
get
{
if(_currentGallery == null)
if(CSContext.Current.ApplicationKey != "")
_currentGallery = Galleries.GetGallery( CSContext.Current.ApplicationKey );
return _currentGallery;
}
}
public virtual PostCategory CurrentCategory
{
get
{
if(_currentCategory == null)
if(CSContext.Current.CategoryID != -1)
_currentCategory = PostCategories.GetCategory(CSContext.Current.CategoryID, CategoryType.GalleryPicture, CurrentGallery.SectionID, CurrentUser.IsGalleryAdministrator);
return _currentCategory;
}
}
public virtual Picture CurrentPicture
{
get
{
if(_currentPicture == null)
if(CSContext.Current.PostID != -1)
_currentPicture = Pictures.GetPicture(CurrentGallery.SectionID, CSContext.Current.PostID);
return _currentPicture;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -