Пример #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)));
 }