public TextReader GetXamlFileContent(XamlFileDescription xamlFile) { ProjectItem projectItem = GetProjectItem(xamlFile); if (projectItem.Document != null) { return(new StringReader(GetDocumentText(projectItem.Document))); } return(File.OpenText(xamlFile.Name)); }
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); }
private static ProjectItem GetProjectItem(XamlFileDescription xamlFile) { return((ProjectItem)xamlFile.Tag); }