예제 #1
0
        public void DropViewModelByModel(Guid modelId)
        {
            CommandQueue.Enqueue(new DeleteCachByModelCommand {
                ModelId = modelId
            });
            ExecuteCallback pollCallback = ExecuteCommands;

            pollCallback.BeginInvoke(null, null);
        }
예제 #2
0
        public void AddNewViewModel(ICachedViewModel startModel)
        {
            CommandQueue.Enqueue(new AddCachCommand {
                ViewModel = startModel
            });
            ExecuteCallback pollCallback = ExecuteCommands;

            pollCallback.BeginInvoke(null, null);
        }
예제 #3
0
        public void DropViewModel(string key)
        {
            CommandQueue.Enqueue(new DeleteCachCommand {
                Key = key
            });
            ExecuteCallback pollCallback = ExecuteCommands;

            pollCallback.BeginInvoke(null, null);
        }
예제 #4
0
        public void ClearOldCach()
        {
            var oldDate = DateTime.Now.AddHours(-6);
            var item    = Cach.SingleOrDefault(x => x.Value.CachLastAccess <= oldDate);

            while (item.Key != null)
            {
                CommandQueue.Enqueue(new DeleteCachCommand {
                    Key = item.Key
                });
                item = Cach.SingleOrDefault(x => x.Value.CachLastAccess <= oldDate);
            }

            ExecuteCallback pollCallback = ExecuteCommands;

            pollCallback.BeginInvoke(null, null);
        }