This article was translated by machine. To view in the article in English, select the English check box. You can also display the English text in a popup window by moving the mouse pointer over the text.
This documentation is archived and is not being maintained.

DiscoveryReferenceCollection.Contains أسلوب

Visual Studio 2010

يحدد ما إذا كان DiscoveryReferenceCollectionيحتوي على محدد DiscoveryReference.

مساحة الاسم:  System.Web.Services.Discovery
التجميع:  System.Web.Services (في System.Web.Services.dll)

public bool Contains(
	DiscoveryReference value


النوع: System.Web.Services.Discovery.DiscoveryReference
The DiscoveryReference إلى بحث within the DiscoveryReferenceCollection.

القيمة المُرجعة

النوع: System.Boolean
true if the DiscoveryReferenceCollection يحتوي على the DiscoveryReference; otherwise, false.

class MyDiscoveryDocumentClass
   static void Main()
      DiscoveryDocumentReference myDiscoveryDocReference1 = 
         new DiscoveryDocumentReference();
      DiscoveryDocumentReference myDiscoveryDocReference2 = 
         new DiscoveryDocumentReference();
      DiscoveryReference myDiscoveryReference;

      Console.WriteLine("Demonstrating DiscoveryReferenceCollection class.");

      // Create new DiscoveryReferenceCollection.
      DiscoveryReferenceCollection myDiscoveryReferenceCollection = 
         new DiscoveryReferenceCollection();

      // Access the Count method.
      Console.WriteLine("The number of elements in the collection is: " 
         + myDiscoveryReferenceCollection.Count.ToString());

      // Add elements to the collection.

      Console.WriteLine("The number of elements in the collection "
         + "after adding two elements to the collection: " 
         + myDiscoveryReferenceCollection.Count.ToString());

      // Call the Contains method.
      if (myDiscoveryReferenceCollection.Contains(myDiscoveryDocReference1) 
         != true)
         throw new Exception("Element not found in collection.");

      // Access the indexed member.
      myDiscoveryReference = 
      if (myDiscoveryReference == null)
         throw new Exception("Element not found in collection.");

      // Remove one element from collection.
      Console.WriteLine("The number of elements in the collection "
         + "after removing one element is: " 
         + myDiscoveryReferenceCollection.Count.ToString());

نظام التشغيل Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, الإصدار x64 من نظام التشغيل Windows XP Professional, Windows XP Starter Edition, Windows Server 2008, نظام التشغيل Windows Server 2003, نظام التشغيل Windows Server 2000 المزود بحزمة الخدمة SP4, نظام التشغيل Windows Millennium Edition, نظام التشغيل Windows 98

لا يدعم .NET Framework و .NET Compact Framework كافة الإصدارات الخاصة بكل نظام أساسي. للحصول على قائمة بالإصدارات المدعمة، راجع متطلبات النظام إطار عمل .NET.

.NET Framework

مدعوم في: 4, 3.5, 3.0, 2.0, 1.1, 1.0

NET Framework. Client Profile

مدعوم في: 4