Novell.Directory.Ldap.LdapAttributeSet.getAttribute C# (CSharp) Method

getAttribute() public method

Returns the attribute matching the specified attrName. For example:
  • getAttribute("cn") returns only the "cn" attribute
  • getAttribute("cn;lang-en") returns only the "cn;lang-en" attribute.
In both cases, null is returned if there is no exact match to the specified attrName. Note: Novell eDirectory does not currently support language subtypes. It does support the "binary" subtype.
public getAttribute ( System attrName ) : LdapAttribute
attrName System The name of an attribute to retrieve, with or without /// subtype specifications. For example, "cn", "cn;phonetic", and /// "cn;binary" are valid attribute names. /// ///
return LdapAttribute
        public virtual LdapAttribute getAttribute(System.String attrName)
        {
            return (LdapAttribute) map[attrName.ToUpper()];
        }

Same methods

LdapAttributeSet::getAttribute ( System attrName, System lang ) : LdapAttribute

Usage Example

示例#1
0
        /// <summary>
        /// Returns the attribute value specified in the second string parameter
        /// 
        /// TODO: Need more error handling 
        /// </summary>
        /// <param name="entry">
        /// A <see cref="LdapEntry"/>
        /// </param>
        /// <param name="attr">
        /// A <see cref="System.String"/>
        /// </param>
        /// <returns>
        /// A <see cref="System.String"/>
        /// </returns>
        public static string getAttr(LdapAttributeSet attrSet, ATTRNAME attr)
        {
            string sAttr = attr.ToString();
            Logger.Debug("Requesting Attribute value of {0}", attrSet.getAttribute(sAttr));

            if (attrSet.getAttribute(sAttr) == null)
                return null;
            else {
                Logger.Debug(" Attribute {0} -> {1}", sAttr, attrSet.getAttribute(sAttr).StringValue);
                return attrSet.getAttribute(sAttr).StringValue;
            }
        }
All Usage Examples Of Novell.Directory.Ldap.LdapAttributeSet::getAttribute