Пример #1
0
        /// <summary>
        /// Adds a Cache Data object to the Controller and returns a CacheDataController
        /// </summary>
        /// <param name="controller">Cache Controller that will manage this the Cache Data</param>
        /// <param name="type">Class type that implements ICacheData</param>
        public static CacheDataController CreateCacheData(ICacheController controller, Type type)
        {
            var data           = (ICacheData)Activator.CreateInstance(type);
            var dataController = new CacheDataController();

            dataController.Initialize(data);
            controller.Add(dataController);
            return(dataController);
        }
Пример #2
0
        private void InternalLoadDataStore()
        {
            var model = DataStore.Load();

            foreach (var data in model)
            {
                var cacheDataController = new CacheDataController();
                cacheDataController.Initialize(data);
                Cache.Add(cacheDataController);
            }
        }