private EwsClient CreateConnection(string username = UserName, string password = Password) { var creds = new EwsSecurity { UserName = username, Password = password, }; return(new EwsClient(creds, EwsEndpoint)); }
static EwsClient CreateConnection(EwsServerConnectionDetails EsSrv) { var ewsSecurity = new EwsSecurity { UserName = EsSrv.UserName, Password = EsSrv.Password }; return(new EwsClient(ewsSecurity, EsSrv.EwsEndpoint, EwsVersion.Ews12)); }