[CV2] add children component counts to IComponentContainer (#3147)
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
using Discord.Utils;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
namespace Discord;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a class used to build Action rows.
|
||||
/// </summary>
|
||||
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
|
||||
public class ActionRowBuilder : IMessageComponentBuilder, IInteractableComponentContainer
|
||||
{
|
||||
/// <inheritdoc />
|
||||
@@ -239,4 +242,6 @@ public class ActionRowBuilder : IMessageComponentBuilder, IInteractableComponent
|
||||
|
||||
/// <inheritdoc />
|
||||
IComponentContainer IComponentContainer.WithComponents(IEnumerable<IMessageComponentBuilder> components) => WithComponents(components);
|
||||
|
||||
private string DebuggerDisplay => $"{nameof(ActionRowBuilder)}: {this.ComponentCount()} child components.";
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
namespace Discord;
|
||||
|
||||
|
||||
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
|
||||
public class ComponentBuilderV2 : IStaticComponentContainer
|
||||
{
|
||||
/// <summary>
|
||||
@@ -98,4 +101,6 @@ public class ComponentBuilderV2 : IStaticComponentContainer
|
||||
|
||||
/// <inheritdoc/>
|
||||
IComponentContainer IComponentContainer.WithComponents(IEnumerable<IMessageComponentBuilder> components) => WithComponents(components);
|
||||
|
||||
private string DebuggerDisplay => $"{nameof(ComponentBuilderV2)}: {this.ComponentCount()} child components.";
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
namespace Discord;
|
||||
|
||||
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
|
||||
public class ContainerBuilder : IMessageComponentBuilder, IStaticComponentContainer
|
||||
{
|
||||
/// <inheritdoc />
|
||||
@@ -125,4 +127,6 @@ public class ContainerBuilder : IMessageComponentBuilder, IStaticComponentContai
|
||||
IComponentContainer IComponentContainer.AddComponents(params IMessageComponentBuilder[] components) => AddComponents(components);
|
||||
/// <inheritdoc />
|
||||
IComponentContainer IComponentContainer.WithComponents(IEnumerable<IMessageComponentBuilder> components) => WithComponents(components);
|
||||
|
||||
private string DebuggerDisplay => $"{nameof(ContainerBuilder)}: {this.ComponentCount()} child components.";
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
namespace Discord;
|
||||
|
||||
|
||||
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
|
||||
public class SectionBuilder : IMessageComponentBuilder, IStaticComponentContainer
|
||||
{
|
||||
/// <summary>
|
||||
@@ -128,4 +131,6 @@ public class SectionBuilder : IMessageComponentBuilder, IStaticComponentContaine
|
||||
IComponentContainer IComponentContainer.AddComponents(params IMessageComponentBuilder[] components) => AddComponents(components);
|
||||
/// <inheritdoc/>
|
||||
IComponentContainer IComponentContainer.WithComponents(IEnumerable<IMessageComponentBuilder> components) => WithComponents(components.ToList());
|
||||
|
||||
private string DebuggerDisplay => $"{nameof(SectionBuilder)}: {this.ComponentCount()} child components.";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user