Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Asn1Set.cs
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Threading.Tasks;
5
7{
11 public class Asn1Set : Asn1List
12 {
19 public Asn1Set(string Name, bool TypeDef, Asn1Node[] Nodes)
20 : base(Name, TypeDef, Nodes)
21 {
22 }
23
27 public override bool ConstructedType => true;
28
36 public override async Task ExportCSharp(StringBuilder Output, CSharpExportState State,
37 int Indent, CSharpExportPass Pass)
38 {
39 if (Pass == CSharpExportPass.Explicit)
40 {
41 Output.Append(ToCSharp(this.Name));
42
43 if (!this.TypeDefinition)
44 Output.Append("Set");
45 }
46 else if (Pass == CSharpExportPass.Implicit)
47 {
48 State.ClosePending(Output);
49
50 foreach (Asn1Node Node in this.Nodes)
51 await Node.ExportCSharp(Output, State, Indent, Pass);
52
53 Output.Append(Tabs(Indent));
54 Output.Append("public class ");
55 Output.Append(ToCSharp(this.Name));
56 if (!this.TypeDefinition)
57 Output.AppendLine("Set");
58
59 Output.Append(Tabs(Indent));
60 Output.AppendLine("{");
61
62 Indent++;
63
64 foreach (Asn1Node Node in this.Nodes)
65 await Node.ExportCSharp(Output, State, Indent, CSharpExportPass.Explicit);
66
67 Indent--;
68
69 Output.Append(Tabs(Indent));
70 Output.AppendLine("}");
71 Output.AppendLine();
72 }
73 }
74 }
75}
void ClosePending(StringBuilder Output)
Close pending actions
string Name
Optional field or type name.
bool TypeDefinition
If construct is part of a type definition.
Abstract base class for list constructs.
Definition: Asn1List.cs:11
Base class for all ASN.1 nodes.
Definition: Asn1Node.cs:38
virtual Task ExportCSharp(StringBuilder Output, CSharpExportState State, int Indent, CSharpExportPass Pass)
Exports to C#
Definition: Asn1Node.cs:46
Represents a ASN.1 SET construct.
Definition: Asn1Set.cs:12
Asn1Set(string Name, bool TypeDef, Asn1Node[] Nodes)
Represents a ASN.1 SET construct.
Definition: Asn1Set.cs:19
override async Task ExportCSharp(StringBuilder Output, CSharpExportState State, int Indent, CSharpExportPass Pass)
Exports to C#
Definition: Asn1Set.cs:36
override bool ConstructedType
If the type is a constructed type.
Definition: Asn1Set.cs:27
CSharpExportPass
Defines different C# export passes.
Definition: Asn1Node.cs:12