mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-10 23:27:21 +00:00
Moved all extension methods into extension blocks (#1155)
This commit is contained in:
1 parent
acc7d09fa2
commit
c0a75f39ac
138 files changed
+5884
-4954
No files matched your search
@@ -16,23 +16,26 @@ public static class MailboxTransportSecurityExtensions
|
||||
|
||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(MailboxTransportSecurityExtensions).Namespace, nameof(MailboxTransportSecurityExtensions));
|
||||
|
||||
public static string GetName(this MailboxTransportSecurity transportSecurity) => transportSecurity switch
|
||||
extension(MailboxTransportSecurity transportSecurity)
|
||||
{
|
||||
MailboxTransportSecurity.SSL_ON_CONNECT => TB("TLS from the start (usually port 993)"),
|
||||
MailboxTransportSecurity.STARTTLS => TB("STARTTLS (usually port 143)"),
|
||||
public string GetName() => transportSecurity switch
|
||||
{
|
||||
MailboxTransportSecurity.SSL_ON_CONNECT => TB("TLS from the start (usually port 993)"),
|
||||
MailboxTransportSecurity.STARTTLS => TB("STARTTLS (usually port 143)"),
|
||||
|
||||
_ => TB("Unknown encryption"),
|
||||
};
|
||||
_ => TB("Unknown encryption"),
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The port the encryption usually comes with.
|
||||
/// </summary>
|
||||
/// <returns>The port, or null when there is no usual one.</returns>
|
||||
public static int? GetUsualPort(this MailboxTransportSecurity transportSecurity) => transportSecurity switch
|
||||
{
|
||||
MailboxTransportSecurity.SSL_ON_CONNECT => SSL_ON_CONNECT_PORT,
|
||||
MailboxTransportSecurity.STARTTLS => STARTTLS_PORT,
|
||||
/// <summary>
|
||||
/// The port the encryption usually comes with.
|
||||
/// </summary>
|
||||
/// <returns>The port, or null when there is no usual one.</returns>
|
||||
public int? GetUsualPort() => transportSecurity switch
|
||||
{
|
||||
MailboxTransportSecurity.SSL_ON_CONNECT => SSL_ON_CONNECT_PORT,
|
||||
MailboxTransportSecurity.STARTTLS => STARTTLS_PORT,
|
||||
|
||||
_ => null,
|
||||
};
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user