Rdn
The Rdn class provides methods to manipulate relative distinguished names (RDNs).
Inheritance: The Rdn class implements the IComparable<Rdn> interface.
Namespace: Softerra.Adaxes.Ldap
Constructors
-
Constructor
-
Description
-
Rdn()
-
Constructs a new instance of the Rdn class.
-
Rdn(string)
-
Constructs a new instance of the Rdn class based on a string representation of a relative distinguished name (RDN).
-
Rdn(Rdn)
-
Constructs a new instance of the Rdn class by copying elements from another instance of the Rdn class.
-
Rdn(string, string)
-
Constructs a new instance of the Rdn class based on the specified RDN type and value.
Methods
-
Method
-
Description
-
AddPart(string, string)
-
Adds an RDN type-value pair to the collection based on the passed RDN type and RDN value strings.
-
AddPart(RdnPart)
-
Adds an RDN type-value pair to the collection.
-
ToString()
-
Returns a string representation of the RDN.
-
Explode(bool)
-
Returns individual components of the RDN as an array of string.
-
Explode(string, bool)
-
Returns individual components of a given RDN as an array of string, normalized.
-
Escape()
-
Returns the given RDN after escaping the characters that require escaping as per RFC 2253.
-
EscapeAttributeValue()
-
Returns the given RDN value after escaping the characters that require escaping as per RFC 2253.
-
Unescape()
-
Returns the given RDN after unescaping the characters that require escaping as per RFC 2253.
-
UnescapeAttributeValue()
-
Returns the given RDN value after unescaping the characters that require escaping as per RFC 2253.
-
CompareTo()
-
Compares the RDN with another RDN.
Properties
-
Property
-
Description
-
PartCount
-
Gets the number of RDN type-value pairs that this RDN contains.
-
Parts
-
Gets a collection of RDN type-value pairs that this RDN consists of.
-
RdnPart
-
Gets the first RDN type-value pair of all the pairs that this RDN consists of.
-
Type
-
Gets the type of this RDN.
-
Types
-
Gets a list of types that this RDN contains.
-
Value
-
Gets the value of this RDN.
-
Values
-
Gets a list of values that this RDN contains.
-
IsMultivalued
-
Gets a value that indicates whether the RDN is multivalued.
Details
Rdn()
Constructs a new instance of the Rdn class.
Rdn()
Rdn(string)
Constructs a new instance of the Rdn class based on a string representation of a relative distinguished name (RDN).
Rdn(string rdn)
Exceptions
-
ArgumentNullException
-
The rdn parameter is
null
. -
ArgumentException
-
The rdn parameter contains a string with more than one RDN or does not contain a valid RDN string as per RFC 2253.
Rdn(Rdn)
Constructs a new instance of the Rdn class by copying elements from another instance of the Rdn class.
Rdn(Rdn otherRdn)
Rdn(string, string)
Constructs a new instance of the Rdn class based on the specified RDN type and value.
Rdn(string type, string value)
AddPart(string, string)
Adds an RDN type-value pair to the collection based on the passed RDN type and RDN value strings.
void AddPart(string type, string value)
AddPart(RdnPart)
Adds an RDN type-value pair to the collection.
void AddPart(RdnPart part)
ToString()
Returns a string representation of the RDN.
string ToString(bool noTypes)
Parameters
If the noTypes parameter is set to true
, the method returns only RDN values without RDN types (e.g. "John Doe", "Accounting", "com" instead of "CN=John Doe", "OU=Accounting", and "DC=com").
Explode(bool)
Returns individual components of the RDN as an array of string.
string[] Explode(bool noTypes)
Parameters
If the noTypes parameter is set to true
, the method returns only RDN values without RDN types (e.g. "John Doe", "Accounting", "com" instead of "CN=John Doe", "OU=Accounting", and "DC=com").
Explode(string, bool)
Returns individual components of a given RDN as an array of string, normalized.
static string[] Explode(string rdn, bool noTypes)
Parameters
- rdn - Contains the relative distinguished name to parse.
- noTypes - If set to
true
, the method returns only RDN values without RDN types (e.g. "John Doe", "Accounting", "com" instead of "CN=John Doe", "OU=Accounting", and "DC=com").
Escape()
Returns the given RDN after escaping the characters that require escaping as per RFC 2253 (e.g. for RDN "CN=Acme, Inc" the method returns "CN=Acme, Inc").
static string Escape(string rdn)
EscapeAttributeValue()
Returns the given RDN value after escaping the characters that require escaping as per RFC 2253 (e.g. for RDN value "Acme, Inc" the method returns "Acme, Inc").
static string EscapeAttributeValue(string rdnValue)
Unescape()
Returns the given RDN after unescaping the characters that require escaping as per RFC 2253 (e.g. for RDN "CN=Acme, Inc" the method returns "CN=Acme, Inc").
static string Unescape(string rdn)
UnescapeAttributeValue()
Returns the given RDN value after unescaping the characters that require escaping as per RFC 2253 (e.g. for RDN value "Acme, Inc" the method returns "Acme, Inc").
static string UnescapeAttributeValue(string rdnValue)
CompareTo()
Compares the RDN with another RDN.
int CompareTo(Rdn otherRdn)
Return value
The method returns an int that indicates the relative order of the objects being compared. The return value has the following meanings:
- If the return value is less than zero, this RDN is less than the RDN specified in the otherRdn parameter.
- If the return value is 0, this RDN is equal to the RDN specified in the otherRdn parameter.
- If the return value is greater than zero, this RDN is greater than the RDN specified in the otherRdn parameter.
PartCount
Gets the number of RDN type-value pairs that this RDN contains.
- Type:
- int
- Access:
- Read-only
Parts
Gets a collection of RDN type-value pairs that this RDN consists of.
- Type:
- Collection<RdnPart>
- Access:
- Read-only
RdnPart
Gets the first RDN type-value pair of all the pairs that this RDN consists of.
- Type:
- RdnPart
- Access:
- Read-only
Remarks
If the instance of the Rdn class is empty, the property gets an empty instance of the RdnPart class.
Type
Gets the type of this RDN.
- Type:
- string
- Access:
- Read-only
Remarks
This property assumes that the RDN contains only one RDN type-value pair. When multivalued RDNs are used, the property gets only the first RDN type. Use the Types
property to obtain all the types.
Types
Gets a list of types that this RDN contains.
- Type:
- IList<string>
- Access:
- Read-only
Value
Gets the value of this RDN.
- Type:
- string
- Access:
- Read-only
Remarks
When multivalued RDNs are used, the property gets only the first RDN value. Use the Values
property to get all the values.
Values
Gets a list of values that this RDN contains.
- Type:
- IList<string>
- Access:
- Read-only
IsMultivalued
Gets a value that indicates whether the RDN is multivalued.
- Type:
- bool
- Access:
- Read-only
Requirements
Minimum required version: 2009.1