Ejemplo n.º 1
0
        private Document CreateProjectAndOpenNewDocument(Workspace workspace, ProjectInfo projectInfo, SourceText sourceText)
        {
            var documentId = DocumentId.CreateNewId(projectInfo.Id);
            var solution   = _workspace.CurrentSolution
                             .AddProject(projectInfo)
                             .AddDocument(documentId, "_", sourceText);

            solution = _workspace.SetCurrentSolution(solution);
            workspace.OpenDocument(documentId);
            return(solution.GetDocument(documentId));
        }