Exemplo n.º 1
0
        internal AliasCollection(params string[] aliases)
        {
            if (aliases is null)
            {
                throw Exceptions.BuildArgumentNull(nameof(aliases));
            }
            else if (aliases.Length == 0)
            {
                throw Exceptions.BuildArgumentEmptyAliases(nameof(aliases));
            }

            for (var i = 0; i < aliases.Length; i += 1)
            {
                try
                {
                    this.Add(aliases[i]);
                }
                catch (ArgumentException exArg)
                {
                    throw Exceptions.BuildArgumentContainsInvalidAlias(nameof(aliases), exArg);
                }
            }
        }