NuGet.Commands.SourcesCommand.ValidateCredentials C# (CSharp) Method

ValidateCredentials() private method

private ValidateCredentials ( ) : void
return void
        private void ValidateCredentials()
        {
            bool userNameEmpty = String.IsNullOrEmpty(UserName);
            bool passwordEmpty = String.IsNullOrEmpty(Password);

            if (userNameEmpty ^ passwordEmpty)
            {
                // If only one of them is set, throw.
                throw new CommandLineException(NuGetResources.SourcesCommandCredentialsRequired);
            }
        }