censorshipmodule.cs

来自「community server 源码」· CS 代码 · 共 47 行

CS
47
字号
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using CommunityServer.Components;

namespace CommunityServer.Files.Components
{
	/// <summary>
	/// Summary description for CensorshipModule.
	/// </summary>
	public class CensorshipModule : BaseFilesFormattedBodyModule
	{
		public CensorshipModule()
		{
			//
			// TODO: Add constructor logic here
			//
		}

		protected override void Format(Entry e)
		{
			if( CSContext.Current.SiteSettings.EnableCensorship )
			{
				e.FormattedBody = Transforms.CensorPost( e.FormattedBody );
				e.Subject = Transforms.CensorPost( e.Subject );
			
				if(e.PostID > 0)
					e.EditNotes = Transforms.CensorPost( e.EditNotes );
			}
		}

		protected override void Format(EntryComment ec)
		{
			if( CSContext.Current.SiteSettings.EnableCensorship )
			{
				ec.FormattedBody = Transforms.CensorPost( ec.FormattedBody );
				ec.Subject = Transforms.CensorPost( ec.Subject );
			}
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?