示例#1
0
 /**
  * Adds the given data receive listener to the list of listeners that will
  * be notified when XBee data packets are received.
  *
  * <p>If the listener has been already added, this method does nothing.</p>
  *
  * @param listener Listener to be notified when new XBee data packets are
  *                 received.
  *
  * @see #removeDataReceiveListener(IDataReceiveListener)
  * @see com.digi.xbee.api.listeners.IDataReceiveListener
  */
 public void AddDataReceiveListener(IDataReceiveListener listener)
 {
     lock (dataReceiveListeners)
     {
         if (!dataReceiveListeners.Contains(listener))
         {
             dataReceiveListeners.Add(listener);
         }
     }
 }
示例#2
0
 /**
  * Removes the given data receive listener from the list of data receive
  * listeners.
  *
  * <p>If the listener is not included in the list, this method does nothing.
  * </p>
  *
  * @param listener Data receive listener to be remove from the list.
  *
  * @see #addDataReceiveListener(IDataReceiveListener)
  * @see com.digi.xbee.api.listeners.IDataReceiveListener
  */
 public void RemoveDataReceiveListener(IDataReceiveListener listener)
 {
     lock (dataReceiveListeners)
     {
         if (dataReceiveListeners.Contains(listener))
         {
             dataReceiveListeners.Remove(listener);
         }
     }
 }
 /*
  * (non-Javadoc)
  * @see com.digi.xbee.api.AbstractXBeeDevice#removeDataListener(com.digi.xbee.api.listeners.IDataReceiveListener)
  */
 //@Override
 public new void RemoveDataListener(IDataReceiveListener listener)
 {
     base.RemoveDataListener(listener);
 }
 /*
  * (non-Javadoc)
  * @see com.digi.xbee.api.AbstractXBeeDevice#addDataListener(com.digi.xbee.api.listeners.IDataReceiveListener)
  */
 //@Override
 public new void AddDataListener(IDataReceiveListener listener)
 {
     base.AddDataListener(listener);
 }
		/**
		 * Removes the provided listener from the list of data listeners. 
		 * 
		 * <p>If the listener was not in the list this method does nothing.</p>
		 * 
		 * @param listener Listener to be removed from the list of listeners.
		 * 
		 * @throws ArgumentNullException if {@code listener == null}
		 * 
		 * @see #addDataListener(IDataReceiveListener)
		 * @see com.digi.xbee.api.listeners.IDataReceiveListener
		 */
		protected void RemoveDataListener(IDataReceiveListener listener)
		{
			if (listener == null)
				throw new ArgumentNullException("Listener cannot be null.");

			if (dataReader == null)
				return;
			dataReader.RemoveDataReceiveListener(listener);
		}
 /**
  * Removes the given data receive listener from the list of data receive
  * listeners.
  *
  * <p>If the listener is not included in the list, this method does nothing.
  * </p>
  *
  * @param listener Data receive listener to be remove from the list.
  *
  * @see #addDataReceiveListener(IDataReceiveListener)
  * @see com.digi.xbee.api.listeners.IDataReceiveListener
  */
 public void RemoveDataReceiveListener(IDataReceiveListener listener)
 {
     lock (dataReceiveListeners)
     {
         if (dataReceiveListeners.Contains(listener))
             dataReceiveListeners.Remove(listener);
     }
 }
 /**
  * Adds the given data receive listener to the list of listeners that will
  * be notified when XBee data packets are received.
  *
  * <p>If the listener has been already added, this method does nothing.</p>
  *
  * @param listener Listener to be notified when new XBee data packets are
  *                 received.
  *
  * @see #removeDataReceiveListener(IDataReceiveListener)
  * @see com.digi.xbee.api.listeners.IDataReceiveListener
  */
 public void AddDataReceiveListener(IDataReceiveListener listener)
 {
     lock (dataReceiveListeners)
     {
         if (!dataReceiveListeners.Contains(listener))
             dataReceiveListeners.Add(listener);
     }
 }