Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
EnumEncoder.cs
1using System;
2using System.Reflection;
3using System.Text;
5
7{
12 {
16 public EnumEncoder()
17 {
18 }
19
26 public void Encode(object Object, int? Indent, StringBuilder Json)
27 {
28 Json.Append('"');
29 Json.Append(JSON.Encode(Object.ToString()));
30 Json.Append('"');
31 }
32
38 public Grade Supports(Type ObjectType)
39 {
40 return ObjectType.GetTypeInfo().IsEnum ? Grade.Ok : Grade.NotAtAll;
41 }
42 }
43}
Helps with common JSON-related tasks.
Definition: JSON.cs:14
static string Encode(string s)
Encodes a string for inclusion in JSON.
Definition: JSON.cs:507
void Encode(object Object, int? Indent, StringBuilder Json)
Encodes the Object to JSON.
Definition: EnumEncoder.cs:26
Grade Supports(Type ObjectType)
How well the JSON encoder encodes objects of type ObjectType .
Definition: EnumEncoder.cs:38
Interface for encoding objects of certain types to JSON.
Definition: IJsonEncoder.cs:11
Grade
Grade enumeration
Definition: Grade.cs:7