Esempio n. 1
0
        protected void UpdateCompilation(string docName, string code)
        {
            Document newDoc =
                TheWorkspace.AddDocument(docName, code);

            this.TheProj = TheWorkspace.CurrentProj;

            SyntaxTree syntaxTree =
                newDoc.GetSyntaxTreeAsync().Result;

            TheCompilation = TheCompilation.AddSyntaxTrees(syntaxTree);
        }
Esempio n. 2
0
        internal void CreateProject()
        {
            TheWorkspace.ClearSolution();

            ProjectInfo projInfo =
                ProjectInfo.Create
                (
                    TheProjId,
                    VersionStamp.Create(),
                    ProjName,
                    AssemblerNames.GENERATED_NAMESPACE_NAME,
                    LanguageNames.CSharp,
                    parseOptions: TheParseOptions,
                    compilationOptions: TheAssemblyCompilationsOptions
                );

            TheProj = TheWorkspace.AddProject(projInfo);

            TheCompilation =
                TheWorkspace.CurrentProj.GetCompilationAsync().Result;
        }