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); } } }
public Proxy(string proxyName) { _name = proxyName; eventDispatcher = new EventDispatcher(this); _eventInterests = new ASDictionary <string, Action <EventX> >(); }
private View( ) { if (instance != null) { throw new Exception(SINGLETON_MSG); } instance = this; mediatorMap = new ASDictionary <string, IMediator>(); }
public Model() { if (instance != null) { throw new Exception(SINGLETON_MSG); } instance = this; proxyMap = new ASDictionary <string, IProxy>(); }
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(); }
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]); } } }
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> >(); }
public void registerEvent(ASDictionary <string, Action <EventX> > eventInterester, bool isBind = true) { view.registerEvent(eventInterester); }