Browse Source

Document hierarchy collection fixes

MarcinZiabek 3 years ago
parent
commit
2f55b8d386

+ 2 - 2
QuestPDF/Previewer/Inspection/DocumentHierarchyProcessor.cs

@@ -50,8 +50,8 @@ public static class DocumentHierarchyProcessor
                 ElementType = element.GetType().Name,
                 ElementType = element.GetType().Name,
                 IsSingleChildContainer = element is ContainerElement,
                 IsSingleChildContainer = element is ContainerElement,
                 Location = locations,
                 Location = locations,
-                Properties = proxy.Child.GetElementConfiguration().ToList(),
-                Children = new List<InspectionElement>()
+                Properties = element.GetElementConfiguration().ToList(),
+                Children = treeNode.Children.Select(Map).ToList()
             };
             };
         }
         }
     }
     }

+ 1 - 1
QuestPDF/Previewer/PreviewerService.cs

@@ -137,7 +137,7 @@ namespace QuestPDF.Previewer
 
 
         private async Task CheckVersionCompatibility(Version version)
         private async Task CheckVersionCompatibility(Version version)
         {
         {
-            if (version.Major == RequiredPreviewerVersionMajor && version.Minor == RequiredPreviewerVersionMinor)
+            if (version is { Major: RequiredPreviewerVersionMajor, Minor: RequiredPreviewerVersionMinor })
                 return;
                 return;
 
 
             await ShowIncompatibleVersion();
             await ShowIncompatibleVersion();