-
Notifications
You must be signed in to change notification settings - Fork 4k
/
AnonymousMethodExpressionSyntax.cs
33 lines (28 loc) · 1.25 KB
/
AnonymousMethodExpressionSyntax.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace Microsoft.CodeAnalysis.CSharp.Syntax
{
public partial class AnonymousMethodExpressionSyntax
{
public BlockSyntax Block => (BlockSyntax)this.Body;
public AnonymousMethodExpressionSyntax WithBlock(BlockSyntax block)
{
return this.Update(this.AsyncKeyword, this.DelegateKeyword, this.ParameterList, block);
}
public AnonymousMethodExpressionSyntax AddBlockStatements(params StatementSyntax[] items)
{
return this.WithBlock(this.Block.WithStatements(this.Block.Statements.AddRange(items)));
}
}
}
namespace Microsoft.CodeAnalysis.CSharp
{
public partial class SyntaxFactory
{
/// <summary>Creates a new AnonymousMethodExpressionSyntax instance.</summary>
public static AnonymousMethodExpressionSyntax AnonymousMethodExpression()
{
return SyntaxFactory.AnonymousMethodExpression(default(SyntaxToken), SyntaxFactory.Token(SyntaxKind.DelegateKeyword), default(ParameterListSyntax), SyntaxFactory.Block());
}
}
}