/// <summary> /// Initializes a new instance of the <see cref="ManagerCacheBaseT{TClass,TKey}"/> class. /// </summary> /// <param name="repository"> /// The repository. /// </param> public ManagerCacheBaseT(IManagerBase <TClass, TKey> repository) { Repository = repository; SessionFactory = ObjectFactory.GetInstance <ISessionFactory>(); TimeSpan = new TimeSpan(0, 0, 30, 0); classMetadata = SessionFactory.GetClassMetadata(typeof(TClass)); TimeQueryDb = new DateTime(1900, 1, 1); }
/// <summary> /// 状态开始 /// </summary> /// <param name="currStateName"></param> /// <param name="nextStateName"></param> public void OnBeginStateEnter(string currStateName, string nextStateName) { _loadLevelExceptionCount = 0; CreateDynamicManager(); GameStateConf _stateConf = GameStateConf.GetInstance(); if (null == _stateConf) { this.Error("OnBeginStateEnter()::The game state conf is invalid!!!"); return; } GameStateInfo _nextStateInfo = Array.Find( _stateConf.States.ToArray(), c => c.Name == nextStateName); if (null != _nextStateInfo) { List <string> _managerNames = _nextStateInfo.Managers; if ((null != _managerNames) && (0 < _managerNames.Count)) { try { AddDynamicManager(_managerNames.ToArray()); } catch (Exception e) { ShowExceptionPopup(e, _evtOnExceptionPopupConfirm, "AddDynamicManager"); } } } for (int i = 0; i < _constManagers.Count; i++) { IManagerBase manager = _constManagers[i]; try { manager.OnBeginStateEnter(currStateName, nextStateName); } catch (Exception e) { ShowExceptionPopup(e, _evtOnExceptionPopupConfirm, manager.GetType().Name); } } for (int i = 0; i < _dynamicManagers.Count; i++) { IManagerBase mgr = _dynamicManagers[i]; try { mgr.OnBeginStateEnter(currStateName, nextStateName); } catch (Exception e) { ShowExceptionPopup(e, _evtOnExceptionPopupConfirm, mgr.GetType().Name); } } }
private void AddManager(string[] typeNames, bool constant) { GameObject go = constant ? _constManagerLayer : _dynamicManagerLayer; List <IManagerBase> managerPool = constant ? _constManagers : _dynamicManagers; Type managerBaseType = typeof(IManagerBase); for (int i = 0; i < typeNames.Length; i++) { string name = typeNames[i]; Type type = Type.GetType(name); if (type != null) { if (managerBaseType.IsAssignableFrom(type)) { if (type.IsSubclassOf(typeof(MonoBehaviour))) { GameObject node = new GameObject(type.Name); node.transform.parent = go.transform; managerPool.Add(node.AddComponent(type) as IManagerBase); } else { IManagerBase mgr = GameManageHelper.GetCustomManage(type); if (mgr != null) { managerPool.Add(mgr); } } } else { string msg = string.Format("type is not inherit form IGameManager: {0}", name); Error(msg); throw new Exception(msg); } } else { string msg = string.Format("type is not found: {0}", name); Error(msg); throw new Exception(msg); } } }
/// <summary> /// 状态结束 /// </summary> /// <param name="currStateName"></param> /// <param name="nextStateName"></param> public void OnEndStateExit(string currStateName, string nextStateName) { _loadLevelExceptionCount = 0; for (int i = 0; i < _constManagers.Count; i++) { IManagerBase mamager = _constManagers[i]; try { mamager.OnEndStateExit(currStateName, nextStateName); } catch (Exception e) { ShowExceptionPopup(e, _evtOnExceptionPopupConfirm, mamager.GetType().Name); } } DestroyDynamicManager(); Facade.Facade.Instance.ClearAll(); }
public TipoNumeracionAppService(IManagerBase <TipoNumeracion> initManager, IIocResolver initIIocResolver) : base(initManager, initIIocResolver) { }
/// <summary> /// Initializes a new instance of the <see cref="DbSource"/> class. /// </summary> /// <param name="detectorManager">The detector manager.</param> /// <param name="managerBase">The manager base.</param> public DbSource(IDetectorManager detectorManager, IManagerBase managerBase) { this.detectorManager = detectorManager; this.managerBase = managerBase; }
public AsyncCrudAppService(IManagerBase <TEntity, TPrimaryKey> serviceBase, IMapper mapper) { _ServiceBase = serviceBase; _mapper = mapper; }
public PeriodoAppService(IManagerBase <Periodo> initManager, IIocResolver initIIocResolver) : base(initManager, initIIocResolver) { }
public EntityBase(string id, IManagerBase <EntityBase> manager) { this.Id = id; this.Manager = manager; }
public CuentaAppService(IManagerBase <Cuenta> initManager, IIocResolver initIIocResolver) : base(initManager, initIIocResolver) { }
public CategoryController(IManagerBase <CategoryDto, int> categoryManager) { _categoryManager = categoryManager; }
public ComprobanteAppService(IManagerBase <Comprobante> initManager, IManagerBase <ComprobanteDetalleCuenta> initManagerDetalleCuenta, IIocResolver initIIocResolver) : base(initManager, initIIocResolver) { _ManagerDetalleCuenta = initManagerDetalleCuenta; }
protected AppServiceBase(IManagerBase <TEntity> initManager, IIocResolver initIocResolver) { _Manager = initManager; _iocResolver = initIocResolver; }
public static List <T> GetListSubeKodu <T, Idt>(this IManagerBase <T, Idt> data, string subeKodu) where T : BusinessBase <T> { return(data.Session.QueryOver <T>().List().Take(data.GetMaxResult) as List <T>); }