BondInEtwLinqpadDriver.BondDynamicDriver.AddNestedPropertyToTree C# (CSharp) Method

AddNestedPropertyToTree() private method

private AddNestedPropertyToTree ( PropertyInfo property, LINQPad.Extensibility.DataContext.ExplorerItem propertyType ) : void
property System.Reflection.PropertyInfo
propertyType LINQPad.Extensibility.DataContext.ExplorerItem
return void
        private void AddNestedPropertyToTree(PropertyInfo[] property, ExplorerItem propertyType)
        {
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            if (propertyType == null)
            {
                throw new ArgumentNullException("propertyType");
            }

            var oldPropertyType = propertyType;

            foreach (var prop in property)
            {
                propertyType = new ExplorerItem(prop.Name, ExplorerItemKind.Property, ExplorerIcon.Column)
                {
                    ToolTipText = "Property Type: " + prop.PropertyType.Name,
                    DragText = prop.Name,
                    Children = new List<ExplorerItem>(),
                    IsEnumerable = true
                };

                oldPropertyType.Children.Add(propertyType);

                if (!(prop.PropertyType.IsPrimitive || prop.PropertyType.Namespace.Contains("System")))
                {
                    this.AddNestedPropertyToTree(prop.PropertyType.GetProperties(), propertyType);
                }
            }
        }