articleextension.cs
来自「该项目中对 SQLHelper 类进行了简单封装」· CS 代码 · 共 56 行
CS
56 行
/*
* ArticleExtension.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 ArticleExtension : ArticleExtensionBase
{
public override void OnPreAppend(Article newArticle)
{
if (String.Compare(ServerUIDAnalyzer.GetServerUID(this.Actor), ServerUIDConfiguration.ServerUIDHomeManagement) != 0)
throw new ServerUIDError("can't append new article");
}
public override void OnPreDelete(Article delArticle)
{
if (String.Compare(ServerUIDAnalyzer.GetServerUID(this.Actor), ServerUIDConfiguration.ServerUIDHomeManagement) != 0)
throw new ServerUIDError("can't delete article");
}
public override void OnPreUpdate(Article newArticle)
{
if (String.Compare(ServerUIDAnalyzer.GetServerUID(this.Actor), ServerUIDConfiguration.ServerUIDHomeManagement) != 0)
throw new ServerUIDError("can't update article");
}
public override void OnPreGetArticleList()
{
string serverID = ServerUIDAnalyzer.GetServerUID(this.Actor);
if (String.Compare(serverID, ServerUIDConfiguration.ServerUIDHomeStart) != 0 &&
String.Compare(serverID, ServerUIDConfiguration.ServerUIDHomeManagement) != 0)
throw new ServerUIDError("can't get article list");
}
public override void OnPreViewArticle(int articleID)
{
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 article");
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?