Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Asn1SyntaxException.cs
1
using
System;
2
using
System.Collections.Generic;
3
using
System.Text;
4
5
namespace
Waher.Content.Asn1.Exceptions
6
{
10
public
class
Asn1SyntaxException
:
Asn1Exception
11
{
12
private
readonly
string
text;
13
private
readonly
int
pos;
14
21
public
Asn1SyntaxException
(
string
Message,
string
Text
,
int
Position
)
22
: base(Format(Message,
Text
,
Position
))
23
{
24
this.text =
Text
;
25
this.pos =
Position
;
26
}
27
31
public
string
Text
=> this.text;
32
36
public
int
Position
=> this.pos;
37
38
private
static
string
Format(
string
Message,
string
Text
,
int
Position
)
39
{
40
int
Pos =
Position
- 100;
41
int
End = Pos + 200;
42
int
NewPos = 100;
43
44
if
(Pos < 0)
45
{
46
NewPos += Pos;
47
Pos = 0;
48
}
49
50
if
(End >
Text
.Length)
51
End =
Text
.Length;
52
53
string
s =
Text
.Substring(Pos, End - Pos);
54
s = s.Insert(NewPos,
"^^^-------- "
+ Message +
" -----"
);
55
56
return
Message +
"\r\n\r\n"
+ s;
57
}
58
}
59
}
Waher.Content.Asn1.Exceptions.Asn1Exception
Base class from ASN.1 exceptions.
Definition:
Asn1Exception.cs:11
Waher.Content.Asn1.Exceptions.Asn1SyntaxException
ASN.1 syntax exceptions.
Definition:
Asn1SyntaxException.cs:11
Waher.Content.Asn1.Exceptions.Asn1SyntaxException.Position
int Position
Position into text where exception was raised.
Definition:
Asn1SyntaxException.cs:36
Waher.Content.Asn1.Exceptions.Asn1SyntaxException.Asn1SyntaxException
Asn1SyntaxException(string Message, string Text, int Position)
ASN.1 syntax exceptions.
Definition:
Asn1SyntaxException.cs:21
Waher.Content.Asn1.Exceptions.Asn1SyntaxException.Text
string Text
ASN.1 text
Definition:
Asn1SyntaxException.cs:31
Waher.Content.Asn1.Exceptions
Definition:
Asn1Exception.cs:6
IoTGateway
Content
Waher.Content.Asn1
Exceptions
Asn1SyntaxException.cs
Generated by
1.9.5