Uređivanje

Dijeli putem


SearchResultCollection Class

Definition

The SearchResultCollection class contains the SearchResult instances that the Active Directory hierarchy returned during a DirectorySearcher query.

public ref class SearchResultCollection : MarshalByRefObject, IDisposable, System::Collections::ICollection
public class SearchResultCollection : MarshalByRefObject, IDisposable, System.Collections.ICollection
type SearchResultCollection = class
    inherit MarshalByRefObject
    interface ICollection
    interface IEnumerable
    interface IDisposable
Public Class SearchResultCollection
Inherits MarshalByRefObject
Implements ICollection, IDisposable
Inheritance
SearchResultCollection
Implements

Remarks

Due to implementation restrictions, the SearchResultCollection class cannot release all of its unmanaged resources when it is garbage collected. To prevent a memory leak, you must call the Dispose method when the SearchResultCollection object is no longer needed.

Properties

Count

Gets the number of SearchResult objects in this collection.

Handle

Gets the handle that is returned by the IDirectorySearch::ExecuteSearch method that performs the actual search. For more information, see the IDirectorySearch::ExecuteSearch article.

Item[Int32]

Gets the SearchResult object that is located at a specified index in this collection.

PropertiesLoaded

Gets the DirectorySearcher properties that were specified before the search was executed.

Methods

Contains(SearchResult)

Determines if a specified SearchResult object is in this collection.

CopyTo(SearchResult[], Int32)

Copies all SearchResult objects in this collection to the specific array, starting at the specified index in the target array.

CreateObjRef(Type)

Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Dispose()

Releases all resources that are used by the SearchResultCollection object.

Dispose(Boolean)

Releases the unmanaged resources that are used by the SearchResultCollection object and optionally releases the managed resources.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
Finalize()

Overrides the Finalize() method.

GetEnumerator()

Returns an enumerator that you can use to iterate through this collection.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetLifetimeService()
Obsolete.

Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
IndexOf(SearchResult)

Returns the index of the first occurrence of the specified SearchResult object in this collection.

InitializeLifetimeService()
Obsolete.

Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean)

Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

ICollection.CopyTo(Array, Int32)

Copies the elements of the ICollection to an Array, starting at a particular Array index.

ICollection.IsSynchronized

Gets a value indicating whether access to the ICollection is synchronized (thread safe).

ICollection.SyncRoot

Gets an object that can be used to synchronize access to the ICollection.

Extension Methods

Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Applies to