Added DebuggerDisplay/ToString to Emoji and GuildEmbed

This commit is contained in:
RogueException
2016-08-09 17:20:09 -03:00
parent 3fb13fa7e1
commit eff995a2a6
2 changed files with 11 additions and 1 deletions

View File

@@ -1,8 +1,10 @@
using System.Collections.Immutable;
using System.Diagnostics;
using Model = Discord.API.Emoji;
namespace Discord
{
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public struct Emoji
{
public ulong Id { get; }
@@ -19,5 +21,8 @@ namespace Discord
RequireColons = model.RequireColons;
RoleIds = ImmutableArray.Create(model.Roles);
}
public override string ToString() => Name;
private string DebuggerDisplay => $"{Name} ({Id})";
}
}

View File

@@ -1,7 +1,9 @@
using Model = Discord.API.GuildEmbed;
using System.Diagnostics;
using Model = Discord.API.GuildEmbed;
namespace Discord
{
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public struct GuildEmbed
{
public bool IsEnabled { get; private set; }
@@ -14,5 +16,8 @@ namespace Discord
}
internal GuildEmbed(Model model)
: this(model.Enabled, model.ChannelId) { }
public override string ToString() => ChannelId?.ToString();
private string DebuggerDisplay => $"{ChannelId} ({(IsEnabled ? "Enabled" : "Disabled")})";
}
}