DirectorySynchronization DirectorySynchronization DirectorySynchronization DirectorySynchronization Class

Definition

Specifies how to synchronize a directory within a domain.

public ref class DirectorySynchronization
public class DirectorySynchronization
type DirectorySynchronization = class
Public Class DirectorySynchronization
Inheritance
DirectorySynchronizationDirectorySynchronizationDirectorySynchronizationDirectorySynchronization

Examples

The following C# example shows how to synchronize a directory.

DirectorySearcher src = new DirectorySearcher("…");   
src.DirectorySynchronization= new DirectorySynchronization(); // Initiate dirsync,   
                                                              // this means a full synch  

foreach(SearchResult res in src.FindAll() )  
{  
    Console.WriteLine(…");  
}  

// Restart the dirsync   
foreach(SearchResult res in src.FindAll() )  
{  
    Console.WriteLine(…");  
}  

The following C# example shows how to synchronize a directory by persisting it to a file.

DirectorySearcher src = new DirectorySearcher("…");   
src.DirectorySynchronization= new DirectorySynchronization(); // Initiate dirsync,   
                                                              // this means a full synch  

foreach(SearchResult res in src.FindAll() )  
{  
    Console.WriteLine(…");  
}  

// Now they should be able to persist the dirSync cookie, by serializing to a file.   
FileStream myStream = File.Create("dirsync.data");  
BinaryFormatter fmt = new BinaryFormatter();  
fmt.Serialize(myStream, src.DirectorySynchronization);  
myStream.Close();  
… ….  

// At some point in time, we wake up and read by de-serializing the dirSync cookie,   
// and resume the  dirSync   
FileStream myStream = FileCreate("dirsync.data");  
BinaryFormatter fmt = new BinaryFormatter();  
DirectorySynchronization dirSync = fmt.Deserialize(myStream);  

DirectorySearcher src = new DirectorySearcher(…);  
src.DirectorySynchronization = dirSync;  

foreach(SearchResult res in src.FindAll() )  
{  
    Console.WriteLine(…");  
}  

Constructors

DirectorySynchronization() DirectorySynchronization() DirectorySynchronization() DirectorySynchronization()

Initializes a new instance of the DirectorySynchronization object.

DirectorySynchronization(Byte[]) DirectorySynchronization(Byte[]) DirectorySynchronization(Byte[]) DirectorySynchronization(Byte[])

Initializes a new instance of the DirectorySynchronization object with a cookie.

DirectorySynchronization(DirectorySynchronization) DirectorySynchronization(DirectorySynchronization) DirectorySynchronization(DirectorySynchronization) DirectorySynchronization(DirectorySynchronization)

Initializes a new instance of the DirectorySynchronization object with a directory synchronization object.

DirectorySynchronization(DirectorySynchronizationOptions) DirectorySynchronization(DirectorySynchronizationOptions) DirectorySynchronization(DirectorySynchronizationOptions) DirectorySynchronization(DirectorySynchronizationOptions)

Initializes a new instance of the DirectorySynchronization object with a directory synchronization option.

DirectorySynchronization(DirectorySynchronizationOptions, Byte[]) DirectorySynchronization(DirectorySynchronizationOptions, Byte[]) DirectorySynchronization(DirectorySynchronizationOptions, Byte[]) DirectorySynchronization(DirectorySynchronizationOptions, Byte[])

Initializes a new instance of the DirectorySynchronization object with a directory synchronization option and cookie.

Properties

Option Option Option Option

Gets or sets the options for the directory synchronization search.

Methods

Copy() Copy() Copy() Copy()

Returns a copy of the current DirectorySynchronization instance.

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

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

(Inherited from Object)
GetDirectorySynchronizationCookie() GetDirectorySynchronizationCookie() GetDirectorySynchronizationCookie() GetDirectorySynchronizationCookie()

Gets the directory synchronization search cookie.

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

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

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

Creates a shallow copy of the current Object.

(Inherited from Object)
ResetDirectorySynchronizationCookie() ResetDirectorySynchronizationCookie() ResetDirectorySynchronizationCookie() ResetDirectorySynchronizationCookie()

Resets the directory synchronization search cookie.

ResetDirectorySynchronizationCookie(Byte[]) ResetDirectorySynchronizationCookie(Byte[]) ResetDirectorySynchronizationCookie(Byte[]) ResetDirectorySynchronizationCookie(Byte[])

Resets the directory synchronization search cookie.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also