📄 book.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using CommunityServer.Components;
namespace CommunityServer.GuestBooks.Components
{
/// <summary>
/// Summary description for GuestBook.
/// </summary>
public class Book : Section
{
public Book()
{
this.ApplicationType = ApplicationType.GuestBook;
}
#region Private/Internal
AccessCheckDelegate acd = null;
ValidatePermissionsDelegate vpd = null;
GuestBookPermission op = null;
#endregion
public override PermissionBase OwnerPermission
{
get
{
if(op == null)
{
op = new GuestBookPermission();
op.SetBit(Permission.Post,AccessControlEntry.Allow);
op.SetBit(Permission.Reply,AccessControlEntry.Allow);
op.SetBit(Permission.View,AccessControlEntry.Allow);
}
return op;
}
}
/// <summary>
/// Each section type must return it's permission type
/// </summary>
public override PermissionBase DefaultRolePermission
{
get { return new GuestBookPermission(); }
}
/// <summary>
/// Provides the Method implementing the AccessCheckDelegate signature
/// </summary>
public override AccessCheckDelegate AccessCheck
{
get
{
if(acd == null)
acd = new AccessCheckDelegate(GuestBookPermission.AccessCheck);
return acd;
}
}
/// <summary>
/// Provides the Method implementing the ValidateDelegate signature
/// </summary>
public override ValidatePermissionsDelegate ValidatePermissions
{
get
{
if(vpd == null)
vpd = new ValidatePermissionsDelegate(GuestBookPermission.Validate);
return vpd;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -