Ejemplo n.º 1
0
 public StatementListWrapper(
     Node <TParent, TParentSyntax> node,
     Func <TParentSyntax, SyntaxList <StatementSyntax> > getList,
     Func <TParentSyntax, SyntaxList <StatementSyntax>, TParentSyntax> createList)
     : this(ListFactory.CreateNodeList(node, getList, createList, StatementSyntaxExtensions.ToInternalStatement))
 {
 }
        private static IList <TChild> CreateConstraintList <TChild>(
            Node <GenericParameterDeclarationWithCodeAnalysis, GenericParameterDeclarationSyntax> node,
            Func <string, bool> filter,
            Func <UnspecifiedTypeReferenceWithCodeAnalysis, TChild> getChild)
            where TChild : class, IHasNode <TypeSyntax>, IUnspecifiedTypeReferenceWrapper
        {
            IChildSyntaxList <GenericParameterDeclarationSyntax, TypeParameterConstraintSyntax> constraintSyntaxList =
                ListFactory.CreateChildSyntaxList(
                    node,
                    syntax => syntax.Constraints,
                    (parentSyntax, childSyntax) => parentSyntax.WithConstraints(childSyntax));
            IChildSyntaxList <GenericParameterDeclarationSyntax, TypeConstraintSyntax> filteredConstraintSyntaxList =
                new FilteredChildSyntaxList <GenericParameterDeclarationSyntax, TypeParameterConstraintSyntax, TypeConstraintSyntax>(
                    constraintSyntaxList,
                    syntax => filter(syntax.Type.ToName()));
            IList <GenericParameterConstraint> constraintList = new ChildNodeList <
                GenericParameterDeclarationWithCodeAnalysis,
                GenericParameterDeclarationSyntax,
                GenericParameterConstraint,
                TypeConstraintSyntax>(
                node,
                filteredConstraintSyntaxList,
                () => new GenericParameterConstraint());

            return(new WrappedList <GenericParameterConstraint, TChild>(
                       constraintList,
                       parent => getChild(parent.Type),
                       child => child.Node.GetParent <GenericParameterConstraint>() ?? new GenericParameterConstraint(child.TypeReference)));
        }
Ejemplo n.º 3
0
 public BaseTypeSyntaxListConversions(
     Node <TParent, TParentSyntax> node,
     Func <TParentSyntax, BaseListSyntax, TParentSyntax> createList)
 {
     this.createList = createList;
     list            = ListFactory.CreateChildSyntaxList(node, this);
 }
Ejemplo n.º 4
0
 public ExpressionListWrapper(
     Node <TParent, TParentSyntax> node,
     Func <TParentSyntax, SeparatedSyntaxList <ExpressionSyntax> > getList,
     Func <TParentSyntax, SeparatedSyntaxList <ExpressionSyntax>, TParentSyntax> createList)
     : this(ListFactory.CreateNodeList(node, getList, createList, ExpressionSyntaxExtensions.ToInternalExpression))
 {
 }
Ejemplo n.º 5
0
 public MemberListWrapper(
     Node <TParent, TParentSyntax> node,
     Func <TParentSyntax, SyntaxList <MemberDeclarationSyntax>, TParentSyntax> createList,
     Func <TChild> factory,
     Func <TChildSyntax, bool> filter = null)
     : base(node, ListFactory.CreateFilteredSyntaxList(node, syntax => syntax.Members, createList, filter), factory)
 {
 }
Ejemplo n.º 6
0
 private NamespaceMemberListWrapper(
     Node <NamespaceWithCodeAnalysis, NamespaceDeclarationSyntax> node,
     Func <NamespaceDeclarationSyntax, SyntaxList <MemberDeclarationSyntax> > getList,
     Func <NamespaceDeclarationSyntax, SyntaxList <MemberDeclarationSyntax>, NamespaceDeclarationSyntax> createList,
     Func <TChild> factory,
     Func <TChildSyntax, bool> filter)
     : base(node, ListFactory.CreateFilteredSyntaxList(node, getList, createList, filter), factory)
 {
 }
Ejemplo n.º 7
0
 private LoadedDocumentMemberListWrapper(
     Node <LoadedDocumentWithCodeAnalysis, CompilationUnitSyntax> node,
     Func <CompilationUnitSyntax, SyntaxList <MemberDeclarationSyntax> > getList,
     Func <CompilationUnitSyntax, SyntaxList <MemberDeclarationSyntax>, CompilationUnitSyntax> createList,
     Func <TChild> factory,
     Func <TChildSyntax, bool> filter)
     : base(node, ListFactory.CreateFilteredSyntaxList(node, getList, createList, filter), factory)
 {
 }
Ejemplo n.º 8
0
 public SeparatedSyntaxNodeList(
     Node <TParent, TParentSyntax> node,
     Func <TParentSyntax, SeparatedSyntaxList <TChildSyntax> > getList,
     Func <TParentSyntax, SeparatedSyntaxList <TChildSyntax>, TParentSyntax> createList,
     Func <TChild> factory)
     : base(node, ListFactory.CreateChildSyntaxList(node, getList, createList), factory)
 {
     this.node       = node;
     this.createList = createList;
 }
 public GenericParameterDeclarationSyntaxList(
     Node <TParent, TParentSyntax> node,
     TypeParameterSyntaxListConversions <TParentSyntax> typeParameterConversions,
     Func <TParentSyntax, SyntaxList <TypeParameterConstraintClauseSyntax> > getConstraintClauses,
     Func <TParentSyntax, SyntaxList <TypeParameterConstraintClauseSyntax>, TParentSyntax> createConstraintClauses)
 {
     this.node         = node;
     typeParameters    = ListFactory.CreateChildSyntaxList(node, typeParameterConversions);
     constraintClauses = ListFactory.CreateChildSyntaxList(node, getConstraintClauses, createConstraintClauses);
 }
Ejemplo n.º 10
0
 private GenericParameterDeclarationNodeList(
     Node <TParent, TParentSyntax> node,
     TypeParameterSyntaxListConversions <TParentSyntax> typeParameterConversions,
     Func <TParentSyntax, SyntaxList <TypeParameterConstraintClauseSyntax> > getConstraintClauses,
     Func <TParentSyntax, SyntaxList <TypeParameterConstraintClauseSyntax>, TParentSyntax> createConstraintClauses)
     : base(
         node,
         ListFactory.CreateChildSyntaxList(node, typeParameterConversions, getConstraintClauses, createConstraintClauses),
         () => new GenericParameterDeclarationWithCodeAnalysis())
 {
 }