Beispiel #1
0
        public TextReader GetXamlFileContent(XamlFileDescription xamlFile)
        {
            ProjectItem projectItem = GetProjectItem(xamlFile);

            if (projectItem.Document != null)
            {
                return(new StringReader(GetDocumentText(projectItem.Document)));
            }

            return(File.OpenText(xamlFile.Name));
        }
Beispiel #2
0
        public void SetXamlFileContent(XamlFileDescription xamlFile, string content)
        {
            ProjectItem projectItem = GetProjectItem(xamlFile);

            if (projectItem.Document == null)
            {
                Window win = projectItem.Open(Constants.vsViewKindTextView);
                win.Visible = true;
            }

            SetDocumentText(projectItem.Document, content);
        }
Beispiel #3
0
 private static ProjectItem GetProjectItem(XamlFileDescription xamlFile)
 {
     return((ProjectItem)xamlFile.Tag);
 }