Added missing ToString and DebuggerDisplays

This commit is contained in:
RogueException
2016-10-04 16:41:40 -03:00
parent e70d478759
commit 7df38fea3a
28 changed files with 75 additions and 27 deletions

View File

@@ -1,8 +1,10 @@
using Model = Discord.API.Presence;
using System.Diagnostics;
using Model = Discord.API.Presence;
namespace Discord.WebSocket
{
//TODO: C#7 Candidate for record type
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public struct SocketPresence : IPresence
{
public Game? Game { get; }
@@ -18,6 +20,9 @@ namespace Discord.WebSocket
return new SocketPresence(model.Game != null ? Discord.Game.Create(model.Game) : (Game?)null, model.Status);
}
public override string ToString() => Status.ToString();
internal string DebuggerDisplay => $"{Status}{(Game != null ? $", {Game.Value.Name} ({Game.Value.StreamType})" : "")}";
internal SocketPresence Clone() => this;
}
}