예제 #1
0
        /// <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();
            }
        }
예제 #2
0
 private bool AgentGroupIsSuppliedButNoMatchingFound(string agentGroup)
 => !string.IsNullOrWhiteSpace(agentGroup) && Environments.All(a => a.AgentGroup != agentGroup);