Пример #1
0
 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);
 }
Пример #2
0
        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));
        }
Пример #3
0
        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]);
        }
Пример #4
0
 public bool Remove(string item)
 {
     return(_coll.Remove(item));
 }