Repository: PowerShell/PowerShell
File: src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Complex.cs (C#)

Code before:
                foreach (var frameItemToken in frameToken.itemDefinition.formatTokenList)
                {
                    frame.CustomItems.Add(CustomItemBase.Create(frameItemToken));
                }

                return frame;
            }

            if (token is CompoundPropertyToken cpt)
            {
                var cie = new CustomItemExpression { EnumerateCollection = cpt.enumerateCollection };

                if (cpt.conditionToken != null)
                {
                    cie.ItemSelectionCondition = new DisplayEntry(cpt.conditionToken);
                }

                if (cpt.expression.expressionValue != null)
                {
                    cie.Expression = new DisplayEntry(cpt.expression);
                }

                if (cpt.control != null && cpt.control is ComplexControlBody)
                {
                    cie.CustomControl = new CustomControl((ComplexControlBody)cpt.control, null);
                }

                return cie;
            }

            Diagnostics.Assert(false, "Unexpected formatting token kind");

            return null;
        }
    }

    /// <summary/>
    public sealed class CustomItemExpression : CustomItemBase
    {
        internal CustomItemExpression() { }

        /// <summary/>
        public DisplayEntry ItemSelectionCondition { get; set; }

        /// <summary/>
        public DisplayEntry Expression { get; set; }

        /// <summary/>
        public bool EnumerateCollection { get; set; }

        /// <summary/>

Review comment (suggestion):
```suggestion
                if (cpt.control is ComplexControlBody complexControlBody)
                {
                    cie.CustomControl = new CustomControl(complexControlBody, null);
                }
```

Code after:
                foreach (var frameItemToken in frameToken.itemDefinition.formatTokenList)
                {
                    frame.CustomItems.Add(CustomItemBase.Create(frameItemToken));
                }

                return frame;
            }

            if (token is CompoundPropertyToken cpt)
            {
                var cie = new CustomItemExpression { EnumerateCollection = cpt.enumerateCollection };

                if (cpt.conditionToken != null)
                {
                    cie.ItemSelectionCondition = new DisplayEntry(cpt.conditionToken);
                }

                if (cpt.expression.expressionValue != null)
                {
                    cie.Expression = new DisplayEntry(cpt.expression);
                }

                if (cpt.control is ComplexControlBody complexControlBody)
                {
                    cie.CustomControl = new CustomControl(complexControlBody, null);
                }

                return cie;
            }

            Diagnostics.Assert(false, "Unexpected formatting token kind");

            return null;
        }
    }

    /// <summary/>
    public sealed class CustomItemExpression : CustomItemBase
    {
        internal CustomItemExpression() { }

        /// <summary/>
        public DisplayEntry ItemSelectionCondition { get; set; }

        /// <summary/>
        public DisplayEntry Expression { get; set; }

        /// <summary/>
        public bool EnumerateCollection { get; set; }

        /// <summary/>