Example #1
0
            public async Task LoadProject(Options options = null, bool loadCachedContents = true, bool registerCallback = true)
            {
                if (loadCachedContents)
                {
                    CommentTasksProvider.LoadCachedContents();
                }

                Task task;

                if (registerCallback)
                {
                    var tcs = RegisterCallback(options);
                    BindTimeout(tcs);
                    task = tcs.Task;
                }
                else
                {
                    task = Task.CompletedTask;
                }

                var monitor = new ProgressMonitor();
                // Load the solution into the workspace.
                bool opened = await IdeServices.Workspace.OpenWorkspaceItemInternal(solFile, true, true, null, monitor);

                var errorString = string.Join(Environment.NewLine, monitor.Errors.Select(x => x.Message + ":" + x.Exception));

                Assert.IsFalse(monitor.HasErrors, $"Monitor reported errors: {errorString}");
                Assert.IsTrue(opened, $"Solution file {solFile} could not be opened");

                await task;
            }
Example #2
0
 void OnWorkspaceItemLoaded(object sender, EventArgs e)
 {
     comments.BeginTaskUpdates();
     try {
         CommentTasksProvider.LoadCachedContents();
         foreach (var sln in IdeApp.Workspace.GetAllSolutions())
         {
             CommentTasksProvider.Legacy.LoadSolutionContents(sln);
             loadedSlns.Add(sln);
         }
     }
     finally {
         comments.EndTaskUpdates();
     }
 }
 public void TearDown()
 {
     CommentTasksProvider.ResetCachedContents(null);
 }