Class LdapAttributeSet
A set of LdapAttribute objects. An LdapAttributeSet is a collection of LdapAttribute classes as returned from an LdapEntry on a search or read operation. LdapAttributeSet may be also used to construct an entry to be added to a directory.
Implements
Inherited Members
Namespace: Swan.Ldap
Syntax
[Serializable]
public class LdapAttributeSet : Dictionary<string, LdapAttribute>, IDictionary<string, LdapAttribute>, ICollection<KeyValuePair<string, LdapAttribute>>, IDictionary, ICollection, IReadOnlyDictionary<string, LdapAttribute>, IReadOnlyCollection<KeyValuePair<string, LdapAttribute>>, IEnumerable<KeyValuePair<string, LdapAttribute>>, IEnumerable, ISerializable, IDeserializationCallback
Constructors
LdapAttributeSet()
Initializes a new instance of the LdapAttributeSet class.
Declaration
public LdapAttributeSet()
Methods
Add(LdapAttribute)
Adds the specified attribute to this set if it is not already present. If an attribute with the same name already exists in the set then the specified attribute will not be added.
Declaration
public bool Add(LdapAttribute attr)
Parameters
| Type | Name | Description |
|---|---|---|
| LdapAttribute | attr | Object of type |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Contains(Object)
Returns true if this set contains an attribute of the same name
as the specified attribute.
Declaration
public bool Contains(object attr)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | attr | Object of type |
Returns
| Type | Description |
|---|---|
| Boolean | true if this set contains the specified attribute. |
GetSubset(String)
Creates a new attribute set containing only the attributes that have the specified subtypes. For example, suppose an attribute set contains the following attributes:
- cn
- cn;lang-ja
- sn;phonetic;lang-ja
- sn;lang-us
getSubset method and passing lang-ja as the
argument, the method returns an attribute set containing the following
attributes:.
- cn;lang-ja
- sn;phonetic;lang-ja
Declaration
public LdapAttributeSet GetSubset(string subtype)
Parameters
| Type | Name | Description |
|---|---|---|
| String | subtype | Semi-colon delimited list of subtypes to include. For example:
|
Returns
| Type | Description |
|---|---|
| LdapAttributeSet | An attribute set containing the attributes that match the specified subtype. |
Remove(LdapAttribute)
Removes the specified object from this set if it is present.
If the specified object is of type LdapAttribute, the
specified attribute will be removed. If the specified object is of type
string, the attribute with a name that matches the string will
be removed.
Declaration
public bool Remove(LdapAttribute entry)
Parameters
| Type | Name | Description |
|---|---|---|
| LdapAttribute | entry | The entry. |
Returns
| Type | Description |
|---|---|
| Boolean | true if the object was removed. |
ToString()
Returns a String that represents this instance.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String | A String that represents this instance. |