//--------------------------------------------------------------------- protected BaseBenchmark(IBase64?encoder) { _encoder = encoder ?? throw new ArgumentNullException(nameof(encoder)); var random = new Random(42); _data = new byte[ByteArraySize]; random.NextBytes(_data); _dataEncoded = _encoder.Encode(_data); _guid = Guid.NewGuid().ToByteArray(); _guidEncoded = _encoder.Encode(_guid); }
/// <summary> /// SendMail /// </summary> /// <param name="base64">Base64 encoder</param> /// <param name="smtpServer">The SMTP server</param> public SendMail(IBase64 base64, SmtpServer smtpServer) { this.base64 = base64; CheckParameter(smtpServer.Host, String.Concat(nameof(smtpServer), ".", nameof(smtpServer.Host))); smtpClient = new SmtpClient(smtpServer.Host, smtpServer.Port) { DeliveryMethod = SmtpDeliveryMethod.Network, EnableSsl = smtpServer.Ssl }; smtpClient.SendCompleted += SendCompletedCallback; smtpClient.UseDefaultCredentials = !smtpServer.RequiresAuthentication; smtpClient.Credentials = smtpServer.RequiresAuthentication ? new NetworkCredential(smtpServer.Username, smtpServer.Password) : CredentialCache.DefaultNetworkCredentials; ForceSmtpAuthentication = true; SmtpAuthentication = SmtpAuthentication.Digest; Arguments = null; }
public SendMail(IBase64 base64, string smtpHost, bool sslEncryption, int port, string username = null, string password = null) : this(base64, new SmtpServer(smtpHost, port, sslEncryption, username, password, SmtpAuthentication.Digest)) { }
public Base64Controller(IBase64 base64, ILogger <Base64Controller> logger) { _base64 = base64; _logger = logger; }
public SpotifyService(IHttpClientFactoryWrapper clientFactory, IBase64 base64) { ClientFactory = clientFactory; Base64 = base64; }
public ItemSerializer(IServiceLocator serviceLocator) { this._serviceLocator = serviceLocator; this._base64 = serviceLocator.GetInstance <IBase64>(); }
public Authentication(IBase64 base64) { this.base64 = base64; }