Пример #1
0
        /// <summary>
        /// Adds a device data listener.
        /// </summary>
        /// <param name="listener">The listener to add</param>
        /// <returns><c>true</c>, if the device listener was added, <c>false</c> otherwise.</returns>
        ///
        public bool AddDeviceListener(DeviceListener listener)
        {
            bool added = false;

            if (!deviceListeners.ContainsKey(listener))
            {
                Device device = scene.FindDevice(listener.GetDeviceName());
                deviceListeners.Add(listener, device);
                added = true;
                // immediately trigger callback
                listener.DeviceChanged(device);
            }
            return(added);
        }