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

📄 abstractsharpquerycommand.cs

📁 c#源代码
💻 CS
字号:
using System;
using System.Windows.Forms;

using ICSharpCode.Core.AddIns.Codons;
using SharpQuery.Gui.TreeView;

namespace SharpQuery.Commands
{
	/// <summary>
	/// Base class of all commands of SharpQuery Addin
	/// </summary>
	public abstract class AbstractSharpQueryCommand : AbstractMenuCommand
	{	
		protected ISharpQueryNode sharpQueryNode = null;
				
		/// <summary>
		/// get the selected <see cref="SharpQuery.Gui.TreeView.ISharpQueryNode"> SharpQuery node </see>
		/// and Enabled or disabled the command
		/// <remarks> If the selected node is <code>null</code> or this is not a <see cref="SharpQuery.Gui.TreeView.ISharpQueryNode"> SharpQuery node </see>, return <code>false</code> (disable the menu)</remarks>
		/// </summary>				
		public override bool IsEnabled
		{
			get
			{
				SharpQueryTree sharpQueryTree;
				sharpQueryTree = this.Owner as SharpQueryTree;								
				
				if ( (sharpQueryTree != null) && ( sharpQueryTree.SelectedNode != null ) )
				{			
					this.sharpQueryNode = sharpQueryTree.SelectedNode as ISharpQueryNode;				
				}
				else
				{
					this.sharpQueryNode = null;
				}
				
				return (this.sharpQueryNode != null);				
			}			
			set{}
			
		}
		
		/// <summary>
		/// Create a new SharpQueryCommand
		/// </summary>		
		public AbstractSharpQueryCommand() : base()
		{
		}		
		
	}
}

⌨️ 快捷键说明

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