From 90a6c3bac4420f8898da37d41340d87797fde369 Mon Sep 17 00:00:00 2001 From: SergeyNefyodov Date: Tue, 28 Nov 2023 17:01:57 +0400 Subject: [PATCH] Object members support added --- RevitLookup/Core/Metadata/DescriptorBuilder.Build.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/RevitLookup/Core/Metadata/DescriptorBuilder.Build.cs b/RevitLookup/Core/Metadata/DescriptorBuilder.Build.cs index 618401eed..69e223e66 100644 --- a/RevitLookup/Core/Metadata/DescriptorBuilder.Build.cs +++ b/RevitLookup/Core/Metadata/DescriptorBuilder.Build.cs @@ -29,19 +29,16 @@ public sealed partial class DescriptorBuilder private IReadOnlyCollection BuildInstanceObject(Type type) { var types = new List(); - while (type is not null) + while (type != null) { - if (type.BaseType is not null) + if (type.BaseType != null || _settings.IsObjectMembersAllowed) { types.Add(type); } - else if (_settings.IsObjectMembersAllowed) - { - types.Add(type); - } - type = type?.BaseType; + type = type.BaseType; } + for (var i = types.Count - 1; i >= 0; i--) { _type = types[i];