Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SetContextAndTryAuthenticate()

Authorization System.Net.Mail.SmtpConnection.SetContextAndTryAuthenticate ( ISmtpAuthenticationModule module,
NetworkCredential credential,
System::Net::ContextAwareResult context )
inlineprivate

Definition at line 767 of file SmtpConnection.cs.

768 {
769 if (credential == CredentialCache.DefaultNetworkCredentials)
770 {
771 try
772 {
773 ExecutionContext executionContext = context?.ContextCopy;
774 if (executionContext != null)
775 {
776 AuthenticateCallbackContext authenticateCallbackContext = new AuthenticateCallbackContext(this, module, credential, _client.TargetName, null);
777 ExecutionContext.Run(executionContext, s_AuthenticateCallback, authenticateCallbackContext);
778 return authenticateCallbackContext._result;
779 }
780 return module.Authenticate(null, credential, this, _client.TargetName, null);
781 }
782 catch
783 {
784 throw;
785 }
786 }
787 return module.Authenticate(null, credential, this, _client.TargetName, null);
788 }
static readonly ContextCallback s_AuthenticateCallback
static void Run(ExecutionContext executionContext, ContextCallback callback, object? state)

References System.Net.Mail.SmtpConnection._client, System.Net.Mail.SmtpConnection.AuthenticateCallbackContext._result, System.Net.Mail.ISmtpAuthenticationModule.Authenticate(), System.Net.CredentialCache.DefaultNetworkCredentials, System.Threading.ExecutionContext.Run(), System.Net.Mail.SmtpConnection.s_AuthenticateCallback, and System.Net.Mail.SmtpClient.TargetName.

Referenced by System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.Authenticate(), and System.Net.Mail.SmtpConnection.GetConnection().