Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
CSharpExportSettings.cs
1using System;
2using System.Collections.Generic;
4
5namespace Waher.Content.Asn1
6{
11 {
12 private readonly Dictionary<string, KeyValuePair<Asn1Document, string>> imported =
13 new Dictionary<string, KeyValuePair<Asn1Document, string>>();
14
19
23 public string BaseNamespace;
24
30 : this(BaseNamespace, EncodingSchemes.None)
31 {
32 }
33
40 {
41 this.BaseNamespace = BaseNamespace;
42 this.Codecs = Codecs;
43 }
44
50 public string Namespace(string Identifier)
51 {
52 return this.BaseNamespace + "." + Asn1Node.ToCSharp(Identifier);
53 }
54
60 public bool ContainsCode(string Identifier)
61 {
62 return this.imported.ContainsKey(Identifier);
63 }
64
71 public void AddCode(string Identifier, string Code, Asn1Document Document)
72 {
73 this.imported[Identifier] = new KeyValuePair<Asn1Document, string>(Document, Code);
74 }
75
81 public string GetCode(string Identifier)
82 {
83 return this.imported[Identifier].Value;
84 }
85
91 public Asn1Document GetDocument(string Identifier)
92 {
93 return this.imported[Identifier].Key;
94 }
95
99 public string[] Modules
100 {
101 get
102 {
103 string[] Result = new string[this.imported.Count];
104 this.imported.Keys.CopyTo(Result, 0);
105 return Result;
106 }
107 }
108 }
109}
Represents an ASN.1 document.
Definition: Asn1Document.cs:21
void AddCode(string Identifier, string Code, Asn1Document Document)
Adds C# code for a given identifier.
string GetCode(string Identifier)
Gets C# code for a given identifier.
bool ContainsCode(string Identifier)
If C# code is available for a given identifier.
EncodingSchemes Codecs
What encoders and decoders to include in the generation of C# code.
CSharpExportSettings(string BaseNamespace)
What encoders and decoders to include in the generation of C# code.
Asn1Document GetDocument(string Identifier)
Gets C# code for a given identifier.
CSharpExportSettings(string BaseNamespace, EncodingSchemes Codecs)
What encoders and decoders to include in the generation of C# code.
string Namespace(string Identifier)
Namespace for a given identifier.
Base class for all ASN.1 nodes.
Definition: Asn1Node.cs:38
EncodingSchemes
Available ASN.1 encoding schemes.