Ho l'oggetto ProjectItem e desidero ottenere l'IWPFTextView associato, se presente.Trova un IVsTextView o IWpfTextView per un determinato oggetto ProjectItem, nell'estensione VS 2010 RC
Ho provato a ottenere un IVsTextManager e quindi a scorrere le viste, ma iVsTextManager.EnumViews non restituisce mai nulla.
Ecco quello che ho finora:
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.
Sicuramente c'è un altro modo/meglio ??
Grazie in anticipo
~ Cameron
E come si fa a ottenere il wpfTextView ?. Grazie! – Morvader
Grande. Grazie per questo metodo di supporto. Mi ha davvero aiutato molto a risolvere un problema simile. –
Utilizzando il tuo metodo, ecco cosa ho risolto da solo: http://stackoverflow.com/a/24178352/395069 –