Skip to content

Commit

Permalink
Object members support added
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyNefyodov committed Nov 28, 2023
1 parent 1267fb4 commit 793a66d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions RevitLookup/Core/Metadata/DescriptorBuilder.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,18 @@ public sealed partial class DescriptorBuilder
private IReadOnlyCollection<Descriptor> BuildInstanceObject(Type type)
{
var types = new List<Type>();
while (type.BaseType is not null)
while (type is not null)
{
types.Add(type);
type = type.BaseType;
if (type.BaseType is not null)
{
types.Add(type);
}
else if (_settings.IsObjectMembersAllowed)
{
types.Add(type);
}
type = type?.BaseType;
}
if (_settings.IsObjectMembersAllowed)
types.Add(typeof(object));

for (var i = types.Count - 1; i >= 0; i--)
{
Expand Down

0 comments on commit 793a66d

Please sign in to comment.