public bool FreeCachedFile(string filename) { if (_files.Contains(filename)) { _currentBufferSize -= _files[filename].Length; _files.Remove(filename); EnsureCapacity(); _freeFiles.Remove(filename); return(true); } _freeFiles.Remove(filename); return(false); }
protected void RemoveEntity(Entity entity) { var node = (from kvp in lightNodes where kvp.Value.EntityId == entity.Id select kvp.Value).First(); lightNodes.Remove(node.Id); Messenger.Send(new LightMessage(entity, node, UpdateType.Remove)); }
public Stream OpenFile(string filename, bool forceReload) { if (forceReload && _files.ContainsKey(filename)) { long length = _files[filename].Length; _files.RemoveByKey(filename); if (_freeFiles.Contains(filename)) { _freeFiles.Remove(filename); } _currentBufferSize -= length; } this.CacheFile(filename); return(_files[filename]); }
public bool Remove(string item) { return(_coll.Remove(item)); }