internal RasConnection(IntPtr handle, RasDevice device, string entryName, string phoneBookPath, Guid entryId, RasConnectionOptions options, Luid sessionId, Guid correlationId, IRasGetConnectStatus statusService, IRasGetConnectionStatistics connectionStatisticsService, IRasHangUp hangUpService, IRasClearConnectionStatistics clearConnectionStatisticsService) { if (handle == IntPtr.Zero) { throw new ArgumentNullException(nameof(handle)); } else if (string.IsNullOrWhiteSpace(entryName)) { throw new ArgumentNullException(nameof(entryName)); } else if (string.IsNullOrWhiteSpace(phoneBookPath)) { throw new ArgumentNullException(nameof(phoneBookPath)); } EntryName = entryName; PhoneBookPath = phoneBookPath; Handle = handle; Device = device ?? throw new ArgumentNullException(nameof(device)); EntryId = entryId; Options = options ?? throw new ArgumentNullException(nameof(options)); SessionId = sessionId; CorrelationId = correlationId; this.statusService = statusService ?? throw new ArgumentNullException(nameof(statusService)); this.connectionStatisticsService = connectionStatisticsService ?? throw new ArgumentNullException(nameof(connectionStatisticsService)); this.hangUpService = hangUpService ?? throw new ArgumentNullException(nameof(hangUpService)); this.clearConnectionStatisticsService = clearConnectionStatisticsService ?? throw new ArgumentNullException(nameof(clearConnectionStatisticsService)); }
public void ConnectionOptionsTest() { RasConnectionOptions expected = new RasConnectionOptions() { AllUsers = true }; RasConnection target = new RasConnection(); target.ConnectionOptions = expected; RasConnectionOptions actual = target.ConnectionOptions; Assert.AreSame(expected, actual); }
internal RasConnection(IntPtr handle, RasDevice device, string entryName, string phoneBookPath, Guid entryId, RasConnectionOptions options, Luid sessionId, Guid correlationId, IServiceProvider services) { if (handle == IntPtr.Zero) { throw new ArgumentNullException(nameof(handle)); } else if (string.IsNullOrWhiteSpace(entryName)) { throw new ArgumentNullException(nameof(entryName)); } else if (string.IsNullOrWhiteSpace(phoneBookPath)) { throw new ArgumentNullException(nameof(phoneBookPath)); } EntryName = entryName; PhoneBookPath = phoneBookPath; Handle = handle; Device = device ?? throw new ArgumentNullException(nameof(device)); EntryId = entryId; Options = options ?? throw new ArgumentNullException(nameof(options)); SessionId = sessionId; CorrelationId = correlationId; Services = services; }