Пример #1
0
        public void TestLdapAttributeGetBytesMaxInt()
        {
            var attribute = new LdapAttribute(UniversalDataType.Integer, Int32.MaxValue);

            Assert.AreEqual(Int32.MaxValue, attribute.GetValue <Int32>());
        }
Пример #2
0
        private void RecurseAttributes(LdapAttribute attribute, Int32 depth = 1)
        {
            if (attribute != null)
            {
                Console.WriteLine($"{Utils.Repeat(">", depth)} {attribute.Class}:{attribute.DataType}{attribute.LdapOperation}{attribute.ContextType} - Type: {attribute.GetValue().GetType()} - {attribute.GetValue()}");

                if (attribute.IsConstructed)
                {
                    foreach (var attr in attribute.ChildAttributes)
                    {
                        depth++;
                        RecurseAttributes(attr, depth);
                        depth--;
                    }
                }
            }
        }
Пример #3
0
 private void RecurseAttributes(StringBuilder sb, LdapAttribute attribute, Int32 depth = 1)
 {
     if (attribute != null)
     {
         sb.AppendLine($"{Utils.Repeat(">", depth)} {attribute.Class}:{attribute.DataType}{attribute.LdapOperation}{attribute.ContextType} - Type: {attribute.GetValue().GetType()} - {attribute.GetValue()}");
         if (attribute.IsConstructed)
         {
             attribute.ChildAttributes.ForEach(o => RecurseAttributes(sb, o, depth + 1));
         }
     }
 }