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); }
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); }
public bool HasEnvironment(string name) { return(EnvironmentTable.ContainsKey(name)); }