本文整理汇总了C#中IWpfTextView.GetFilePath方法的典型用法代码示例。如果您正苦于以下问题:C# IWpfTextView.GetFilePath方法的具体用法?C# IWpfTextView.GetFilePath怎么用?C# IWpfTextView.GetFilePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWpfTextView
的用法示例。
在下文中一共展示了IWpfTextView.GetFilePath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterTextBuffer
/// <summary>
/// Called whenever a new view is created.
/// This method checks to see if it is a custom dictionary, and if it is, it gets attached.
/// </summary>
/// <param name="wpfTextView"></param>
public void RegisterTextBuffer(IWpfTextView wpfTextView)
{
// If this isn't the dictionary, we don't care.
var filePath = wpfTextView.GetFilePath();
var fileName = Path.GetFileName(filePath);
if (String.Compare(fileName, DictionaryFileName, StringComparison.InvariantCultureIgnoreCase) != 0)
return;
// Get the dictionary;
var spellingDictionaryService = GetSpellingDictionaryService(fileName);
// Do we have a project dictionary?
var projectSpellingDictionaryService = spellingDictionaryService as IProjectSpecificDictionary;
// Assign the buffer
if (projectSpellingDictionaryService != null)
projectSpellingDictionaryService.ConnectBufferListener(wpfTextView.TextBuffer);
}
开发者ID:camerondpeters,项目名称:SpellChecker.ProjectDictionary,代码行数:23,代码来源:ProjectSpecificDictionaryProvider.cs