Class MatrixEvent
Event with a type and content; used as is for account data and ephemeral events.
Namespace: Uniform.Matrix.Protocol.Core
Assembly: Uniform.Matrix.Protocol.Core.dll
public record MatrixEvent : IEquatable<MatrixEvent>
Properties
|
Edit this page
View Source
Content
Declaration
public JsonElement Content { get; init; }
Property Value
|
Edit this page
View Source
Declaration
public required string Type { get; init; }
Property Value
Methods
|
Edit this page
View Source
TryGetContent<T>(out T?)
Deserialize Content as T; false when content is missing or malformed.
Declaration
public bool TryGetContent<T>(out T? content) where T : class
Parameters
| Type |
Name |
Description |
| T |
content |
|
Returns
Type Parameters
Examples
if (!ev.TryGetContent(out MessageContent? message)) continue;
Console.WriteLine(message.Body);
Implements