Beispiel #1
0
 public void registerMediatorAlias(string mediatorName, IMediator mediator)
 {
     if (mediator == null)
     {
         mediatorMap.Remove(mediatorName);
         return;
     }
     mediatorMap[mediatorName] = mediator;
 }
 public void registerProxyAlias(string proxyName, IProxy proxy)
 {
     if (proxy == null)
     {
         proxyMap.Remove(proxyName);
         return;
     }
     proxyMap[proxyName] = proxy;
 }
Beispiel #3
0
        public IMediator getMediator(string mediatorName)
        {
            IMediator mediator = view.getMediator(mediatorName) as IMediator;

            if (mediator == null)
            {
                Type cls = Singleton.getClass(mediatorName);
                if (cls != null)
                {
                    mediator = (IMediator)Activator.CreateInstance(cls);
                    mvcInjectMediatorLock[mediatorName] = mediator;

                    inject(mediator);
                    registerMediator(mediator);

                    mvcInjectMediatorLock.Remove(mediatorName);
                }
                else
                {
                    if (UnityEngine.Application.platform == UnityEngine.RuntimePlatform.WindowsEditor)
                    {
                        UnityEngine.Debug.Log(mediatorName + "未注册");
                    }

                    DebugX.Log(mediatorName + "未注册");
                }
            }
            return(mediator);
        }
Beispiel #4
0
        public IProxy getProxy(string proxyName)
        {
            IProxy proxy = model.getProxy(proxyName);

            if (proxy == null)
            {
                Type cls = Singleton.getClass(proxyName);
                if (cls != null)
                {
                    proxy = (IProxy)Activator.CreateInstance(cls);
                    mvcInjectProxyLock[proxyName] = proxy;
                    inject(proxy);
                    registerProxy(proxy);

                    mvcInjectProxyLock.Remove(proxyName);
                }
            }
            return(proxy);
        }