public void AddNewViewModel(ICachedViewModel startModel) { CommandQueue.Enqueue(new AddCachCommand { ViewModel = startModel }); ExecuteCallback pollCallback = ExecuteCommands; pollCallback.BeginInvoke(null, null); }
public ICachedViewModel GetViewModel(ICachedViewModel startModel) { ICachedViewModel result; if (Cach.ContainsKey(startModel.CachKey)) { result = Cach[startModel.CachKey]; result.CachLastAccess = DateTime.Now; if (result.CachIsOutOfDate()) { result = startModel.Initialize(); AddNewViewModel(startModel); } } else { result = startModel.Initialize(); AddNewViewModel(startModel); } return(result); }
public ICachedViewModel GetViewModel(ICachedViewModel startModel) { ICachedViewModel result; if (Cach.ContainsKey(startModel.CachKey)) { result = Cach[startModel.CachKey]; result.CachLastAccess = DateTime.Now; if (result.CachIsOutOfDate()) { result = startModel.Initialize(); AddNewViewModel(startModel); } } else { result = startModel.Initialize(); AddNewViewModel(startModel); } return result; }
public static ICachedViewModel GetViewModel(ICachedViewModel startModel) { return _current.GetViewModel(startModel); }
public static void AddNewViewModel(ICachedViewModel startModel) { _current.AddNewViewModel(startModel); }
public static ICachedViewModel GetViewModel(ICachedViewModel startModel) { return(_current.GetViewModel(startModel)); }