📄 highlightpicture.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using CommunityServer.Components;
using CommunityServer.Galleries.Components;
namespace CommunityServer.Galleries.Controls
{
/// <summary>
/// Summary description for SidePortal.
/// </summary>
public class HighlightPicture : RandomPicture //: GalleryImage
{
#region Public Properties
#endregion
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
// Use a different prefix for the img id attribute than the default "SmallThumb" so there won't
// be duplicate id's if a PictureListing control containing the random image is on the same page.
imageIDprefix = "HighlightPicture";
}
protected override void LoadPicture()
{
if((SectionID == -1) && (ApplicationKey != ""))
SectionID = Galleries.GetGalleryID( ApplicationKey );
else if(SectionID == -1)
{
Gallery gallery = Galleries.GetRandomGallery();
if(gallery == null)
return;
SectionID = gallery.SectionID;
}
GalleryPostCategory category = GalleryPostCategory.Parse(PostCategories.GetCategory(CategoryID, SectionID));
if(category.HasFeaturedPhoto)
GalleryPost = (GalleryPost)category.FeaturedPost;
else
GalleryPost = GalleryPosts.GetFirstPicture(SectionID, CategoryID);
if(this.UseLink && this.LinkToPicture && ApplicationKey != "" && GalleryPost != null)
base.NavigateUrl = GalleryUrls.Instance().ViewPicture(ApplicationKey,CategoryID, GalleryPost);
if(this.UseLink && this.LinkToCategory && ApplicationKey != "")
base.NavigateUrl = GalleryUrls.Instance().ViewCategory(ApplicationKey, CategoryID) ;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -