示例#1
0
        public virtual void changeState(string currentState)
        {
            ASDictionary <string, IMediator> mediatorMap = getMeditorDic();

            temps.Clear();
            foreach (string name in mediatorMap)
            {
                temps.Add(mediatorMap[name]);
            }
            foreach (IMediator mediator in temps)
            {
                IPanel panel = mediator.getView();
                if (panel == null)
                {
                    continue;
                }


                if (panel.isShow == true)
                {
                    ASList <string> sceneStates = panel.getSceneState();
                    if (sceneStates != null && sceneStates.Count != 0)
                    {
                        if (!sceneStates.Contains(currentState))
                        {
                            mediator.getView().hide();
                            continue;
                        }
                    }
                    panel.changeState(currentState);
                }
            }
        }
示例#2
0
        public Proxy(string proxyName)
        {
            _name = proxyName;

            eventDispatcher = new EventDispatcher(this);

            _eventInterests = new ASDictionary <string, Action <EventX> >();
        }
示例#3
0
 private View( )
 {
     if (instance != null)
     {
         throw new Exception(SINGLETON_MSG);
     }
     instance    = this;
     mediatorMap = new ASDictionary <string, IMediator>();
 }
示例#4
0
 public Model()
 {
     if (instance != null)
     {
         throw new Exception(SINGLETON_MSG);
     }
     instance = this;
     proxyMap = new ASDictionary <string, IProxy>();
 }
示例#5
0
        public Facade()
        {
            if (ins != null)
            {
                throw new Exception(SINGLETON_MSG);
            }
            ins = this;

            injecter = new MVCInject();

            mvcInjectProxyLock    = new ASDictionary <string, object>();
            mvcInjectMediatorLock = new ASDictionary <string, object>();

            initializeFacade();
        }
示例#6
0
        public void registerEvent(ASDictionary <string, Action <EventX> > eventInterests, bool isBind = true)
        {
            if (eventInterests == null)
            {
                return;
            }

            if (isBind)
            {
                foreach (string eventType in eventInterests)
                {
                    this.addEventListener(eventType, eventInterests[eventType]);
                }
            }
            else
            {
                foreach (string eventType in eventInterests)
                {
                    this.removeEventListener(eventType, eventInterests[eventType]);
                }
            }
        }
示例#7
0
        public void registerProxyEvent(ASDictionary <string, Action <EventX> > eventInterester, IProxy proxy, bool isBind = true)
        {
            if (eventInterester == null)
            {
                return;
            }

            if (isBind)
            {
                foreach (string eventType in eventInterester)
                {
                    proxy.addEventListener(eventType, eventInterester[eventType]);
                }
            }
            else
            {
                foreach (string eventType in eventInterester)
                {
                    proxy.addEventListener(eventType, eventInterester[eventType]);
                }
            }
        }
        public Mediator(string mediatorName)
        {
            _name = mediatorName;

            _eventInterests = new ASDictionary <string, Action <EventX> >();
        }
示例#9
0
 public void registerEvent(ASDictionary <string, Action <EventX> > eventInterester, bool isBind = true)
 {
     view.registerEvent(eventInterester);
 }