本文整理汇总了C#中SVsServiceProvider.GetTextManager2方法的典型用法代码示例。如果您正苦于以下问题:C# SVsServiceProvider.GetTextManager2方法的具体用法?C# SVsServiceProvider.GetTextManager2怎么用?C# SVsServiceProvider.GetTextManager2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVsServiceProvider
的用法示例。
在下文中一共展示了SVsServiceProvider.GetTextManager2方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LanguageInfo
public LanguageInfo(SVsServiceProvider serviceProvider, Guid languageGuid)
{
Contract.Requires<ArgumentNullException>(serviceProvider != null, "serviceProvider");
_serviceProvider = serviceProvider;
_languageGuid = languageGuid;
IVsTextManager2 textManager = serviceProvider.GetTextManager2();
LANGPREFERENCES2[] preferences = new LANGPREFERENCES2[1];
preferences[0].guidLang = languageGuid;
ErrorHandler.ThrowOnFailure(textManager.GetUserPreferences2(null, null, preferences, null));
_languagePreferences = CreateLanguagePreferences(preferences[0]);
_languagePreferencesCookie = ((IConnectionPointContainer)textManager).Advise<LanguagePreferences, IVsTextManagerEvents2>(_languagePreferences);
}
示例2: LanguageInfo
public LanguageInfo(SVsServiceProvider serviceProvider, Guid languageGuid)
{
if (serviceProvider == null)
{
throw new ArgumentNullException("serviceProvider");
}
this._serviceProvider = serviceProvider;
this._languageGuid = languageGuid;
IVsTextManager2 manager = serviceProvider.GetTextManager2();
LANGPREFERENCES2[] pLangPrefs = new LANGPREFERENCES2[1];
pLangPrefs[0].guidLang = languageGuid;
ErrorHandler.ThrowOnFailure(manager.GetUserPreferences2(null, null, pLangPrefs, null));
this._languagePreferences = this.CreateLanguagePreferences(pLangPrefs[0]);
this._languagePreferencesCookie = ((IConnectionPointContainer) manager).Advise<Smi.VisualStudio.Language.LanguagePreferences, IVsTextManagerEvents2>(this._languagePreferences);
}