/// <summary> /// Return a list of projects. Returns empty list if no item is found. /// </summary> private async Task <IList <Project> > GetProjectsAsync() { ResourceManagerDataSource resourceManager = DataSourceFactories.CreateResourceManagerDataSource(); if (resourceManager == null) { return(new List <Project>()); } IsReady = false; try { var projects = await resourceManager.GetSortedActiveProjectsAsync(); if (!projects.Any()) { UserPromptUtils.OkPrompt( message: Resources.CsrNoProjectMessage, title: Resources.CsrConnectSectionTitle); } return(projects); } finally { IsReady = true; } }
private void AddReverse(ConfiguredDataSourceFactory dataSourceFactory, bool isAutoReversal) { var reverseDataSourceFactory = dataSourceFactory.CreateReverseIfAppropriate(isAutoReversal); if (reverseDataSourceFactory != null) { DataSourceFactories.AddOrReplaceThenSort(reverseDataSourceFactory); } }