Raised when the Tag of a diagram item must be serialized to JSON.
Namespace: MindFusion.Diagramming
Assembly: MindFusion.Diagramming
SyntaxC#
Copy Code
|
|---|
public event EventHandler<JsonSerializeTagEventArgs> JsonSerializeTag |
Visual Basic
Copy Code
|
|---|
Public Event JsonSerializeTag As EventHandler(Of JsonSerializeTagEventArgs) |
RemarksYou can handle this event to serialize non-primitive Id or Tag objects. If not handled, the component uses System.Text.Json.JsonSerializer to get JSON representation of current object.
ExampleThe following code shows how to serialize a simple structure as a JsonObject. JsonObject derives from Dictionary<string, JsonValue>, where JsonValue is a boxing class containing typecasting operators for primitive types and JsonObject itself (so you could nest objects).
C#
Copy Code
|
|---|
public class MyTag static public void ReadJson(this MyTag tag, JsonObject json) |
See Also