System.Collections.Concurrent.ConcurrentDictionary.ContainsKey(char)

Here are the examples of the csharp api System.Collections.Concurrent.ConcurrentDictionary.ContainsKey(char) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

19 Source : PrinterStorage.cs
with MIT License
from BinaryKits

public void AddFile(char storageDevice, string fileName, byte[] data)
        {
            if (!this._cache.ContainsKey(storageDevice))
            {
                this._cache.TryAdd(storageDevice, new ConcurrentDictionary<string, byte[]>());
            }

            if (this._cache.TryGetValue(storageDevice, out var files))
            {
                files.TryAdd(fileName, data);
            }
        }

19 Source : PrinterStorage.cs
with MIT License
from BinaryKits

public byte[] GetFile(char storageDevice, string fileName)
        {
            if (!this._cache.ContainsKey(storageDevice))
            {
                return Array.Empty<byte>();
            }

            if (this._cache.TryGetValue(storageDevice, out var files))
            {
                files.TryGetValue(fileName, out var data);
                return data;
            }

            return Array.Empty<byte>();
        }