Class LdapControl
Encapsulates optional additional parameters or constraints to be applied to an Ldap operation. When included with LdapConstraints or LdapSearchConstraints on an LdapConnection or with a specific operation request, it is sent to the server along with operation requests.
Inherited Members
Namespace: Swan.Ldap
Syntax
public class LdapControl
Constructors
LdapControl(String, Boolean, SByte[])
Initializes a new instance of the LdapControl class. Constructs a new LdapControl object using the specified values.
Declaration
public LdapControl(string oid, bool critical, sbyte[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| String | oid | The OID of the control, as a dotted string. |
| Boolean | critical | True if the Ldap operation should be discarded if the control is not supported. False if the operation can be processed without the control. |
| SByte[] | values | The control-specific data. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | An OID must be specified. |
Properties
Critical
Returns whether the control is critical for the operation.
Declaration
public bool Critical { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
|
Id
Returns the identifier of the control.
Declaration
public string Id { get; }
Property Value
| Type | Description |
|---|---|
| String | The identifier. |
Methods
GetValue()
Returns the control-specific data of the object.
Declaration
public sbyte[] GetValue()
Returns
| Type | Description |
|---|---|
| SByte[] | The control-specific data of the object as a byte array, or null if the control has no data. |
Register(String, Type)
Registers a class to be instantiated on receipt of a control with the given OID. Any previous registration for the OID is overridden. The controlClass must be an extension of LdapControl.
Declaration
public static void Register(string oid, Type controlClass)
Parameters
| Type | Name | Description |
|---|---|---|
| String | oid | The object identifier of the control. |
| Type | controlClass | A class which can instantiate an LdapControl. |