⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deletetokencommand.cs

📁 community server 源码
💻 CS
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Collections;
using CommunityServer.Components;
using CommunityServer.Controls;

namespace CommunityServer.ControlPanel.Blogs
{
	/// <summary>
	/// Summary description for DeleteTokenCommand.
	/// </summary>
	public class DeleteTokenCommand : BlogCommand
	{
		public DeleteTokenCommand()
		{
		}

		public override string Message(BlogCommandPage page)
		{

			TextToken token = GetToken();
			if(token == null)
			{
				Modal.ClosePage(page);
				return null;
			}

			return "Are you sure you want to the token <strong>" + token.Token + "</strong>? This action can not be undone.";
		}

		public override void Action(BlogCommandPage page)
		{
			TextToken token = GetToken();
			TextTokens.Delete(token);

		}

		protected TextToken GetToken()
		{
			CSContext context = CSContext.Current;
			int TokenID = Int32.Parse(context.QueryString["TokenID"]);
			int SectionID = context.SectionID;
			ArrayList list = TextTokens.GetTokens(SectionID);
			foreach(TextToken token in list)
			{
				if(token.TokenID == TokenID)
					return token;
			}

			return null;
		}

		public override string Title
		{
			get { return "Delete Token";}
		}

	}
}

⌨️ 快捷键说明

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