コード例 #1
0
    public async Task <bool> ChangePrivacy(string DestinationFileFolderID, SetAccess Access)
    {
        var EncodedObj = new ChangeFileFolderAccessOptions()
        {
            auth_token = authToken, id = DestinationFileFolderID, new_access = Access.ToString()
        };

        HttpResponseMessage response = await RequestAsync(HttpMethod.Post, "UpdateFile", EncodedObj.JsonContent());

        string result = await response.Content.ReadAsStringAsync();

        return(response.Success() ? true : throw ShowError(result));
    }
コード例 #2
0
        public TempEntitySet(SetAccess access)
        {
            var active = ++_sActive;

            if (active > ActiveWarningThreshold)
            {
                Debug.LogWarning($"More than {ActiveWarningThreshold} {nameof(TempEntitySet)}s have been created without being disposed, is there a leak?");
            }

            if (_sSetPool != null && _sSetPool.Count > 0)
            {
                _set = _sSetPool[_sSetPool.Count - 1];
                _sSetPool.RemoveAt(_sSetPool.Count - 1);

                _set.Clear();
            }
            else
            {
                _set = new HashSet <Entity>();
            }

            if (access == SetAccess.Enumerate)
            {
                if (_sListPool != null && _sListPool.Count > 0)
                {
                    _list = _sListPool[_sListPool.Count - 1];
                    _sListPool.RemoveAt(_sListPool.Count - 1);

                    _list.Clear();
                }
                else
                {
                    _list = new List <Entity>();
                }
            }
            else
            {
                _list = null;
            }
        }