/// <summary> /// Initializes a new instance of the <see cref="NetworkGateway"/> class. /// </summary> /// <param name="commonNetworkServices">The common network services.</param> /// <param name="ipAddressSubnetGateway">The ip address subnet gateway.</param> /// <exception cref="ArgumentNullException">ipAddressSubnetGateway</exception> /// <autogeneratedoc /> public NetworkGateway(ICommonNetworkServices commonNetworkServices, IPAddressSubnet ipAddressSubnetGateway) : base(commonNetworkServices, DeviceType.NetworkGateway, commonNetworkServices?.LoggerFactory.CreatePureLogger <NetworkGateway>()) { _ipAddressSubnet = ipAddressSubnetGateway ?? throw new ArgumentNullException(nameof(ipAddressSubnetGateway)); }
/// <summary> /// Initializes a new instance of the <see cref="LocalNetworkCollection"/> class. /// </summary> /// <param name="commonNetworkServices">The common network services.</param> /// <exception cref="ArgumentNullException">commonNetworkServices</exception> /// <autogeneratedoc /> public LocalNetworkCollection(ICommonNetworkServices commonNetworkServices) { _commonNetworkServices = commonNetworkServices ?? throw new ArgumentNullException(nameof(commonNetworkServices)); _logger = commonNetworkServices.LoggerFactory?.CreatePureLogger <LocalNetworkCollection>(); }
/// <summary> /// Initializes a new instance of the <see cref="DhcpService"/> class. /// </summary> /// <param name="commonNetworkServices">The common network services.</param> /// <param name="applicationLifetime">The application lifetime.</param> /// <exception cref="ArgumentNullException">commonNetworkServices</exception> /// <autogeneratedoc /> public DhcpService(ICommonNetworkServices commonNetworkServices, IApplicationLifetime applicationLifetime = null) : base(commonNetworkServices?.CommonServices, applicationLifetime, ServiceHost.DhcpService) { CommonNetworkServices = commonNetworkServices ?? throw new ArgumentNullException(nameof(commonNetworkServices)); _hostedSocketService = new HostedSocketService(commonNetworkServices, commonNetworkServices.CommonServices?.LoggerFactory?.CreatePureLogger <SocketService>()); }
/// <summary> /// Initializes a new instance of the <see cref="LocalNetwork"/> class. /// </summary> /// <param name="commonNetworkServices">The common network services.</param> /// <param name="networkAdapter">The network adapter.</param> /// <param name="logger">The logger.</param> /// <autogeneratedoc /> public LocalNetwork(ICommonNetworkServices commonNetworkServices, INetworkAdapter networkAdapter, IPureLogger logger = null) : base(commonNetworkServices, DeviceType.LocalNetwork, logger) { NetworkAdapterCollection = new NetworkAdapterCollection(); NetworkGateway = _DiscoverNetworkGateway(); NetworkIPAddressSubnet = networkAdapter.NetworkAddressSubnet; AddAdapterToNetwork(networkAdapter); }
/// <summary> /// Initializes a new instance of the <see cref="NetworkMap"/> class. /// </summary> /// <param name="commonNetworkServices">The common network services.</param> /// <exception cref="ArgumentNullException">commonNetworkServices</exception> /// <autogeneratedoc /> public NetworkMap(ICommonNetworkServices commonNetworkServices) : base(commonNetworkServices) { if (commonNetworkServices == null) { throw new ArgumentNullException(nameof(commonNetworkServices)); } _logger = commonNetworkServices.LoggerFactory?.CreatePureLogger <NetworkMap>(); UpdateTimestamp(); }
/// <summary> /// Networks the type of the device from. /// </summary> /// <param name="commonNetworkServices">The common network services.</param> /// <param name="deviceType">Type of the device.</param> /// <returns>INetworkDevice.</returns> /// <autogeneratedoc /> public static INetworkDevice NetworkDeviceFromType(ICommonNetworkServices commonNetworkServices, DeviceType deviceType) { switch (deviceType) { case DeviceType.LocalComputer: { return(new LocalComputer(commonNetworkServices, DeviceType.LocalComputer)); } } return(new NetworkDeviceBase(commonNetworkServices, deviceType, commonNetworkServices.LoggerFactory.CreatePureLogger <NetworkDeviceBase>())); }
/// <summary> /// Initializes a new instance of the <see cref="NetworkAdapter"/> class. /// </summary> /// <param name="commonNetworkServices">The common network services.</param> /// <param name="networkInterface">The network interface.</param> /// <param name="logger">The logger.</param> /// <autogeneratedoc /> public NetworkAdapter(ICommonNetworkServices commonNetworkServices, NetworkInterface networkInterface, IPureLogger logger = null) : base(commonNetworkServices, DeviceType.NetworkAdapter, logger) { NetworkInterface = networkInterface; }
/// <summary> /// Initializes a new instance of the <see cref="NetworkGateway"/> class. /// </summary> /// <param name="commonNetworkServices">The common network services.</param> /// <param name="ipAddressGateway">The ip address gateway.</param> /// <param name="subnetMask">The subnet mask.</param> /// <autogeneratedoc /> public NetworkGateway(ICommonNetworkServices commonNetworkServices, IPAddress ipAddressGateway, IPAddress subnetMask) : this(commonNetworkServices, new IPAddressSubnet(ipAddressGateway, subnetMask)) { }
/// <summary> /// Initializes a new instance of the <see cref="LocalComputer"/> class. /// </summary> /// <param name="commonNetworkServices">The common network services.</param> /// <param name="deviceType">Type of the device.</param> /// <autogeneratedoc /> public LocalComputer(ICommonNetworkServices commonNetworkServices, DeviceType deviceType) : base(commonNetworkServices, deviceType) { _networkAdapterCollection = new NetworkAdapterCollection(); _localNetworkCollection = new LocalNetworkCollection(commonNetworkServices); }
/// <summary> /// Initializes a new instance of the <see cref="ComputerBase"/> class. /// </summary> /// <param name="commonNetworkServices">The common network services.</param> /// <autogeneratedoc /> protected ComputerBase(ICommonNetworkServices commonNetworkServices) : this(commonNetworkServices, DeviceType.Computer) { }
/// <summary> /// Initializes a new instance of the <see cref="ComputerBase"/> class. /// </summary> /// <param name="commonNetworkServices">The common network services.</param> /// <param name="deviceType">Type of the device.</param> /// <param name="logger">The logger.</param> /// <autogeneratedoc /> protected ComputerBase(ICommonNetworkServices commonNetworkServices, DeviceType deviceType, IPureLogger logger = null) : base(commonNetworkServices, deviceType, logger) { }
/// <summary> /// Initializes a new instance of the <see cref="NetworkDeviceBase"/> class. /// </summary> /// <param name="commonNetworkServices">The common network services.</param> /// <param name="deviceType">Type of the device.</param> /// <param name="logger">The logger.</param> /// <autogeneratedoc /> public NetworkDeviceBase(ICommonNetworkServices commonNetworkServices, DeviceType deviceType = DeviceType.UnknownDevice, IPureLogger logger = null) : base(commonNetworkServices, deviceType, logger) { CommonNetworkServices = commonNetworkServices; }