protected virtual Class CommandSourceClass(CommandDescriptor cmd,
                                                   TypeRep baseClass,
                                                   CommandDescriptor?parent)
        {
            //  .Optional(parent is null, (cls) => cls.Member(parent is null, ParameterlessCtor(cmd))

            return(new Class(cmd.CommandSourceClassName())
                   .Base(baseClass)
                   .OptionalMember(parent is null, ParameterlessCtor(cmd))
                   .Constructor(GetCtor(cmd, cmd.Root, parent))
                   .BlankLine()
                   .Properties(cmd.GetChildren().Select(s => ChildProperty(s)))
                   .Properties(cmd.GetChildren(),
                               s => ChildProperty(s))
                   .BlankLine()
                   .Methods(cmd.GetOptionsAndArgs(),
                            s => ChildGetMethod(s)));
 static IClassMember ParameterlessCtor(CommandDescriptor cmd)
 => new Constructor(cmd.CommandSourceClassName())
 .ThisCall(Null(), Null());