abstractsharpquerycommand.cs

来自「全功能c#编译器」· CS 代码 · 共 52 行

CS
52
字号
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 + =
减小字号Ctrl + -
显示快捷键?