示例#1
0
        public void registerProxy(IProxy proxy)
        {
            String proxyName = proxy.name;

            if (proxyMap.ContainsKey(proxyName))
            {
                throw new Exception("重复定义:" + proxyName);
            }
            proxyMap[proxyName] = proxy;
            proxy.onRegister();
        }
示例#2
0
        public void registerMediator(IMediator mediator)
        {
            String name = mediator.name;

            if (mediatorMap.ContainsKey(name))
            {
                throw new Exception("重复定义:" + name);
            }
            mediatorMap[name] = mediator;
            if (mediator is ISpecialEventInterests)
            {
                registerEvent((mediator as ISpecialEventInterests).specialEventInterests, true);
            }
            mediator.onRegister();
        }