Exemplo n.º 1
0
        public IEventToken Subscribe(Action action)
        {
            EventToken token = new EventToken(this.unsubcribeEvent, message => action());

            lock (eventTokenMutex)
                eventTokens.Add(token);
            return(token);
        }
Exemplo n.º 2
0
        public IEventToken Subscribe(Action <object> action)
        {
            EventToken token = new EventToken(this.unsubcribeEvent, action);

            lock (eventTokenMutex)
                eventTokens.Add(token);
            return(token);
        }
Exemplo n.º 3
0
 private void unsubcribeEvent(EventToken token)
 {
     lock (eventTokenMutex)
         eventTokens.Remove(token);
 }