private void LockAllUsedDevices()
{
lock (this.heldLocks)
{
foreach (var device in this.cues.SelectMany(x => x.Devices).Distinct())
{
var ownedDevice = device as IOwnedDevice;
if (ownedDevice == null)
continue;
if (this.heldLocks.ContainsKey(ownedDevice))
// Already locked
continue;
var token = ownedDevice.TakeControl(LockPriority, false, Name);
this.heldLocks.Add(ownedDevice, token);
}
}
}