コード例 #1
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]);
        }
コード例 #2
0
ファイル: FilesCache.cs プロジェクト: polytronicgr/netrix
 public void CloseFile(string filename)
 {
     if (_files.Contains(filename))
     {
         //_currentBufferSize -= _files[filename].Length;
         //_files.Remove(filename);
         //EnsureCapacity();
         if (!_freeFiles.Contains(filename))
         {
             _freeFiles.Add(filename);
         }
     }
 }
コード例 #3
0
        private unsafe int[] GetBufferUsedColorArray(int *src)
        {
            LightCollection <int> colors = new LightCollection <int>();

            for (int i = 0; i < _pixelsCount; i++)
            {
                int c = *((int *)src);
                if (!colors.Contains(c))
                {
                    colors.Add(c);
                }
                src++;
            }
            return(colors.GetItems());
        }
コード例 #4
0
ファイル: PixelBuffer.cs プロジェクト: westybsa/MP.LSharp
 private unsafe int[] GetBufferUsedColorArray(int* src)
 {
     LightCollection<int> colors = new LightCollection<int>();
     for (int i = 0; i < _pixelsCount; i++)
     {
         int c = *((int*)src);
         if (!colors.Contains(c))
         {
             colors.Add(c);
         }
         src++;
     }
     return colors.GetItems();
 }
コード例 #5
0
 public bool Contains(string item)
 {
     return(_coll.Contains(item));
 }