From 5eff459c44b7bbdd331f92b6c23ad121cded43a1 Mon Sep 17 00:00:00 2001 From: sta Date: Sat, 14 Nov 2015 15:04:44 +0900 Subject: [PATCH] [Modify] Add a property Add IsPing property to determine that the message type is ping. --- websocket-sharp/MessageEventArgs.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/websocket-sharp/MessageEventArgs.cs b/websocket-sharp/MessageEventArgs.cs index 09bf6149..8629ea29 100644 --- a/websocket-sharp/MessageEventArgs.cs +++ b/websocket-sharp/MessageEventArgs.cs @@ -36,7 +36,7 @@ namespace WebSocketSharp /// /// /// A event occurs when the receives - /// a text or binary message, or a Ping if the property is + /// a text or binary message, or a ping if the property is /// set to true. /// /// @@ -109,6 +109,18 @@ namespace WebSocketSharp } } + /// + /// Gets a value indicating whether the message type is ping. + /// + /// + /// true if the message type is ping; otherwise, false. + /// + public bool IsPing { + get { + return _opcode == Opcode.Ping; + } + } + /// /// Gets a value indicating whether the message type is text. /// @@ -134,11 +146,12 @@ namespace WebSocketSharp } /// - /// Gets the type of the message. + /// Gets the message type. /// /// /// , , or . /// + [Obsolete ("This property will be removed. Use any of the Is properties instead.")] public Opcode Type { get { return _opcode;