Esempio n. 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);
                }
            }
        }
Esempio n. 2
0
        public Proxy(string proxyName)
        {
            _name = proxyName;

            eventDispatcher = new EventDispatcher(this);

            _eventInterests = new ASDictionary <string, Action <EventX> >();
        }
Esempio n. 3
0
 private View( )
 {
     if (instance != null)
     {
         throw new Exception(SINGLETON_MSG);
     }
     instance    = this;
     mediatorMap = new ASDictionary <string, IMediator>();
 }
Esempio n. 4
0
 public Model()
 {
     if (instance != null)
     {
         throw new Exception(SINGLETON_MSG);
     }
     instance = this;
     proxyMap = new ASDictionary <string, IProxy>();
 }
Esempio n. 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();
        }
Esempio n. 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]);
                }
            }
        }
Esempio n. 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]);
                }
            }
        }
Esempio n. 8
0
        public Mediator(string mediatorName)
        {
            _name = mediatorName;

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