本文整理汇总了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();
}
示例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();
}
示例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));
}