Browse Source

Add Xmldocs

pull/988/head
Hsu Still 7 years ago
parent
commit
2ff6d677cb
5 changed files with 24 additions and 36 deletions
  1. +4
    -4
      src/Discord.Net.Core/ConnectionState.cs
  2. +4
    -4
      src/Discord.Net.Core/Entities/Activities/ActivityType.cs
  3. +1
    -1
      src/Discord.Net.Core/Entities/Permissions/ChannelPermission.cs
  4. +10
    -22
      src/Discord.Net.Core/Utils/Cacheable.cs
  5. +5
    -5
      src/Discord.Net.Rest/Entities/Channels/ChannelType.cs

+ 4
- 4
src/Discord.Net.Core/ConnectionState.cs View File

@@ -3,13 +3,13 @@ namespace Discord
/// <summary> Specifies the connection state of a client. </summary>
public enum ConnectionState : byte
{
/// <summary> Represents that the client has disconnected from the WebSocket. </summary>
/// <summary> The client has disconnected from Discord. </summary>
Disconnected,
/// <summary> Represents that the client is connecting to the WebSocket. </summary>
/// <summary> The client is connecting to Discord. </summary>
Connecting,
/// <summary> Represents that the client has established a connection to the WebSocket. </summary>
/// <summary> The client has established a connection to Discord. </summary>
Connected,
/// <summary> Represents that the client is disconnecting from the WebSocket. </summary>
/// <summary> The client is disconnecting from Discord. </summary>
Disconnecting
}
}

+ 4
- 4
src/Discord.Net.Core/Entities/Activities/ActivityType.cs View File

@@ -3,13 +3,13 @@ namespace Discord
/// <summary> Specifies a Discord user's activity type. </summary>
public enum ActivityType
{
/// <summary> Represents that the user is playing a game. </summary>
/// <summary> The user is playing a game. </summary>
Playing = 0,
/// <summary> Represents that the user is streaming online. </summary>
/// <summary> The user is streaming online. </summary>
Streaming = 1,
/// <summary> Represents that the user is listening to a song. </summary>
/// <summary> The user is listening to a song. </summary>
Listening = 2,
/// <summary> Represents that the user is watching a media. </summary>
/// <summary> The user is watching a media. </summary>
Watching = 3
}
}

+ 1
- 1
src/Discord.Net.Core/Entities/Permissions/ChannelPermission.cs View File

@@ -26,7 +26,7 @@ namespace Discord
SendTTSMessages = 0x00_00_10_00,
/// <summary> Allows for deletion of other users messages. </summary>
ManageMessages = 0x00_00_20_00,
/// <summary> Links sent by users with this permission will be auto-embedded. </summary>
/// <summary> Allows links sent by users with this permission will be auto-embedded. </summary>
EmbedLinks = 0x00_00_40_00,
/// <summary> Allows for uploading images and files. </summary>
AttachFiles = 0x00_00_80_00,


+ 10
- 22
src/Discord.Net.Core/Utils/Cacheable.cs View File

@@ -1,28 +1,20 @@
using System;
using System;
using System.Threading.Tasks;

namespace Discord
{
/// <summary>
/// Contains an entity that may be cached.
/// </summary>
/// <typeparam name="TEntity">The type of entity that is cached</typeparam>
/// <typeparam name="TId">The type of this entity's ID</typeparam>
/// <summary> Contains an entity that may be cached. </summary>
/// <typeparam name="TEntity"> The type of entity that is cached. </typeparam>
/// <typeparam name="TId"> The type of this entity's ID. </typeparam>
public struct Cacheable<TEntity, TId>
where TEntity : IEntity<TId>
where TId : IEquatable<TId>
{
/// <summary>
/// Is this entity cached?
/// </summary>
/// <summary> Indicates whether this entity is cached. </summary>
public bool HasValue { get; }
/// <summary>
/// The ID of this entity.
/// </summary>
/// <summary> Gets the ID of this entity. </summary>
public TId Id { get; }
/// <summary>
/// The entity, if it could be pulled from cache.
/// </summary>
/// <summary> Gets the entity if it could be pulled from cache. </summary>
/// <remarks>
/// This value is not guaranteed to be set; in cases where the entity cannot be pulled from cache, it is null.
/// </remarks>
@@ -37,9 +29,7 @@ namespace Discord
DownloadFunc = downloadFunc;
}

/// <summary>
/// Downloads this entity to cache.
/// </summary>
/// <summary> Downloads this entity to cache. </summary>
/// <returns>An awaitable Task containing the downloaded entity.</returns>
/// <exception cref="Discord.Net.HttpException">Thrown when used from a user account.</exception>
/// <exception cref="NullReferenceException">Thrown when the message is deleted.</exception>
@@ -48,12 +38,10 @@ namespace Discord
return await DownloadFunc();
}

/// <summary>
/// Returns the cached entity if it exists; otherwise downloads it.
/// </summary>
/// <summary> Returns the cached entity if it exists; otherwise downloads it. </summary>
/// <returns>An awaitable Task containing a cached or downloaded entity.</returns>
/// <exception cref="Discord.Net.HttpException">Thrown when used from a user account.</exception>
/// <exception cref="NullReferenceException">Thrown when the message is deleted and is not in cache.</exception>
public async Task<TEntity> GetOrDownloadAsync() => HasValue ? Value : await DownloadAsync();
}
}
}

+ 5
- 5
src/Discord.Net.Rest/Entities/Channels/ChannelType.cs View File

@@ -3,15 +3,15 @@ namespace Discord
/// <summary> Defines the types of channels. </summary>
public enum ChannelType
{
/// <summary> Represents a text channel. </summary>
/// <summary> The channel is a text channel. </summary>
Text = 0,
/// <summary> Represents a Direct Message channel. </summary>
/// <summary> The channel is a Direct Message channel. </summary>
DM = 1,
/// <summary> Represents a voice channel. </summary>
/// <summary> The channel is a voice channel. </summary>
Voice = 2,
/// <summary> Represents a group channel. </summary>
/// <summary> The channel is a group channel. </summary>
Group = 3,
/// <summary> Represents a category channel. </summary>
/// <summary> The channel is a category channel. </summary>
Category = 4
}
}

Loading…
Cancel
Save