Get code element of graphnode of dependency graph RRS feed

  • Question

  • Hi,

    I'm trying to pair EnvDTE.CodeElement objects with each Microsoft.VisualStudio.GraphModel.GraphNode of generated dependency graph.

    I've already tried two approaches:

    In first I tried to create ID from CodeElement object using get_Prototype method which would be same as GraphNodeId converted by CodeGraphNodeIdBuilder.getLabel. Even after resolving type names problem these two IDs were in some cases still slightly different.

    Q1: Is there any way how can I obtain/recreate Id from CodeElement exactly same as GraphNodeId? (How is GraphNodeId in dependency graphs created ?)

    In second approach I tried to pair these two objects by textpoint/position but i wasn't able to get any kind of source location to which GraphNode refers (You are navigated to this position in source code after double click on graph node of dependency graph in graph visualizer)

    Q2: Is there any way how  to get this position? (textpoint/position/sourcelocation/any object/file line char-offset/whatever)

    Q3: Are there any other ways how to achieve my goal?




    Friday, June 28, 2013 9:59 AM