Exemple #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));
        }
Exemple #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);
        }
Exemple #3
0
 private static ProjectItem GetProjectItem(XamlFileDescription xamlFile)
 {
     return((ProjectItem)xamlFile.Tag);
 }