Browse Source

Add xml doc explaining why exception is thrown

pull/1004/head
Chris Johnston 8 years ago
parent
commit
f9c67074e0
2 changed files with 18 additions and 0 deletions
  1. +9
    -0
      src/Discord.Net.Rest/Entities/Channels/RestCategoryChannel.cs
  2. +9
    -0
      src/Discord.Net.WebSocket/Entities/Channels/SocketCategoryChannel.cs

+ 9
- 0
src/Discord.Net.Rest/Entities/Channels/RestCategoryChannel.cs View File

@@ -25,8 +25,17 @@ namespace Discord.Rest
private string DebuggerDisplay => $"{Name} ({Id}, Category)";

// IGuildChannel

/// <summary>
/// Throws a NotSupportedException because Channel Categories cannot be the child of another Channel Category.
/// </summary>
/// <exception cref="NotSupportedException">A NotSupportedException is always thrown because Channel Categories do not support being nested.</exception>
ulong? IGuildChannel.CategoryId
=> throw new NotSupportedException();
/// <summary>
/// Throws a NotSupportedException because Channel Categories cannot be the child of another Channel Category.
/// </summary>
/// <exception cref="NotSupportedException">A NotSupportedException is always thrown because Channel Categories do not support being nested.</exception>
Task<ICategoryChannel> IGuildChannel.GetCategoryAsync()
=> throw new NotSupportedException();
IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options)


+ 9
- 0
src/Discord.Net.WebSocket/Entities/Channels/SocketCategoryChannel.cs View File

@@ -51,8 +51,17 @@ namespace Discord.WebSocket
internal new SocketCategoryChannel Clone() => MemberwiseClone() as SocketCategoryChannel;

// IGuildChannel

/// <summary>
/// Throws a NotSupportedException because Channel Categories cannot be the child of another Channel Category.
/// </summary>
/// <exception cref="NotSupportedException">A NotSupportedException is always thrown because Channel Categories do not support being nested.</exception>
ulong? IGuildChannel.CategoryId
=> throw new NotSupportedException();
/// <summary>
/// Throws a NotSupportedException because Channel Categories cannot be the child of another Channel Category.
/// </summary>
/// <exception cref="NotSupportedException">A NotSupportedException is always thrown because Channel Categories do not support being nested.</exception>
Task<ICategoryChannel> IGuildChannel.GetCategoryAsync()
=> throw new NotSupportedException();
IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options)


Loading…
Cancel
Save