toolbarpostbackbutton.cs

来自「FreeTextBox HTML在线编辑器源代码 (C#源代码)阅读一下对掌握」· CS 代码 · 共 66 行

CS
66
字号
using System;

namespace FreeTextBoxControls
{
	//ADD: Ethan J. Brown
	/// <summary>
	/// A button used in an Toolbar that supports a postback event
	/// </summary>
	public class ToolbarPostBackButton : ToolbarItem
	{
		public ToolbarPostBackButton() {}

		public ToolbarPostBackButton(string title, string name)
		{
			this.Title = title;
			this.Name = name;
			this.Function = "FTB_" + name + "_CLIENTID";
			this.ScriptBlock = @"
<script language=""JavaScript"">
function FTB_" + name + @"_CLIENTID(editor,htmlmode) {
	<POSTBACK>" + name + @"</POSTBACK>
}
</script>";
		}

		private bool titleVisible = false;

		/*
		/// <summary>
		/// The event fired when the button is clicked.
		/// </summary>
		public event EventHandler Click;

		/// <summary>
		/// Event for button click
		/// </summary>
		protected virtual void OnClick(EventArgs e)
		{
			if (Click != null)
			{
				Click(this, e);
			}
		}
		*/

		/// <summary>
		/// Determines whether a button's Title is shown
		/// </summary>
		public bool TitleVisible
		{
			get
			{
				return titleVisible;
			}
			set
			{
				titleVisible = value;
			}
		}

		/// <summary>
		/// Determines how the title of the button will be displayed
		/// </summary>
		public ButtonTitleMode ButtonTitleMode = ButtonTitleMode.None;
	}
}

⌨️ 快捷键说明

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