Esempio n. 1
0
    public bool UnlockLibrary(int libraryId)
    {
        if (_lockedLibraries.TryRemove(libraryId, out byte _))
        {
            OnLibraryChanged?.Invoke(this, EventArgs.Empty);
            return(true);
        }

        return(false);
    }
Esempio n. 2
0
    public bool LockLibrary(int libraryId)
    {
        if (!_lockedLibraries.ContainsKey(libraryId) && _lockedLibraries.TryAdd(libraryId, 0))
        {
            OnLibraryChanged?.Invoke(this, EventArgs.Empty);
            return(true);
        }

        return(false);
    }