public DHCP_OPTION_DATA_ELEMENT_Managed(long dataDWordDWord) { OptionType = (IntPtr)DHCP_OPTION_DATA_TYPE.DhcpDWordDWordOption; Data = new DHCP_OPTION_DATA_ELEMENT_ManagedValue() { DataDWordDWord = dataDWordDWord }; }
public DHCP_OPTION_DATA_ELEMENT_Managed(DHCP_IP_ADDRESS dataIpAddress) { OptionType = (IntPtr)DHCP_OPTION_DATA_TYPE.DhcpIpAddressOption; Data = new DHCP_OPTION_DATA_ELEMENT_ManagedValue() { DataIpAddress = dataIpAddress }; }
public DHCP_OPTION_DATA_ELEMENT_Managed(byte dataByte) { OptionType = (IntPtr)DHCP_OPTION_DATA_TYPE.DhcpByteOption; Data = new DHCP_OPTION_DATA_ELEMENT_ManagedValue() { DataByte = dataByte }; }
public DHCP_OPTION_DATA_ELEMENT_Managed(DHCP_OPTION_DATA_TYPE type, DHCP_BINARY_DATA_Managed dataBinary) { switch (type) { case DHCP_OPTION_DATA_TYPE.DhcpBinaryDataOption: OptionType = (IntPtr)DHCP_OPTION_DATA_TYPE.DhcpBinaryDataOption; Data = new DHCP_OPTION_DATA_ELEMENT_ManagedValue() { DataBinary = dataBinary }; break; case DHCP_OPTION_DATA_TYPE.DhcpEncapsulatedDataOption: OptionType = (IntPtr)DHCP_OPTION_DATA_TYPE.DhcpEncapsulatedDataOption; Data = new DHCP_OPTION_DATA_ELEMENT_ManagedValue() { DataBinary = dataBinary }; break; default: throw new ArgumentOutOfRangeException(nameof(type)); } }
public DHCP_OPTION_DATA_ELEMENT_Managed(DHCP_OPTION_DATA_TYPE type, string dataString) { switch (type) { case DHCP_OPTION_DATA_TYPE.DhcpStringDataOption: OptionType = (IntPtr)DHCP_OPTION_DATA_TYPE.DhcpStringDataOption; Data = new DHCP_OPTION_DATA_ELEMENT_ManagedValue() { DataString = Marshal.StringToHGlobalUni(dataString) }; break; case DHCP_OPTION_DATA_TYPE.DhcpIpv6AddressOption: OptionType = (IntPtr)DHCP_OPTION_DATA_TYPE.DhcpIpv6AddressOption; Data = new DHCP_OPTION_DATA_ELEMENT_ManagedValue() { DataIpv6Address = Marshal.StringToHGlobalUni(dataString) }; break; default: throw new ArgumentOutOfRangeException(nameof(type)); } }