public Task SaveSolutionExplorerNodeStates(ISolutionManager solutionManager) { if (solutionManager == null) { throw new ArgumentNullException(nameof(solutionManager)); } return(NuGetUIThreadHelper.JoinableTaskFactory.Run(async delegate { await NuGetUIThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); _expandedNodes = await VsHierarchyUtility.GetAllExpandedNodesAsync(solutionManager); return Task.CompletedTask; })); }