Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MailHeaderInfo.cs
Go to the documentation of this file.
1
using
System.Collections.Generic
;
2
3
namespace
System.Net.Mail
;
4
5
internal
static
class
MailHeaderInfo
6
{
7
private
readonly
struct
HeaderInfo
8
{
9
public
readonly
string
NormalizedName
;
10
11
public
readonly
bool
IsSingleton
;
12
13
public
readonly
MailHeaderID
ID
;
14
15
public
readonly
bool
IsUserSettable
;
16
17
public
readonly
bool
AllowsUnicode
;
18
19
public
HeaderInfo
(
MailHeaderID
id
,
string
name,
bool
isSingleton
,
bool
isUserSettable
,
bool
allowsUnicode
)
20
{
21
ID = id;
22
NormalizedName
= name;
23
IsSingleton
=
isSingleton
;
24
IsUserSettable
=
isUserSettable
;
25
AllowsUnicode
=
allowsUnicode
;
26
}
27
}
28
29
private
static
readonly
HeaderInfo
[]
s_headerInfo
=
new
HeaderInfo
[33]
30
{
31
new
HeaderInfo
(
MailHeaderID
.Bcc,
"Bcc"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
true
),
32
new
HeaderInfo
(
MailHeaderID
.Cc,
"Cc"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
true
),
33
new
HeaderInfo
(
MailHeaderID
.Comments,
"Comments"
,
isSingleton
:
false
,
isUserSettable
:
true
,
allowsUnicode
:
true
),
34
new
HeaderInfo
(
MailHeaderID
.ContentDescription,
"Content-Description"
,
isSingleton
:
true
,
isUserSettable
:
true
,
allowsUnicode
:
true
),
35
new
HeaderInfo
(
MailHeaderID
.ContentDisposition,
"Content-Disposition"
,
isSingleton
:
true
,
isUserSettable
:
true
,
allowsUnicode
:
true
),
36
new
HeaderInfo
(
MailHeaderID
.ContentID,
"Content-ID"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
false
),
37
new
HeaderInfo
(
MailHeaderID
.ContentLocation,
"Content-Location"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
true
),
38
new
HeaderInfo
(
MailHeaderID
.ContentTransferEncoding,
"Content-Transfer-Encoding"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
false
),
39
new
HeaderInfo
(
MailHeaderID
.ContentType,
"Content-Type"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
false
),
40
new
HeaderInfo
(
MailHeaderID
.Date,
"Date"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
false
),
41
new
HeaderInfo
(
MailHeaderID
.From,
"From"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
true
),
42
new
HeaderInfo
(
MailHeaderID
.Importance,
"Importance"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
false
),
43
new
HeaderInfo
(
MailHeaderID
.InReplyTo,
"In-Reply-To"
,
isSingleton
:
true
,
isUserSettable
:
true
,
allowsUnicode
:
false
),
44
new
HeaderInfo
(
MailHeaderID
.Keywords,
"Keywords"
,
isSingleton
:
false
,
isUserSettable
:
true
,
allowsUnicode
:
true
),
45
new
HeaderInfo
(
MailHeaderID
.Max,
"Max"
,
isSingleton
:
false
,
isUserSettable
:
true
,
allowsUnicode
:
false
),
46
new
HeaderInfo
(
MailHeaderID
.MessageID,
"Message-ID"
,
isSingleton
:
true
,
isUserSettable
:
true
,
allowsUnicode
:
false
),
47
new
HeaderInfo
(
MailHeaderID
.MimeVersion,
"MIME-Version"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
false
),
48
new
HeaderInfo
(
MailHeaderID
.Priority,
"Priority"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
false
),
49
new
HeaderInfo
(
MailHeaderID
.References,
"References"
,
isSingleton
:
true
,
isUserSettable
:
true
,
allowsUnicode
:
false
),
50
new
HeaderInfo
(
MailHeaderID
.ReplyTo,
"Reply-To"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
true
),
51
new
HeaderInfo
(
MailHeaderID
.ResentBcc,
"Resent-Bcc"
,
isSingleton
:
false
,
isUserSettable
:
true
,
allowsUnicode
:
true
),
52
new
HeaderInfo
(
MailHeaderID
.ResentCc,
"Resent-Cc"
,
isSingleton
:
false
,
isUserSettable
:
true
,
allowsUnicode
:
true
),
53
new
HeaderInfo
(
MailHeaderID
.ResentDate,
"Resent-Date"
,
isSingleton
:
false
,
isUserSettable
:
true
,
allowsUnicode
:
false
),
54
new
HeaderInfo
(
MailHeaderID
.ResentFrom,
"Resent-From"
,
isSingleton
:
false
,
isUserSettable
:
true
,
allowsUnicode
:
true
),
55
new
HeaderInfo
(
MailHeaderID
.ResentMessageID,
"Resent-Message-ID"
,
isSingleton
:
false
,
isUserSettable
:
true
,
allowsUnicode
:
false
),
56
new
HeaderInfo
(
MailHeaderID
.ResentSender,
"Resent-Sender"
,
isSingleton
:
false
,
isUserSettable
:
true
,
allowsUnicode
:
true
),
57
new
HeaderInfo
(
MailHeaderID
.ResentTo,
"Resent-To"
,
isSingleton
:
false
,
isUserSettable
:
true
,
allowsUnicode
:
true
),
58
new
HeaderInfo
(
MailHeaderID
.Sender,
"Sender"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
true
),
59
new
HeaderInfo
(
MailHeaderID
.Subject,
"Subject"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
true
),
60
new
HeaderInfo
(
MailHeaderID
.To,
"To"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
true
),
61
new
HeaderInfo
(
MailHeaderID
.XPriority,
"X-Priority"
,
isSingleton
:
true
,
isUserSettable
:
false
,
allowsUnicode
:
false
),
62
new
HeaderInfo
(
MailHeaderID
.XReceiver,
"X-Receiver"
,
isSingleton
:
false
,
isUserSettable
:
true
,
allowsUnicode
:
true
),
63
new
HeaderInfo
(
MailHeaderID
.XSender,
"X-Sender"
,
isSingleton
:
true
,
isUserSettable
:
true
,
allowsUnicode
:
true
)
64
};
65
66
private
static
readonly
Dictionary<string, int>
s_headerDictionary
=
CreateHeaderDictionary
();
67
68
private
static
Dictionary<string, int>
CreateHeaderDictionary
()
69
{
70
Dictionary<string, int>
dictionary
=
new
Dictionary<string, int>
(33,
StringComparer
.
OrdinalIgnoreCase
);
71
for
(
int
i = 0; i <
s_headerInfo
.Length; i++)
72
{
73
dictionary
.Add(
s_headerInfo
[i].NormalizedName, i);
74
}
75
return
dictionary
;
76
}
77
78
internal
static
string
GetString
(
MailHeaderID
id
)
79
{
80
if
(
id
==
MailHeaderID
.Unknown ||
id
== (
MailHeaderID
)33)
81
{
82
return
null
;
83
}
84
return
s_headerInfo
[(int)
id
].NormalizedName;
85
}
86
87
internal
static
bool
IsUserSettable
(
string
name)
88
{
89
if
(
s_headerDictionary
.TryGetValue(name,
out
var
value
))
90
{
91
return
s_headerInfo
[
value
].IsUserSettable;
92
}
93
return
true
;
94
}
95
96
internal
static
bool
IsSingleton
(
string
name)
97
{
98
if
(
s_headerDictionary
.TryGetValue(name,
out
var
value
))
99
{
100
return
s_headerInfo
[
value
].IsSingleton;
101
}
102
return
false
;
103
}
104
105
internal
static
string
NormalizeCase
(
string
name)
106
{
107
if
(!
s_headerDictionary
.TryGetValue(name,
out
var
value
))
108
{
109
return
name;
110
}
111
return
s_headerInfo
[
value
].NormalizedName;
112
}
113
114
internal
static
bool
AllowsUnicode
(
string
name)
115
{
116
if
(
s_headerDictionary
.TryGetValue(name,
out
var
value
))
117
{
118
return
s_headerInfo
[
value
].AllowsUnicode;
119
}
120
return
true
;
121
}
122
}
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.Net.Mail.MailHeaderInfo.s_headerInfo
static readonly HeaderInfo[] s_headerInfo
Definition
MailHeaderInfo.cs:29
System.Net.Mail.MailHeaderInfo.IsSingleton
static bool IsSingleton(string name)
Definition
MailHeaderInfo.cs:96
System.Net.Mail.MailHeaderInfo.IsUserSettable
static bool IsUserSettable(string name)
Definition
MailHeaderInfo.cs:87
System.Net.Mail.MailHeaderInfo.CreateHeaderDictionary
static Dictionary< string, int > CreateHeaderDictionary()
Definition
MailHeaderInfo.cs:68
System.Net.Mail.MailHeaderInfo.AllowsUnicode
static bool AllowsUnicode(string name)
Definition
MailHeaderInfo.cs:114
System.Net.Mail.MailHeaderInfo.s_headerDictionary
static readonly Dictionary< string, int > s_headerDictionary
Definition
MailHeaderInfo.cs:66
System.Net.Mail.MailHeaderInfo.NormalizeCase
static string NormalizeCase(string name)
Definition
MailHeaderInfo.cs:105
System.Net.Mail.MailHeaderInfo.GetString
static string GetString(MailHeaderID id)
Definition
MailHeaderInfo.cs:78
System.Net.Mail.MailHeaderInfo
Definition
MailHeaderInfo.cs:6
System.StringComparer.OrdinalIgnoreCase
static StringComparer OrdinalIgnoreCase
Definition
StringComparer.cs:23
System.StringComparer
Definition
StringComparer.cs:12
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.Net.Mail.MailHeaderID
MailHeaderID
Definition
MailHeaderID.cs:4
System.Net.Mail
Definition
AlternateView.cs:5
System.ExceptionArgument.value
@ value
System.ExceptionArgument.dictionary
@ dictionary
System.Net.Mail.MailHeaderInfo.HeaderInfo.ID
readonly MailHeaderID ID
Definition
MailHeaderInfo.cs:13
System.Net.Mail.MailHeaderInfo.HeaderInfo.NormalizedName
readonly string NormalizedName
Definition
MailHeaderInfo.cs:9
System.Net.Mail.MailHeaderInfo.HeaderInfo.HeaderInfo
HeaderInfo(MailHeaderID id, string name, bool isSingleton, bool isUserSettable, bool allowsUnicode)
Definition
MailHeaderInfo.cs:19
System.Net.Mail.MailHeaderInfo.HeaderInfo.IsSingleton
readonly bool IsSingleton
Definition
MailHeaderInfo.cs:11
System.Net.Mail.MailHeaderInfo.HeaderInfo.IsUserSettable
readonly bool IsUserSettable
Definition
MailHeaderInfo.cs:15
System.Net.Mail.MailHeaderInfo.HeaderInfo.AllowsUnicode
readonly bool AllowsUnicode
Definition
MailHeaderInfo.cs:17
System.Net.Mail.MailHeaderInfo.HeaderInfo
Definition
MailHeaderInfo.cs:8
source
System.Net.Mail
System.Net.Mail
MailHeaderInfo.cs
Generated by
1.10.0