Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Access dte.ActiveDocument.ActiveWindow object in EnvDTE

$
0
0

I'm developing a Visual Studio Extension (Package), capable of interacting with Workflow Foundation 4 activities.

If the activity is opened in "code view", I'm able to access the xaml code and parse it's properties. But if the activity is opened in "design mode" i'm having trouble to access the activity elements or the xaml code.

var dte = (DTE2)serviceProvider.GetService(typeof(SDTE));
if (dte != null && dte.ActiveDocument != null)
{
    String xamlPath = dte.ActiveDocument.FullName;
    var document = (TextDocument)dte.ActiveDocument.Object("TextDocument");
    if (document != null)
    {
      //Code View
      var editPoint = document.CreateEditPoint(document.StartPoint);
      String xaml = editPoint.GetText(document.EndPoint);
     }
     else
     {
        //Designer ?????             //(dte.ActiveDocument.ActiveWindow.Object.designerHostView).ContentText;
        //?????
      }

Can you guys give me an hint?


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>