Microsoft.Azure.Commands.Resources.GetAzureProviderOperationCommand.ValidateActionSearchString C# (CSharp) Method

ValidateActionSearchString() private static method

private static ValidateActionSearchString ( string actionSearchString ) : void
actionSearchString string
return void
        private static void ValidateActionSearchString(string actionSearchString)
        {
            if (actionSearchString.Contains("?"))
            {
                throw new ArgumentException(ProjectResources.ProviderOperationUnsupportedWildcard);
            }

            string[] parts = actionSearchString.Split(Separator);
            if (parts.Any(p => p.Contains(WildCardCharacter) && p.Length != 1))
            {
                throw new ArgumentException(ProjectResources.OperationSearchStringInvalidWildcard);
            }

            if (parts.Length == 1 && parts[0] != WildCardCharacter)
            {
                throw new ArgumentException(string.Format(ProjectResources.OperationSearchStringInvalidProviderName, parts[0]));
            }
        }