Skip to content

Commit 7bd1793

Browse files
committed
file-scoped namespaces
1 parent b4405ea commit 7bd1793

35 files changed

+3446
-3442
lines changed

Asn1Parser/Asn1Builder.cs

Lines changed: 626 additions & 626 deletions
Large diffs are not rendered by default.

Asn1Parser/Asn1Class.cs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
namespace SysadminsLV.Asn1Parser {
1+
namespace SysadminsLV.Asn1Parser;
2+
3+
/// <summary>
4+
/// Defines ASN.1 tagging classes.
5+
/// </summary>
6+
public enum Asn1Class : System.Byte {
27
/// <summary>
3-
/// Defines ASN.1 tagging classes.
8+
/// Represents Universal tag class.
49
/// </summary>
5-
public enum Asn1Class : System.Byte {
6-
/// <summary>
7-
/// Represents Universal tag class.
8-
/// </summary>
9-
UNIVERSAL = 0, // 0x00
10-
/// <summary>
11-
/// Represents Constructed tag class.
12-
/// </summary>
13-
CONSTRUCTED = 32, // 0x20
14-
/// <summary>
15-
/// Represents Application tag class.
16-
/// </summary>
17-
APPLICATION = 64, // 0x40
18-
/// <summary>
19-
/// <strong>CONTEXT-SPECIFIC</strong> distinguishes members of a sequence or set, the alternatives of a CHOICE, or
20-
/// universally tagged set members.
21-
/// </summary>
22-
CONTEXT_SPECIFIC = 128, // 0x80
23-
/// <summary>
24-
/// Represents Private tag class.
25-
/// </summary>
26-
PRIVATE = 192 // 0xc0
27-
}
28-
}
10+
UNIVERSAL = 0, // 0x00
11+
/// <summary>
12+
/// Represents Constructed tag class.
13+
/// </summary>
14+
CONSTRUCTED = 32, // 0x20
15+
/// <summary>
16+
/// Represents Application tag class.
17+
/// </summary>
18+
APPLICATION = 64, // 0x40
19+
/// <summary>
20+
/// <strong>CONTEXT-SPECIFIC</strong> distinguishes members of a sequence or set, the alternatives of a CHOICE, or
21+
/// universally tagged set members.
22+
/// </summary>
23+
CONTEXT_SPECIFIC = 128, // 0x80
24+
/// <summary>
25+
/// Represents Private tag class.
26+
/// </summary>
27+
PRIVATE = 192 // 0xc0
28+
}

Asn1Parser/Asn1InvalidTagException.cs

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,46 @@
22
using System.Runtime.InteropServices;
33
using System.Runtime.Serialization;
44

5-
namespace SysadminsLV.Asn1Parser {
5+
namespace SysadminsLV.Asn1Parser;
6+
7+
/// <summary>
8+
/// The exception that is thrown when a data stream contains invalid ASN.1 type or type is not the one client expects.
9+
/// </summary>
10+
[Serializable]
11+
[ComVisible(true)]
12+
public sealed class Asn1InvalidTagException : Exception {
13+
/// <inheritdoc />
14+
public Asn1InvalidTagException()
15+
: base("ASN1 bad tag value met.") {
16+
HResult = unchecked((Int32)0x8009310b);
17+
}
18+
/// <inheritdoc />
19+
public Asn1InvalidTagException(String message) : base(message) {
20+
HResult = unchecked((Int32)0x8009310b);
21+
}
22+
/// <inheritdoc />
23+
public Asn1InvalidTagException(Int32 offset)
24+
: base($"ASN1 bad tag value met at offset:{offset}.") {
25+
HResult = unchecked((Int32)0x8009310b);
26+
Offset = offset;
27+
}
28+
/// <inheritdoc />
29+
public Asn1InvalidTagException(Exception innerException)
30+
: base("ASN1 bad tag value met.", innerException) {
31+
HResult = unchecked((Int32)0x8009310b);
32+
}
33+
/// <param name="message">The error message that explains the reason for the exception.</param>
34+
/// <param name="innerException">
35+
/// The exception that is the cause of the current exception. If the <strong>innerException</strong> parameter is not a null
36+
/// reference, the current exception is raised in a catch block that handles the inner exception.
37+
/// </param>
38+
public Asn1InvalidTagException(String message, Exception innerException) : base(message, innerException) { }
39+
/// <param name="info">The object that holds the serialized object data.</param>
40+
/// <param name="context">The contextual information about the source or destination.</param>
41+
/// <remarks>This constructor is called during deserialization to reconstitute the exception object transmitted over a stream.</remarks>
42+
public Asn1InvalidTagException(SerializationInfo info, StreamingContext context) : base(info, context) { }
643
/// <summary>
7-
/// The exception that is thrown when a data stream contains invalid ASN.1 type or type is not the one client expects.
44+
/// Gets the offset at which invalid ASN tag appear.
845
/// </summary>
9-
[Serializable]
10-
[ComVisible(true)]
11-
public sealed class Asn1InvalidTagException : Exception {
12-
/// <inheritdoc />
13-
public Asn1InvalidTagException()
14-
: base("ASN1 bad tag value met.") {
15-
HResult = unchecked((Int32)0x8009310b);
16-
}
17-
/// <inheritdoc />
18-
public Asn1InvalidTagException(String message) : base(message) {
19-
HResult = unchecked((Int32)0x8009310b);
20-
}
21-
/// <inheritdoc />
22-
public Asn1InvalidTagException(Int32 offset)
23-
: base($"ASN1 bad tag value met at offset:{offset}.") {
24-
HResult = unchecked((Int32)0x8009310b);
25-
Offset = offset;
26-
}
27-
/// <inheritdoc />
28-
public Asn1InvalidTagException(Exception innerException)
29-
: base("ASN1 bad tag value met.", innerException) {
30-
HResult = unchecked((Int32)0x8009310b);
31-
}
32-
/// <param name="message">The error message that explains the reason for the exception.</param>
33-
/// <param name="innerException">
34-
/// The exception that is the cause of the current exception. If the <strong>innerException</strong> parameter is not a null
35-
/// reference, the current exception is raised in a catch block that handles the inner exception.
36-
/// </param>
37-
public Asn1InvalidTagException(String message, Exception innerException) : base(message, innerException) { }
38-
/// <param name="info">The object that holds the serialized object data.</param>
39-
/// <param name="context">The contextual information about the source or destination.</param>
40-
/// <remarks>This constructor is called during deserialization to reconstitute the exception object transmitted over a stream.</remarks>
41-
public Asn1InvalidTagException(SerializationInfo info, StreamingContext context) : base(info, context) { }
42-
/// <summary>
43-
/// Gets the offset at which invalid ASN tag appear.
44-
/// </summary>
45-
public Int32 Offset { get; private set; }
46-
}
47-
}
46+
public Int32 Offset { get; private set; }
47+
}

0 commit comments

Comments
 (0)