SearchResultCollection SearchResultCollection SearchResultCollection 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
SearchResultCollectionSearchResultCollectionSearchResultCollectionSearchResultCollection
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 Count Count Count

Gets the number of SearchResult objects in this collection.

Handle Handle Handle Handle

Gets the handle that is returned by the IDirectorySearch::ExecuteSearch method that performs the actual search. For more information, see the IDirectorySearch::ExecuteSearch topic in the MSDN Library at http://msdn.microsoft.com/library.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

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

PropertiesLoaded PropertiesLoaded PropertiesLoaded PropertiesLoaded

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

Methods

Contains(SearchResult) Contains(SearchResult) Contains(SearchResult) Contains(SearchResult)

Determines if a specified SearchResult object is in this collection.

CopyTo(SearchResult[], Int32) CopyTo(SearchResult[], Int32) CopyTo(SearchResult[], Int32) 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) CreateObjRef(Type) CreateObjRef(Type) 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() Dispose() Dispose() Dispose()

Releases all resources that are used by the SearchResultCollection object.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

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

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
Finalize() Finalize() Finalize() Finalize()

Overrides the Finalize() method.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

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

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

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

(Inherited from MarshalByRefObject)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
IndexOf(SearchResult) IndexOf(SearchResult) IndexOf(SearchResult) IndexOf(SearchResult)

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

InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

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

(Inherited from MarshalByRefObject)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

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

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

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

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

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

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Security

DirectoryServicesPermission
LinkDemand

Applies to