当前位置: 首页>>代码示例>>C#>>正文


C# FileName.Equals方法代码示例

本文整理汇总了C#中FileName.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# FileName.Equals方法的具体用法?C# FileName.Equals怎么用?C# FileName.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileName的用法示例。


在下文中一共展示了FileName.Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowAsSearchResults

		public static void ShowAsSearchResults(string title, List<Reference> list)
		{
			if (list == null) return;
			List<SearchResultMatch> results = new List<SearchResultMatch>(list.Count);
			TextDocument document = null;
			ITextBuffer buffer = null;
			FileName fileName = null;
			ISyntaxHighlighter highlighter = null;
			foreach (Reference r in list) {
				var f = new FileName(r.FileName);
				if (document == null || !f.Equals(fileName)) {
					buffer = ParserService.GetParseableFileContent(r.FileName);
					document = new TextDocument(DocumentUtilitites.GetTextSource(buffer));
					fileName = new FileName(r.FileName);
					highlighter = EditorControlService.Instance.CreateHighlighter(new AvalonEditDocumentAdapter(document, null), fileName);
				}
				var start = document.GetLocation(r.Offset).ToLocation();
				var end = document.GetLocation(r.Offset + r.Length).ToLocation();
				var builder = SearchResultsPad.CreateInlineBuilder(start, end, document, highlighter);
				SearchResultMatch res = new SearchResultMatch(fileName, start, end, r.Offset, r.Length, builder, highlighter.DefaultTextColor);
				results.Add(res);
			}
			SearchResultsPad.Instance.ShowSearchResults(title, results);
			SearchResultsPad.Instance.BringToFront();
		}
开发者ID:rbrunhuber,项目名称:SharpDevelop,代码行数:25,代码来源:FindReferencesAndRenameHelper.cs

示例2: ShowAsSearchResults

		public static void ShowAsSearchResults(string title, List<Reference> list)
		{
			if (list == null) return;
			List<SearchResultMatch> results = new List<SearchResultMatch>(list.Count);
			TextDocument document = null;
			FileName fileName = null;
			IHighlighter highlighter = null;
			foreach (Reference r in list) {
				var f = new FileName(r.FileName);
				if (document == null || !f.Equals(fileName)) {
					document = new TextDocument(DocumentUtilitites.GetTextSource(ParserService.GetParseableFileContent(r.FileName)));
					fileName = new FileName(r.FileName);
					var def = HighlightingManager.Instance.GetDefinitionByExtension(Path.GetExtension(r.FileName));
					if (def != null)
						highlighter = new DocumentHighlighter(document, def.MainRuleSet);
					else
						highlighter = null;
				}
				var start = document.GetLocation(r.Offset).ToLocation();
				var end = document.GetLocation(r.Offset + r.Length).ToLocation();
				var builder = SearchResultsPad.CreateInlineBuilder(start, end, document, highlighter);
				SearchResultMatch res = new SearchResultMatch(fileName, start, end, r.Offset, r.Length, builder);
				results.Add(res);
			}
			SearchResultsPad.Instance.ShowSearchResults(title, results);
			SearchResultsPad.Instance.BringToFront();
		}
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:27,代码来源:FindReferencesAndRenameHelper.cs

示例3: AssertEqualityNotEquals

 private static void AssertEqualityNotEquals(FileName left, object right)
 {
     Assert.That(left.Equals(right), Is.False, string.Format("! '{0}'.Equals('{1}')", left, right));
     Assert.That(left.GetHashCode(), Is.Not.EqualTo(right.GetHashCode()), string.Format("'{0}'.GetHashCode() != '{1}'.GetHashCode()", left, right));
 }
开发者ID:toroso,项目名称:fs4net,代码行数:5,代码来源:FileNameEqualityFixture.cs


注:本文中的FileName.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。