
I'm trying to build some sort of class view based on DocumentOutlineTreeView in the original example. I want to display a member info similar to QuickInfo once a node is clicked in the tree.
There seems to be no easy way to retrieve information I want (or perhaps I'm just missing it). I hacked it using reflection but I wonder if there is an easier way to do that.
There seems to be no easy way to retrieve information I want (or perhaps I'm just missing it). I hacked it using reflection but I wonder if there is an easier way to do that.
IDomMember type = e.Node.Tag as IDomMember;
object[] param;
object offset = null;
// CSharpSyntaxLanguage:
// protected override DotNetContext GetContext(SyntaxEditor, int, bool, bool)
MethodInfo m = typeof(DotNetSyntaxLanguage).GetMethod("GetContext", BindingFlags.NonPublic | BindingFlags.Instance);
if (m == null)
return;
param = new object[] { this.buddyCodeEditor.Editor, offset, false, false };
DotNetContext context = (DotNetContext)m.Invoke(this.buddyCodeEditor.Document.Language,
param);
// DotNetProjectResolver:
// internal string a(DotNetLanguage, DotNetContext, IDomType, IDomMember, int, bool)
m = typeof(DotNetProjectResolver).GetMethod("a",
BindingFlags.NonPublic | BindingFlags.Instance,
null,
new Type[] { typeof(DotNetLanguage),
typeof(DotNetContext),
typeof(IDomType), typeof(IDomMember), typeof(int), typeof(bool) }, null);
if (m == null)
return;
param = new object[] { DotNetLanguage.CSharp, context, null, type, -1, true };
object o = m.Invoke(this.classViewUpdater.ProjectResolver, param);
if (o != null && o is string)
{
string html = o as string;
this.markupLabel.Text = html;
}