/// <summary> /// Adds an environment and it's resources to the tree /// </summary> public void AddEnvironment(IEnvironmentModel environment) { VerifyArgument.IsNotNull("environment", environment); var environmentId = environment.ID; StudioResourceRepository.AddServerNode(new ExplorerItemModel(_connectControlSingleton, StudioResourceRepository) { ResourcePath = "", DisplayName = environment.Name, ResourceType = ResourceType.Server, EnvironmentId = environment.ID, IsConnected = false, }); if (Environments.All(e => e.ID != environmentId)) { Environments.Add(environment); } UpdateNavigationView(); if (environment.Equals(EnvironmentRepository.Source) && environment.Connection != null) { environment.Connection.StartAutoConnect(); } }
private bool AgentGroupIsSuppliedButNoMatchingFound(string agentGroup) => !string.IsNullOrWhiteSpace(agentGroup) && Environments.All(a => a.AgentGroup != agentGroup);