📄 itemphotoimage.cs
字号:
namespace ASPNET.StarterKit.Communities {
using System;
using ASPNET.StarterKit.Communities.PhotoGallery;
//*********************************************************************
//
// ItemPhotoImage Class
//
// Represents a photogallery image
//
//*********************************************************************
public class ItemPhotoImage : ItemImage {
public ItemPhotoImage() : base() {
CssClass = "itemPhotoImage";
EnableViewState = false;
}
//*********************************************************************
//
// OnDataBinding Method
//
// When databound, get the image information
//
//*********************************************************************
override protected void OnDataBinding(EventArgs e) {
ContentItem item;
if (NamingContainer is ContentItem)
item = (ContentItem)NamingContainer;
else
item = (ContentItem)NamingContainer.NamingContainer;
SectionInfo objSectionInfo = (SectionInfo)Context.Items["SectionInfo"];
PhotoInfo objPhotoInfo = (PhotoInfo)item.DataItem;
if (objPhotoInfo.ImageID != -1) {
if (objSectionInfo.ID == objPhotoInfo.SectionID) {
ImageUrl = ImageUtility.BuildImagePath(objPhotoInfo.ImageID, objPhotoInfo.ImageName);
NavigateUrl = CommunityGlobals.CalculatePath(String.Format("{0}.aspx", objPhotoInfo.ContentPageID));
} else {
ImageUrl = ImageUtility.BuildFullImagePath(objPhotoInfo.SectionID, objPhotoInfo.ImageID, objPhotoInfo.ImageName);
NavigateUrl = ContentPageUtility.CalculateContentPath(objPhotoInfo.SectionID, objPhotoInfo.ContentPageID);
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -