activeviewcontentuntitled.cs

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

CS
43
字号
// <file>
//     <copyright see="prj:///doc/copyright.txt"/>
//     <license see="prj:///doc/license.txt"/>
//     <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
//     <version value="$version"/>
// </file>

using System;
using System.Xml;


using ICSharpCode.Core.AddIns.Conditions;
using ICSharpCode.SharpDevelop.Gui;

namespace ICSharpCode.Core.AddIns
{
	[ConditionAttribute()]
	public class ActiveViewContentUntitled : AbstractCondition
	{
		[XmlMemberAttribute("activewindowuntitled", IsRequired = true)]
		bool activewindowuntitled;
		
		public bool Activewindowuntitled {
			get {
				return activewindowuntitled;
			}
			set {
				activewindowuntitled = value;
			}
		}
		
		public override bool IsValid(object owner)
		{
			if (WorkbenchSingleton.Workbench == null || WorkbenchSingleton.Workbench.ActiveWorkbenchWindow == null) {
				return false;
			}
			
			return WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent.IsUntitled && activewindowuntitled ||
			       !WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent.IsUntitled && !activewindowuntitled ;
		}
	}
}

⌨️ 快捷键说明

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