示例#1
0
 internal FieldWithCodeAnalysis()
 {
     node         = new Node <FieldWithCodeAnalysis, VariableDeclaratorSyntax>(this);
     initialValue = new CachedExpressionNode <FieldWithCodeAnalysis, VariableDeclaratorSyntax>(
         node,
         syntax => syntax.Initializer.Value,
         VariableDeclaratorSyntaxExtensions.WithInitialValue);
 }
示例#2
0
 internal LambdaPropertyWithCodeAnalysis()
 {
     property         = new PropertyWithCodeAnalysis();
     lambdaExpression = new CachedExpressionNode <PropertyWithCodeAnalysis, PropertyDeclarationSyntax>(
         property.Node,
         syntax => syntax.ExpressionBody?.Expression,
         (parentSyntax, childSyntax) => parentSyntax.WithExpressionBody(childSyntax == null ? null : SyntaxFactory.ArrowExpressionClause(childSyntax)));
 }
示例#3
0
 internal NamedAttributeValueWithCodeAnalysis()
 {
     node  = new Node <NamedAttributeValueWithCodeAnalysis, AttributeArgumentSyntax>(this);
     value = new CachedExpressionNode <NamedAttributeValueWithCodeAnalysis, AttributeArgumentSyntax>(
         node,
         syntax => syntax.Expression,
         (parentSyntax, childSyntax) => parentSyntax.WithExpression(childSyntax));
 }
 internal AutoPropertyWithCodeAnalysis()
 {
     property     = new PropertyWithCodeAnalysis();
     initialValue = new CachedExpressionNode <PropertyWithCodeAnalysis, PropertyDeclarationSyntax>(
         property.Node,
         syntax => syntax.Initializer?.Value,
         (parentSyntax, childSyntax) => parentSyntax.WithInitializer(childSyntax == null ? null : SyntaxFactory.EqualsValueClause(childSyntax)));
 }