// do not use an event for this because a solution might be loaded before ParserService // is initialized internal static void OnSolutionLoaded(List <ParseProjectContent> createdContents) { WorkbenchSingleton.DebugAssertMainThread(); Debug.Assert(jobs != null); Solution openedSolution = ProjectService.OpenSolution; isThreadRunning = true; WorkbenchSingleton.SafeThreadAsyncCall(ProjectService.ParserServiceCreatedProjectContents); for (int i = 0; i < createdContents.Count; i++) { ParseProjectContent pc = createdContents[i]; jobs.AddJob(new JobTask(pc.Initialize1, GetLoadReferenceTaskTitle(pc.ProjectName), 10)); } for (int i = 0; i < createdContents.Count; i++) { ParseProjectContent pc = createdContents[i]; jobs.AddJob(new JobTask(pc.Initialize2, GetParseTaskTitle(pc.ProjectName), pc.GetInitializationWorkAmount())); } jobs.AddJob(new JobTask(ct => RaiseThreadEnded(openedSolution), "", 0)); jobs.StartRunningIfRequired(); }
internal static void StartParserThread() { WorkbenchSingleton.DebugAssertMainThread(); timer = new DispatcherTimer(DispatcherPriority.Background); timer.Interval = TimeSpan.FromSeconds(1.5); timer.Tick += new EventHandler(timer_Tick); timer.Start(); }
public static bool GetClipboardContainsText() { WorkbenchSingleton.DebugAssertMainThread(); if (WorkbenchSingleton.Workbench != null && WorkbenchSingleton.Workbench.IsActiveWindow) { UpdateClipboardContainsText(); } return(clipboardContainsText); }
void ParserServiceParseInformationUpdated(object sender, ParseInformationEventArgs e) { WorkbenchSingleton.DebugAssertMainThread(); foreach (TreeNode node in classBrowserTreeView.Nodes) { AbstractProjectNode prjNode = node as AbstractProjectNode; if (prjNode != null && e.ProjectContent.Project == prjNode.Project) { prjNode.UpdateParseInformation(e.OldCompilationUnit, e.NewCompilationUnit); } } }