private void SetEndpoint(string endpoint, IAzureEnvironment environment, string endpointValue) { if (!environment.IsEndpointSet(endpoint) && !string.IsNullOrEmpty(endpointValue)) { environment.SetEndpoint(endpoint, endpointValue); } }
private void SetEndpointIfBound(IAzureEnvironment newEnvironment, string endpoint, string key) { if (MyInvocation.BoundParameters.ContainsKey(key)) { newEnvironment.SetEndpoint(endpoint, MyInvocation.BoundParameters[key] as string); } }
private void SetEndpointIfProvided(IAzureEnvironment newEnvironment, string endpoint, string property) { if (!string.IsNullOrEmpty(property)) { newEnvironment.SetEndpoint(endpoint, property); } }
private void SetEndpointIfProvided(IAzureEnvironment newEnvironment, string endpoint, string property, bool trailingSlash = false) { if (!string.IsNullOrEmpty(property)) { string value = property; if (!string.IsNullOrWhiteSpace(value) && trailingSlash) { value = value.EndsWith("/", StringComparison.OrdinalIgnoreCase) ? value : value + "/"; } newEnvironment.SetEndpoint(endpoint, value); } }
private void SetEndpointIfBound(IAzureEnvironment newEnvironment, string endpoint, string key, bool trailingSlash = false) { if (MyInvocation.BoundParameters.ContainsKey(key)) { string value = MyInvocation.BoundParameters[key] as string; if (!string.IsNullOrWhiteSpace(value) && trailingSlash) { value = value.EndsWith("/", StringComparison.OrdinalIgnoreCase) ? value : value + "/"; } newEnvironment.SetEndpoint(endpoint, value); } }