示例#1
0
 /**
  * Add a handler for raw (i.e, anything in EEGDataType) events
  * Adding a handler does not guarantee events will actually be recieved,
  * this is dependent on the configuration of the pipeline
  * @throws ArgumentException if handler is null
  */
 public void AddRawHandler(EEGDataType type, SharpBCIRawHandler handler)
 {
     if (handler == null)
     {
         throw new ArgumentException("handler cannot be null");
     }
     lock (rawHandlers)
     {
         if (!rawHandlers.ContainsKey(type))
         {
             rawHandlers.Add(type, new List <SharpBCIRawHandler>());
         }
         rawHandlers[type].Add(handler);
     }
 }
示例#2
0
 /**
  * Remove a handler for raw(i.e, anything in EEGDataType) events
  * @throws ArgumentException if handler is null
  */
 public void RemoveRawHandler(EEGDataType type, SharpBCIRawHandler handler)
 {
     if (handler == null)
     {
         throw new ArgumentException("handler cannot be null");
     }
     lock (rawHandlers)
     {
         if (!rawHandlers.ContainsKey(type))
         {
             throw new ArgumentException("No handlers registered for type: " + type);
         }
         if (!rawHandlers[type].Remove(handler))
         {
             throw new ArgumentException("Handler '" + handler + "' not registered for EEGDataType: " + type);
         }
     }
 }