public SubscriberCallbackAttribute(Type eventType, 
     NotifyPriority priority = DEFAULT_PRIORITY, ThreadMode threadMode = DEFAULT_THREAD_MODE)
 {
     EventType = eventType;
     Priority = priority;
     ThreadMode = threadMode;
 }
Example #2
0
        public void Notify(NotificationType type, string notification, string nickname, string phonetic, NotifyPriority priority)
        {
            if (Muted)
                return;

            lock (notifications)
            {
                IEnumerable<INotifier> notifiers;
                if (this.notifications.TryGetValues (type, out notifiers))
                {
                    foreach (var n in notifiers)
                        n.Notify (type, String.Format (notification, nickname), priority);
                }
            }

            if (SpeechReceiver != null)
            {
                lock (speechNotifiers)
                {
                    IEnumerable<ITextToSpeech> speakers;
                    if (this.speechNotifiers.TryGetValues (type, out speakers))
                    {
                        foreach (var n in speakers)
                            SpeechReceiver.Receive (n.AudioSource, n.GetSpeech (String.Format (notification, (!phonetic.IsNullOrWhitespace()) ? phonetic : nickname)));
                    }
                }
            }
        }
Example #3
0
        public void Notify(NotificationType type, string notification, NotifyPriority priority)
        {
            if (Muted)
                return;

            lock (notifications)
            {
                IEnumerable<INotifier> notifiers;
                if (this.notifications.TryGetValues (type, out notifiers))
                {
                    foreach (var n in notifiers)
                        n.Notify (type, notification, priority);
                }
            }

            if (SpeechReceiver != null)
            {
                lock (speechNotifiers)
                {
                    IEnumerable<ITextToSpeech> speakers;
                    if (this.speechNotifiers.TryGetValues (type, out speakers))
                    {
                        foreach (var n in speakers)
                            SpeechReceiver.Receive (n.AudioSource, n.GetSpeech (notification));
                    }
                }
            }
        }