/// <inheritdoc/> /// <exception cref="ArgumentException"><paramref name="item"/> builds a root command.</exception> /// <exception cref="ArgumentNullException"><paramref name="item"/> is <see langword="null"/>.</exception> protected override void SetItem(int index, ICommandBuilder item) { if (item is null) { throw Exceptions.BuildArgumentNull(nameof(item)); } else if (item.IsRoot) { throw Exceptions.BuildArgumentBuilderIsRoot(nameof(item)); } else { base.SetItem(index, item); } }