Example #1
0
        public void Subscribe(IVSPCMessageHandler handler, Type msgType)
        {
            if (!msgType.IsSubclassOf(typeof(AMessage)))
                throw new ArgumentException("Invalid msgType. msgType must be a subclass of AVSPCMessage");

            var handlersForType = GetOrCreateHandlerList(msgType);
            handlersForType.Add(handler);
        }
Example #2
0
        public void Subscribe(IVSPCMessageHandler handler, Type msgType)
        {
            if (!msgType.IsSubclassOf(typeof(AMessage)))
            {
                throw new ArgumentException("Invalid msgType. msgType must be a subclass of AVSPCMessage");
            }

            var handlersForType = GetOrCreateHandlerList(msgType);

            handlersForType.Add(handler);
        }
Example #3
0
        public void SubscribeSubclasses(IVSPCMessageHandler handler, Type msgType)
        {
            if (!msgType.IsSubclassOf(typeof(AMessage)))
                throw new ArgumentException("Invalid msgType. msgType must be a subclass of AVSPCMessage");

            foreach (var subtype in msgType.Assembly.GetTypes().Where(t => t.IsSubclassOf(msgType)))
            {
                var handlersForType = GetOrCreateHandlerList(subtype);
                handlersForType.Add(handler);
            }
        }
Example #4
0
        public void SubscribeSubclasses(IVSPCMessageHandler handler, Type msgType)
        {
            if (!msgType.IsSubclassOf(typeof(AMessage)))
            {
                throw new ArgumentException("Invalid msgType. msgType must be a subclass of AVSPCMessage");
            }

            foreach (var subtype in msgType.Assembly.GetTypes().Where(t => t.IsSubclassOf(msgType)))
            {
                var handlersForType = GetOrCreateHandlerList(subtype);
                handlersForType.Add(handler);
            }
        }