commentextension.cs
来自「该项目中对 SQLHelper 类进行了简单封装」· CS 代码 · 共 44 行
CS
44 行
/*
* CommentExtension.cs @Microsoft Visual Studio 2005 <.NET Framework 2.0>
* AfritXia
* 2007-12-12
*
* Copyright(c) http://www.AfritXia.NET/
*
*/
using System;
using System.Configuration;
using NET.AfritXia.MyHome.Extension;
using NET.AfritXia.MyHome.Model.Message;
namespace NET.AfritXia.MyHome.Extension.CheckingServerUID
{
public class CommentExtension : CommentExtensionBase
{
public override void OnPreAppend(Comment newComment)
{
string serverID = ServerUIDAnalyzer.GetServerUID(this.Actor);
if (String.Compare(serverID, ServerUIDConfiguration.ServerUIDHomeStart) != 0 &&
String.Compare(serverID, ServerUIDConfiguration.ServerUIDHomeManagement) != 0)
throw new ServerUIDError("can't append new comment");
}
public override void OnPreDelete(Comment delComment)
{
if (String.Compare(ServerUIDAnalyzer.GetServerUID(this.Actor), ServerUIDConfiguration.ServerUIDHomeManagement) != 0)
throw new ServerUIDError("can't delete comment");
}
public override void OnPreViewCommentList(int belongToArticleID)
{
string serverID = ServerUIDAnalyzer.GetServerUID(this.Actor);
if (String.Compare(serverID, ServerUIDConfiguration.ServerUIDHomeStart) != 0 &&
String.Compare(serverID, ServerUIDConfiguration.ServerUIDHomeManagement) != 0)
throw new ServerUIDError("can't view comment list");
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?