Exemple #1
0
        /// <summary>
        /// Lock if group token is configured for auto add
        /// </summary>
        /// <param name="device"></param>
        /// <returns>True if device is controlled by this group token</returns>
        public bool LockAndGetDataFromDevice(IOwnedDevice device)
        {
            if (MemberTokens.ContainsKey(device))
            {
                return(true);
            }

            if (!AutoAddDevices)
            {
                return(false);
            }

            // Add
            MemberTokens.Add(device, device.TakeControl(Priority, Name));

            return(true);
        }
Exemple #2
0
 public void Add(IOwnedDevice device, IControlToken token)
 {
     MemberTokens.Add(device, token);
 }