Ejemplo n.º 1
0
        /// <summary>
        /// Add a device to the collection if it is unique
        /// </summary>
        /// <param name="deviceToAdd"></param>
        /// <returns></returns>
        public bool AddDevice(PlaybackDevice deviceToAdd)
        {
            bool deviceUnique = (DeviceCollection.Contains(deviceToAdd) == false);

            if (deviceUnique == true)
            {
                DeviceCollection.Add(deviceToAdd);
            }

            return(deviceUnique);
        }
Ejemplo n.º 2
0
 public LuaArgs CallMethod(LuaArgs args)
 {
     if (!m_devices.Contains(m_device))
     {
         throw new LuaError("Device disconnected");
     }
     try
     {
         m_args[0] = args; // Saves an allocation
         return((LuaArgs)m_method.Invoke(m_device, m_args));
     }
     catch (TargetInvocationException e)
     {
         throw e.InnerException;
     }
 }