activeviewcontentuntitledevaluator.cs
来自「SharpDevelop2.0.0 c#开发免费工具」· CS 代码 · 共 44 行
CS
44 行
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision: 915 $</version>
// </file>
using System;
using System.Xml;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.Core
{
/// <summary>
/// Tests if the active view content is untitled.
/// </summary>
/// <attributes name="activewindowuntitled">Boolean value to test against.</attributes>
/// <example title="Test if the active view content is untitled">
/// <Condition name = "ActiveViewContentUntitled" activewindowuntitled="True">
/// - or -
/// <Condition name = "ActiveViewContentUntitled">
/// </example>
/// <example title="Test if the active view content has a title">
/// <Condition name = "ActiveViewContentUntitled" activewindowuntitled="False">
/// </example>
public class ActiveViewContentUntitledConditionEvaluator : IConditionEvaluator
{
public bool IsValid(object caller, Condition condition)
{
if (WorkbenchSingleton.Workbench == null || WorkbenchSingleton.Workbench.ActiveWorkbenchWindow == null || WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent == null) {
return false;
}
if (!condition.Properties.Contains("activewindowuntitled"))
return WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent.IsUntitled;
bool activewindowuntitled = Boolean.Parse(condition.Properties["activewindowuntitled"]);
return WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent.IsUntitled == activewindowuntitled;
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?