runtime.csharp.IRT.Transport.WebSocketFailureMessage.cs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of idealingua-v1-runtime-rpc-c-sharp_2.13 Show documentation
Show all versions of idealingua-v1-runtime-rpc-c-sharp_2.13 Show documentation
idealingua-v1-runtime-rpc-c-sharp
The newest version!
// using Newtonsoft.Json;
// using Newtonsoft.Json.Linq;
namespace IRT.Transport {
// [JsonConverter(typeof(WebSocketFailureMessage_JsonNetConverter))]
public class WebSocketFailureMessage: WebSocketMessageBase {
public string Cause;
public string Data;
public WebSocketFailureMessage(): base(WebSocketMessageKind.Failure){
}
}
// public class WebSocketFailureMessage_JsonNetConverter : JsonNetConverter
// {
// public override void WriteJson(JsonWriter writer, WebSocketFailureMessage holder, JsonSerializer serializer)
// {
// writer.WriteStartObject();
// // Kind
// writer.WritePropertyName("kind");
// writer.WriteValue(holder.Kind);
//
// // Cause
// writer.WritePropertyName("cause");
// writer.WriteValue(holder.Cause);
//
// // Data
// writer.WritePropertyName("data");
// writer.WriteValue(holder.Data);
//
// writer.WriteEndObject();
// }
//
// public override WebSocketFailureMessage ReadJson(JsonReader reader, System.Type objectType,
// WebSocketFailureMessage existingValue, bool hasExistingValue, JsonSerializer serializer)
// {
// var json = JObject.Load(reader);
// var res = hasExistingValue ? existingValue : new WebSocketFailureMessage();
// res.Kind = json["kind"].Value();
//
// var data = json["data"];
// if (data != null)
// {
// res.Cause = data["cause"].Value();
// res.Data = data["data"].Value();
// }
//
// return res;
// }
// }
}