/// <summary>
        /// Получение значений свойсва
        /// </summary>
        /// <param name="propertyName">название свойства</param>
        /// <returns>значения</returns>
        public List <string> GetValues(string propertyName)
        {
            var properties = new List <string>();

            if (directoryEntry != null)
            {
                PropertyValueCollection propertyValueCollection = directoryEntry.Properties[propertyName];
                if (propertyValueCollection == null || propertyValueCollection.Value == null)
                {
                    return(null);
                }

                foreach (var val in propertyValueCollection)
                {
                    properties.Add(val.ToString());
                }
            }
            else
            {
                var propertyValueArray = ldapEntry.GetAttributeArrayValue(propertyName);
                if (propertyValueArray == null)
                {
                    return(null);
                }
                properties = propertyValueArray.ToList();
            }
            return(properties);
        }
Example #2
0
        /// <summary>
        /// Get property values
        /// </summary>
        /// <param name="propertyName">property name</param>
        /// <returns>list of values</returns>
        public List <string> GetValues(string propertyName)
        {
            var properties = new List <string>();

            if (_directoryEntry != null)
            {
                var propertyValueCollection = _directoryEntry.Properties[propertyName];
                if (propertyValueCollection == null || propertyValueCollection.Value == null)
                {
                    return(null);
                }

                properties.AddRange(from object val in propertyValueCollection select val.ToString());
            }
            else
            {
                var propertyValueArray = _ldapEntry.GetAttributeArrayValue(propertyName);
                if (propertyValueArray == null)
                {
                    return(null);
                }
                properties = propertyValueArray.ToList();
            }
            return(properties);
        }
        /// <summary>
        /// Get property values
        /// </summary>
        /// <param name="propertyName">property name</param>
        /// <returns>list of values</returns>
        public override List <string> GetValues(string propertyName)
        {
            var propertyValueArray = _ldapEntry.GetAttributeArrayValue(propertyName);

            if (propertyValueArray == null)
            {
                return(new List <string>());
            }

            var properties = propertyValueArray.ToList();

            return(properties);
        }