示例#1
0
        static void RemoveTestSub(bool trackFree)
        {
            var d = new DArray <object>(trackFree);

            for (var i = 0; i < 10; i++)
            {
                d[i] = new object();
            }

            var o = d[5];

            Assert.IsTrue(d.Remove(o));
            Assert.IsFalse(d.Contains(o));
        }
 /// <summary>
 /// Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </summary>
 /// <param name="item">The object to remove from the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
 /// <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>
 /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/> is
 /// read-only.</exception>
 public bool Remove(IQuestDescription item)
 {
     return(_questDescriptions.Remove(item));
 }
示例#3
0
        static void RemoveTestSub(bool trackFree)
        {
            var d = new DArray<object>(trackFree);

            for (var i = 0; i < 10; i++)
            {
                d[i] = new object();
            }

            var o = d[5];
            Assert.IsTrue(d.Remove(o));
            Assert.IsFalse(d.Contains(o));
        }