当前位置: 首页>>代码示例>>C#>>正文


C# Collection4.Remove方法代码示例

本文整理汇总了C#中Db4objects.Db4o.Foundation.Collection4.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# Collection4.Remove方法的具体用法?C# Collection4.Remove怎么用?C# Collection4.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Db4objects.Db4o.Foundation.Collection4的用法示例。


在下文中一共展示了Collection4.Remove方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestContainsAll

 public virtual void TestContainsAll()
 {
     var a = new Item(42);
     var b = new Item(a.id + 1);
     var c = new Item(b.id + 1);
     var a_ = new Item(a.id);
     var needle = new Collection4();
     var haystack = new Collection4();
     haystack.Add(a);
     needle.Add(a);
     needle.Add(b);
     Assert.IsFalse(haystack.ContainsAll(needle));
     needle.Remove(b);
     Assert.IsTrue(haystack.ContainsAll(needle));
     needle.Add(b);
     haystack.Add(b);
     Assert.IsTrue(haystack.ContainsAll(needle));
     needle.Add(a_);
     Assert.IsTrue(haystack.ContainsAll(needle));
     needle.Add(c);
     Assert.IsFalse(haystack.ContainsAll(needle));
     needle.Clear();
     Assert.IsTrue(haystack.ContainsAll(needle));
     haystack.Clear();
     Assert.IsTrue(haystack.ContainsAll(needle));
 }
开发者ID:masroore,项目名称:db4o,代码行数:26,代码来源:Collection4TestCase.cs

示例2: TestContains

		public virtual void TestContains()
		{
			object a = new object();
			Collection4 c = new Collection4();
			c.Add(new object());
			Assert.IsFalse(c.Contains(a));
			c.Add(a);
			Assert.IsTrue(c.Contains(a));
			c.Remove(a);
			Assert.IsFalse(c.Contains(a));
		}
开发者ID:Galigator,项目名称:db4o,代码行数:11,代码来源:Collection4TestCase.cs

示例3: SameContent

 public static void SameContent(IEnumerator expected, IEnumerator actual)
 {
     var allExpected = new Collection4(expected);
     while (actual.MoveNext())
     {
         var current = actual.Current;
         var removed = allExpected.Remove(current);
         if (!removed)
         {
             Unexpected(current);
         }
     }
     Assert.IsTrue(allExpected.IsEmpty(), "Still missing: " + allExpected);
 }
开发者ID:masroore,项目名称:db4o,代码行数:14,代码来源:Iterator4Assert.cs

示例4: SameContent

		public static void SameContent(IEnumerator expected, IEnumerator actual)
		{
			Collection4 allExpected = new Collection4();
			while (expected.MoveNext())
			{
				allExpected.Add(expected.Current);
			}
			while (actual.MoveNext())
			{
				object current = actual.Current;
				bool removed = allExpected.Remove(current);
				if (!removed)
				{
					Unexpected(current);
				}
			}
			Assert.IsTrue(allExpected.IsEmpty(), allExpected.ToString());
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:18,代码来源:IteratorAssert.cs

示例5: ForInterface

		public Collection4 ForInterface(IReflectClass claxx)
		{
			Collection4 col = new Collection4();
			ClassMetadataIterator i = Iterator();
			while (i.MoveNext())
			{
				ClassMetadata clazz = i.CurrentClass();
				IReflectClass candidate = clazz.ClassReflector();
				if (!candidate.IsInterface())
				{
					if (claxx.IsAssignableFrom(candidate))
					{
						col.Add(clazz);
						IEnumerator j = new Collection4(col).GetEnumerator();
						while (j.MoveNext())
						{
							ClassMetadata existing = (ClassMetadata)j.Current;
							if (existing != clazz)
							{
								ClassMetadata higher = clazz.GetHigherHierarchy(existing);
								if (higher != null)
								{
									if (higher == clazz)
									{
										col.Remove(existing);
									}
									else
									{
										col.Remove(clazz);
									}
								}
							}
						}
					}
				}
			}
			return col;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:38,代码来源:ClassMetadataRepository.cs

示例6: TestContainsAll

		public virtual void TestContainsAll()
		{
			Collection4TestCase.Item a = new Collection4TestCase.Item(42);
			Collection4TestCase.Item b = new Collection4TestCase.Item(a.id + 1);
			Collection4TestCase.Item c = new Collection4TestCase.Item(b.id + 1);
			Collection4TestCase.Item a_ = new Collection4TestCase.Item(a.id);
			Collection4 needle = new Collection4();
			Collection4 haystack = new Collection4();
			haystack.Add(a);
			needle.Add(a);
			needle.Add(b);
			Assert.IsFalse(haystack.ContainsAll(needle));
			needle.Remove(b);
			Assert.IsTrue(haystack.ContainsAll(needle));
			needle.Add(b);
			haystack.Add(b);
			Assert.IsTrue(haystack.ContainsAll(needle));
			needle.Add(a_);
			Assert.IsTrue(haystack.ContainsAll(needle));
			needle.Add(c);
			Assert.IsFalse(haystack.ContainsAll(needle));
			needle.Clear();
			Assert.IsTrue(haystack.ContainsAll(needle));
			haystack.Clear();
			Assert.IsTrue(haystack.ContainsAll(needle));
		}
开发者ID:Galigator,项目名称:db4o,代码行数:26,代码来源:Collection4TestCase.cs

示例7: AssertNotContainsNull

		private void AssertNotContainsNull(Collection4 c)
		{
			Assert.IsFalse(c.Contains(null));
			Assert.IsNull(c.Get(null));
			int size = c.Size();
			c.Ensure(null);
			Assert.AreEqual(size + 1, c.Size());
			c.Remove(null);
			Assert.AreEqual(size, c.Size());
		}
开发者ID:Galigator,项目名称:db4o,代码行数:10,代码来源:Collection4TestCase.cs

示例8: TestNulls

		public virtual void TestNulls()
		{
			Collection4 c = new Collection4();
			c.Add("one");
			AssertNotContainsNull(c);
			c.Add(null);
			AssertContainsNull(c);
			AssertCollection(new string[] { "one", null }, c);
			c.Prepend(null);
			AssertCollection(new string[] { null, "one", null }, c);
			c.Prepend("zero");
			c.Add("two");
			AssertCollection(new string[] { "zero", null, "one", null, "two" }, c);
			AssertContainsNull(c);
			c.Remove(null);
			AssertCollection(new string[] { "zero", "one", null, "two" }, c);
			c.Remove(null);
			AssertNotContainsNull(c);
			AssertCollection(new string[] { "zero", "one", "two" }, c);
			c.Remove(null);
			AssertCollection(new string[] { "zero", "one", "two" }, c);
		}
开发者ID:Galigator,项目名称:db4o,代码行数:22,代码来源:Collection4TestCase.cs

示例9: Expect

			private bool Expect(IObjectContainer container, string[] names)
			{
				Collection4 expected = new Collection4(names);
				IObjectSet actual = container.Query(typeof(CrashSimulatingTestSuite.CrashData));
				while (actual.HasNext())
				{
					CrashSimulatingTestSuite.CrashData current = (CrashSimulatingTestSuite.CrashData)
						actual.Next();
					if (!expected.Remove(current._name))
					{
						return false;
					}
				}
				return expected.IsEmpty();
			}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:15,代码来源:CrashSimulatingTestSuite.cs

示例10: AssertEntries

		private void AssertEntries(PersistentEntry[] expected, IEnumerator actual)
		{
			Collection4 checklist = new Collection4(actual);
			Assert.AreEqual(expected.Length, checklist.Size());
			for (int i = 0; i < expected.Length; ++i)
			{
				PersistentEntry e = expected[i];
				PersistentEntry a = EntryByUid(checklist.GetEnumerator(), e.uid);
				if (a != null)
				{
					AssertEqualEntries(e, a);
					checklist.Remove(a);
				}
			}
			Assert.IsTrue(checklist.IsEmpty(), checklist.ToString());
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:16,代码来源:CustomReflectorTestCase.cs

示例11: AssertIterator

 private void AssertIterator(Hashtable4 table, object[] keys)
 {
     var iter = table.Iterator();
     var expected = new Collection4(keys);
     while (iter.MoveNext())
     {
         var entry = (IEntry4) iter.Current;
         var removedOK = expected.Remove(entry.Key());
         Assert.IsTrue(removedOK);
     }
     Assert.IsTrue(expected.IsEmpty(), expected.ToString());
 }
开发者ID:masroore,项目名称:db4o,代码行数:12,代码来源:Hashtable4TestCase.cs


注:本文中的Db4objects.Db4o.Foundation.Collection4.Remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。