public IData GetDataForDevice(IOwnedDevice device)
{
IControlToken token;
if (MemberTokens.TryGetValue(device, out token))
{
return token.GetDataForDevice(device);
}
if (AutoAddDevices)
{
token = device.TakeControl(priority: Priority, name: Name);
Add(device, token);
return token.GetDataForDevice(device);
}
var sod = device as SingleOwnerDevice;
if (sod != null)
return sod.GetOwnerlessData();
throw new ArgumentException("Unhandled device");
}