У меня есть ProjectItem и хочу получить связанный с ним IWPFTextView, если он есть.
Я попытался получить файл IVsTextManager, а затем повторить просмотры, но iVsTextManager.EnumViews всегда ничего не возвращает.
Вот что я получил до сих пор:
var txtMgr = (IVsTextManager)Package.GetGlobalService(typeof(SVsTextManager));
if (txtMgr != null)
{
IVsEnumTextViews iVsEnumTextViews;
IVsTextView[] views = null;
// Passing null will return all available views, at least according to the documentation
// unfortunately, this returns a 0x80070057 error (invalid parameter)
var errorValue = txtMgr.EnumViews(null, out iVsEnumTextViews);
if (errorValue == VSConstants.S_OK)
{
// enumerate, find the IVsTextView with a matching filename.
Конечно, есть другой/лучший способ?
Заранее спасибо
~ Камерон