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

📄 comparecondition.cs

📁 全功能c#编译器
💻 CS
字号:
// <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.Services;

namespace ICSharpCode.Core.AddIns.Conditions
{
	/// <summary>
	/// This condition compares two strings using the stringParserService 
	/// for the two strings to compare.
	/// </summary>
	[ConditionAttribute()]
	public class CompareCondition : AbstractCondition
	{
		[XmlMemberAttribute("string", IsRequired=true)]
		string s1;
		
		[XmlMemberAttribute("equals", IsRequired=true)]
		string s2;
		
		/// <summary>
		/// Returns the first string to compare.
		/// </summary>
		public string String1 {
			get {
				return s1;
			}
			set {
				s1 = value;
			}
		}
		
		/// <summary>
		/// Returns the second string to compare.
		/// </summary>
		public string String2 {
			get {
				return s2;
			}
			set {
				s2 = value;
			}
		}
		
		/// <summary>
		/// Returns true, if both <code>stringParserService</code> expanded 
		/// strings are equal.
		/// </summary>
		public override bool IsValid(object owner)
		{
			StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
			return stringParserService.Parse(s1) == stringParserService.Parse(s2);
		}
	}
}

⌨️ 快捷键说明

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