runtime.csharp.IRT.Transport.WebSocketMessageBase.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-csharp_2.12 Show documentation
Show all versions of idealingua-v1-runtime-rpc-csharp_2.12 Show documentation
idealingua-v1-runtime-rpc-csharp
The newest version!
using System;
// using Newtonsoft.Json;
// using Newtonsoft.Json.Linq;
namespace IRT.Transport {
// [JsonConverter(typeof(WebSocketMessageBase_JsonNetConverter))]
public class WebSocketMessageBase {
public string Kind;
public WebSocketMessageBase(string kind = null) {
Kind = kind;
}
}
// public class WebSocketMessageBase_JsonNetConverter: JsonNetConverter {
// public override void WriteJson(JsonWriter writer, WebSocketMessageBase holder, JsonSerializer serializer) {
// throw new Exception("WebSocketMessageBase should never be serialized.");
// }
//
// public override WebSocketMessageBase ReadJson(JsonReader reader, System.Type objectType, WebSocketMessageBase existingValue, bool hasExistingValue, JsonSerializer serializer) {
// var json = JObject.Load(reader);
// var kind = json["kind"].Value();
//
// var res = hasExistingValue ? existingValue : new WebSocketMessageBase(kind);
// res.Kind = kind;
// return res;
// }
// }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy