From 81bf1a1cd1678efd2e73ebc347f51809cffaac46 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Mon, 29 May 2023 09:33:32 +0200 Subject: Bugfixes, improvements --- MatrixRoomUtils.Core/StateEvent.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'MatrixRoomUtils.Core/StateEvent.cs') diff --git a/MatrixRoomUtils.Core/StateEvent.cs b/MatrixRoomUtils.Core/StateEvent.cs index f98d963..6321fb6 100644 --- a/MatrixRoomUtils.Core/StateEvent.cs +++ b/MatrixRoomUtils.Core/StateEvent.cs @@ -24,6 +24,19 @@ public class StateEvent { return (StateEvent)this; } + + public string dtype + { + get + { + string res = GetType().Name switch + { + "StateEvent`1" => $"StateEvent<{Content.GetType().Name}>", + _ => GetType().Name + }; + return res; + } + } } public class StateEvent : StateEvent where T : class @@ -38,5 +51,5 @@ public class StateEvent : StateEvent where T : class } } [JsonPropertyName("content")] - public T Content { get; set; } + public new T Content { get; set; } } \ No newline at end of file -- cgit 1.5.1