public void DropViewModelByModel(Guid modelId) { CommandQueue.Enqueue(new DeleteCachByModelCommand { ModelId = modelId }); ExecuteCallback pollCallback = ExecuteCommands; pollCallback.BeginInvoke(null, null); }
public void AddNewViewModel(ICachedViewModel startModel) { CommandQueue.Enqueue(new AddCachCommand { ViewModel = startModel }); ExecuteCallback pollCallback = ExecuteCommands; pollCallback.BeginInvoke(null, null); }
public void DropViewModel(string key) { CommandQueue.Enqueue(new DeleteCachCommand { Key = key }); ExecuteCallback pollCallback = ExecuteCommands; pollCallback.BeginInvoke(null, null); }
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); }