private static Address AddressFrom(Proto.Msg.AddressData addressProto) { return(new Address( addressProto.Protocol, addressProto.System, addressProto.Hostname, addressProto.Port == 0 ? null : (int?)addressProto.Port)); }
// // Address // private static Proto.Msg.AddressData AddressMessageBuilder(Address address) { var message = new Proto.Msg.AddressData(); message.System = address.System; message.Hostname = address.Host; message.Port = (uint)(address.Port ?? 0); message.Protocol = address.Protocol; return(message); }