Animatroller.Framework.Controller.CueList.LockAllUsedDevices C# (CSharp) Method

LockAllUsedDevices() private method

private LockAllUsedDevices ( ) : void
return void
        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);
                }
            }
        }