diff --git a/OpenEphys.Onix/OpenEphys.Onix/HubDeviceFactory.cs b/OpenEphys.Onix/OpenEphys.Onix/HubDeviceFactory.cs index 1b1750ac..0682d008 100644 --- a/OpenEphys.Onix/OpenEphys.Onix/HubDeviceFactory.cs +++ b/OpenEphys.Onix/OpenEphys.Onix/HubDeviceFactory.cs @@ -21,17 +21,20 @@ public string Name set { _name = value; - UpdateDeviceNames(_name); + UpdateDeviceNames(); } } - internal virtual void UpdateDeviceNames(string hubName) + protected string GetFullDeviceName(string deviceName) + { + return !string.IsNullOrEmpty(_name) ? $"{_name}/{deviceName}" : string.Empty; + } + + internal virtual void UpdateDeviceNames() { foreach (var device in GetDevices()) { - device.DeviceName = !string.IsNullOrEmpty(hubName) - ? $"{hubName}.{device.DeviceType.Name}" - : string.Empty; + device.DeviceName = GetFullDeviceName(device.DeviceType.Name); } }