Esempio n. 1
0
 public FlagArray(int capacity)
 {
     if (capacity < 0)
     {
         throw new ArgumentOutOfRangeException(nameof(capacity), "length < 0");
     }
     Capacity = capacity;
     _entries = ArrayReservoir <int> .GetArray(GetLength(Capacity));
 }
Esempio n. 2
0
        public FlagArray(int length)
        {
            if (length < 0)
            {
                throw new ArgumentOutOfRangeException("length", "length < 0");
            }
            _length  = length;
            _entries = ArrayReservoir <int> .GetArray(GetLength(_length));

            _asReadOnly = new ExtendedReadOnlyCollection <bool>(this);
        }
Esempio n. 3
0
        public FlagArray(int capacity)
        {
            if (capacity < 0)
            {
                throw new ArgumentOutOfRangeException("capacity", "length < 0");
            }
            _capacity = capacity;
            _entries  = ArrayReservoir <int> .GetArray(GetLength(_capacity));

            _asReadOnly = new ExtendedReadOnlyCollection <bool>(this);
        }
Esempio n. 4
0
        public FlagArray(int capacity)
        {
            if (capacity < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(capacity), "length < 0");
            }
            Capacity = capacity;
            _entries = ArrayReservoir <int> .GetArray(GetLength(Capacity));

            _asReadOnly = Extensions.WrapAsIReadOnlyCollection(this);
        }
Esempio n. 5
0
        public FlagArray(FlagArray prototype)
        {
            if (prototype == null)
            {
                throw new ArgumentNullException(nameof(prototype), "prototype is null.");
            }
            Capacity = prototype.Capacity;
            _entries = ArrayReservoir <int> .GetArray(GetLength(Capacity));

            prototype._entries.CopyTo(_entries, 0);
        }
Esempio n. 6
0
        public FlagArray(FlagArray prototype)
        {
            if (ReferenceEquals(prototype, null))
            {
                throw new ArgumentNullException("prototype", "prototype is null.");
            }
            _length  = prototype._length;
            _entries = ArrayReservoir <int> .GetArray(GetLength(_length));

            prototype._entries.CopyTo(_entries, 0);
            _asReadOnly = new ExtendedReadOnlyCollection <bool>(this);
        }
Esempio n. 7
0
        public ReverseStringBuilder(int capacity)
        {
            if (capacity < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(capacity));
            }

            _buffer = ArrayReservoir <char> .GetArray(capacity);

            _capacity = capacity;
            _start    = capacity;
        }
Esempio n. 8
0
        private void RecycleExtracted()
        {
            // Assume anything could have been set to null, start no sync operation, this could be running during DomainUnload
            var entries = _entries;

            if (entries != null)
            {
                ArrayReservoir <int> .DonateArray(entries);

                _entries = null;
            }
        }
Esempio n. 9
0
        public FlagArray(FlagArray prototype)
        {
            if (prototype == null)
            {
                throw new ArgumentNullException(nameof(prototype), "prototype is null.");
            }
            Capacity = prototype.Capacity;
            _entries = ArrayReservoir <int> .GetArray(GetLength(Capacity));

            prototype._entries.CopyTo(_entries, 0);
            _asReadOnly = Extensions.WrapAsIReadOnlyCollection(this);
        }
Esempio n. 10
0
        private void RecycleExtracted()
        {
            ArrayReservoir <int> .DonateArray(_entries);

            _entries = null;
        }