Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Asn1FieldValueDefinition.cs
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Threading.Tasks;
5
7{
12 {
13 private readonly string fieldName;
14 private readonly Asn1Type type;
15 private readonly Asn1Value value;
16 private readonly Asn1Document document;
17
27 : base()
28 {
29 this.fieldName = FieldName;
30 this.type= Type;
31 this.value = Value;
32 this.document = Document;
33 }
34
38 public string Name => this.fieldName;
39
43 public Asn1Type Type => this.type;
44
48 public Asn1Value Value => this.value;
49
53 public Asn1Document Document => this.document;
54
62 public override async Task ExportCSharp(StringBuilder Output, CSharpExportState State,
63 int Indent, CSharpExportPass Pass)
64 {
65 if (Pass == CSharpExportPass.Variables)
66 {
67 if (!State.ExportingValues)
68 {
69 State.ExportingValues = true;
70
71 Output.Append(Tabs(Indent));
72 Output.AppendLine("public static partial class Values");
73
74 Output.Append(Tabs(Indent));
75 Output.AppendLine("{");
76
77 State.ExportingValuesIndent = Indent + 1;
78 }
79
80 Output.Append(Tabs(State.ExportingValuesIndent));
81 Output.Append("public static readonly ");
82
83 await this.type.ExportCSharp(Output, State, Indent, CSharpExportPass.Explicit);
84
85 Output.Append(' ');
86 Output.Append(ToCSharp(this.fieldName));
87 Output.Append(" = ");
88 await this.value.ExportCSharp(Output, State, State.ExportingValuesIndent, CSharpExportPass.Explicit);
89 Output.AppendLine(";");
90 }
91 }
92 }
93}
Represents an ASN.1 document.
Definition: Asn1Document.cs:21
Represents an ASN.1 field value definition.
Asn1FieldValueDefinition(string FieldName, Asn1Type Type, Asn1Value Value, Asn1Document Document)
Represents an ASN.1 field value definition.
Asn1Document Document
ASN.1 Document in where the value is defined.
override async Task ExportCSharp(StringBuilder Output, CSharpExportState State, int Indent, CSharpExportPass Pass)
Exports to C#
Base class for all ASN.1 nodes.
Definition: Asn1Node.cs:38
Abstract base class for ASN.1 types.
Definition: Asn1Type.cs:13
Abstract base class for values.
Definition: Asn1Value.cs:11
CSharpExportPass
Defines different C# export passes.
Definition: Asn1Node.cs:12