File tree Expand file tree Collapse file tree
ImmutableObjectGraph.Generation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -185,6 +185,15 @@ private void ImplementOrderedChildrenInterface()
185185 this . baseTypes . Add ( SyntaxFactory . SimpleBaseType ( Syntax . GetTypeSyntax ( typeof ( IRecursiveParentWithOrderedChildren ) ) ) ) ;
186186 }
187187
188+ // IReadOnlyList<IRecursiveType> IRecursiveParentWithOrderedChildren.Children => this.children;
189+ this . innerMembers . Add ( SyntaxFactory . PropertyDeclaration (
190+ Syntax . IReadOnlyListOf ( Syntax . GetTypeSyntax ( typeof ( IRecursiveType ) ) ) ,
191+ nameof ( IRecursiveParentWithOrderedChildren . Children ) )
192+ . WithExplicitInterfaceSpecifier ( SyntaxFactory . ExplicitInterfaceSpecifier ( SyntaxFactory . IdentifierName ( nameof ( IRecursiveParentWithOrderedChildren ) ) ) )
193+ . WithExpressionBody ( SyntaxFactory . ArrowExpressionClause ( Syntax . ThisDot ( SyntaxFactory . IdentifierName ( this . generator . applyToMetaType . RecursiveField . Name ) ) ) )
194+ . WithSemicolonToken ( SyntaxFactory . Token ( SyntaxKind . SemicolonToken ) )
195+ . AddAttributeLists ( SyntaxFactory . AttributeList ( SyntaxFactory . SingletonSeparatedList ( DebuggerBrowsableNeverAttribute ) ) ) ) ;
196+
188197 // int IRecursiveParentWithOrderedChildren.IndexOf(IRecursiveType value)
189198 var valueParameterName = SyntaxFactory . IdentifierName ( "value" ) ;
190199 this . innerMembers . Add ( SyntaxFactory . MethodDeclaration (
Original file line number Diff line number Diff line change @@ -30,11 +30,13 @@ public interface IRecursiveParentWithChildReplacement<TRecursiveType> : IRecursi
3030 }
3131
3232 public interface IRecursiveParentWithOrderedChildren : IRecursiveParent {
33- int IndexOf ( IRecursiveType value ) ;
33+ new IReadOnlyList < IRecursiveType > Children { get ; }
34+
35+ int IndexOf ( IRecursiveType value ) ;
3436 }
3537
3638 public interface IRecursiveParentWithSortedChildren : IRecursiveParentWithOrderedChildren {
37- int Compare ( IRecursiveType first , IRecursiveType second ) ;
39+ int Compare ( IRecursiveType first , IRecursiveType second ) ;
3840 }
3941
4042 public interface IRecursiveParentWithLookupTable < TRecursiveType > : IRecursiveParent < TRecursiveType >
You can’t perform that action at this time.
0 commit comments