Exemplo n.º 1
0
        /// <summary>
        /// Raises an IndexError if there is no listener with the given name currently listening to the channel.
        /// </summary>
        /// <param name="p_sName">The name of the desired listener.</param>
        /// <returns>A RainwaveListener for the given given listener name.</returns>
        public RainwaveListener getListenerByName(string p_sName)
        {
            RainwaveListener rwListener = null;

            if (!ListenerExists(p_sName, out rwListener))
            {
                throw new KeyNotFoundException("A RainwaveListener for the given listener name does not exist.");
            }
            return(rwListener);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Raises an IndexError if there is no listener with the given ID.
        /// </summary>
        /// <param name="p_iID">The ID of the desired listener.</param>
        /// <returns>A RainwaveListener for the given listener ID.</returns>
        public RainwaveListener getListenerByID(int p_iID)
        {
            RainwaveListener rwListener = null;

            if (!ListenerExists(p_iID, out rwListener))
            {
                throw new KeyNotFoundException("A RainwaveListener for the given listener ID does not exist.");
            }
            return(rwListener);
        }
Exemplo n.º 3
0
 private bool ListenerExists(string p_sName, out RainwaveListener rwListener)
 {
     rwListener = null;
     foreach (RainwaveListener rwL in Listeners)
     {
         if (rwL.sName == p_sName)
         {
             rwListener = rwL;
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 4
0
 private bool ListenerExists(int p_iID, out RainwaveListener rwListener)
 {
     rwListener = null;
     foreach (RainwaveListener rwL in Listeners)
     {
         if (rwL.iID == p_iID)
         {
             rwListener = rwL;
             return(true);
         }
     }
     return(false);
 }