コード例 #1
0
        // ReSharper disable once SuggestBaseTypeForParameter
        private bool Equals(Beacon <TKey, TValue> other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            var comparer = Comparer <TKey> .Default;

            return(comparer.Compare(Item1, other.Item1) == 0);
        }
コード例 #2
0
        public void ShiftToLast(Beacon <TKey, TValue> item)
        {
            if (item == null)
            {
                return;
            }

            var contains = _list.Contains(item);

            if (!contains)
            {
                return;
            }

            _list.Remove(item);
            _list.Add(item);
        }
コード例 #3
0
 /// <summary>
 /// Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </summary>
 /// <returns>
 /// true if <paramref name="item"/> was successfully removed from the <see cref="T:System.Collections.Generic.ICollection`1"/>; otherwise, false. This method also returns false if <paramref name="item"/> is not found in the original <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </returns>
 /// <param name="item">The object to remove from the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param><exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.</exception>
 public bool Remove(Beacon <TKey, TValue> item)
 {
     return(_list.Remove(item));
 }
コード例 #4
0
 /// <summary>
 /// Determines whether the <see cref="T:System.Collections.Generic.ICollection`1"/> contains a specific value.
 /// </summary>
 /// <returns>
 /// true if <paramref name="item"/> is found in the <see cref="T:System.Collections.Generic.ICollection`1"/>; otherwise, false.
 /// </returns>
 /// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
 public bool Contains(Beacon <TKey, TValue> item)
 {
     return(_list.Contains(item));
 }
コード例 #5
0
 /// <summary>
 /// Adds an item to the <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </summary>
 /// <param name="item">The object to add to the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param><exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.</exception>
 public void Add(Beacon <TKey, TValue> item)
 {
     _list.Add(item);
 }
コード例 #6
0
 /// <summary>
 /// Inserts an item to the <see cref="T:System.Collections.Generic.IList`1"/> at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param><param name="item">The object to insert into the <see cref="T:System.Collections.Generic.IList`1"/>.</param><exception cref="T:System.ArgumentOutOfRangeException"><paramref name="index"/> is not a valid index in the <see cref="T:System.Collections.Generic.IList`1"/>.</exception><exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.IList`1"/> is read-only.</exception>
 public void Insert(int index, Beacon <TKey, TValue> item)
 {
     _list.Insert(index, item);
 }
コード例 #7
0
 /// <summary>
 /// Determines the index of a specific item in the <see cref="T:System.Collections.Generic.IList`1"/>.
 /// </summary>
 /// <returns>
 /// The index of <paramref name="item"/> if found in the list; otherwise, -1.
 /// </returns>
 /// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.IList`1"/>.</param>
 public int IndexOf(Beacon <TKey, TValue> item)
 {
     return(_list.IndexOf(item));
 }
コード例 #8
0
 /// <summary>
 /// Determines the index of a specific item in the <see cref="T:System.Collections.Generic.IList`1"/>.
 /// </summary>
 /// <returns>
 /// The index of <paramref name="item"/> if found in the list; otherwise, -1.
 /// </returns>
 /// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.IList`1"/>.</param>
 public int IndexOf(Beacon <TKey, TValue> item)
 => _list.IndexOf(item);