Ejemplo n.º 1
0
        public bool TrySetEnvironment(IAzureEnvironment environment, out IAzureEnvironment mergedEnvironment)
        {
            bool result = false;

            mergedEnvironment = environment;
            if (environment != null && !AzureEnvironment.PublicEnvironments.ContainsKey(environment.Name))
            {
                if (EnvironmentTable.ContainsKey(environment.Name))
                {
                    mergedEnvironment = mergedEnvironment.Merge(EnvironmentTable[environment.Name]);
                }

                EnvironmentTable[environment.Name] = mergedEnvironment;
                result = true;
                foreach (var context in Contexts)
                {
                    if (context.Value.Environment != null &&
                        context.Value.Environment.Name == environment.Name)
                    {
                        context.Value.Environment = mergedEnvironment;
                    }
                }
            }

            return(result);
        }
Ejemplo n.º 2
0
        public bool TrySetEnvironment(IAzureEnvironment environment, out IAzureEnvironment mergedEnvironment)
        {
            bool result = false;

            mergedEnvironment = environment;
            if (environment != null && !AzureEnvironment.PublicEnvironments.ContainsKey(environment.Name))
            {
                if (EnvironmentTable.ContainsKey(environment.Name))
                {
                    mergedEnvironment = mergedEnvironment.Merge(EnvironmentTable[environment.Name]);
                }

                EnvironmentTable[environment.Name] = mergedEnvironment;
                result = true;
            }

            return(result);
        }
Ejemplo n.º 3
0
 public bool HasEnvironment(string name)
 {
     return(EnvironmentTable.ContainsKey(name));
 }