예제 #1
0
        /// <summary>
        /// A position is inside a property body only if it is inside an expression body.
        /// All block bodies for properties are part of the accessor declaration (a type
        /// of BaseMethodDeclaration), not the property declaration.
        /// </summary>
        internal static bool IsInBody(int position,
                                      PropertyDeclarationSyntax property)
        {
            var exprOpt = property.GetExpressionBodySyntax();

            return(IsInExpressionBody(position, exprOpt, property.SemicolonToken));
        }
예제 #2
0
 /// <summary>
 /// A position is inside a property body only if it is inside an expression body.
 /// All block bodies for properties are part of the accessor declaration (a type
 /// of BaseMethodDeclaration), not the property declaration.
 /// </summary>
 internal static bool IsInBody(int position, PropertyDeclarationSyntax property) =>
 IsInBody(
     position,
     blockOpt: null,
     property.GetExpressionBodySyntax(),
     property.SemicolonToken
     );
예제 #3
0
 /// <summary>
 /// A position is inside a property body only if it is inside an expression body.
 /// All block bodies for properties are part of the accessor declaration (a type
 /// of BaseMethodDeclaration), not the property declaration.
 /// </summary>
 internal static bool IsInBody(int position,
                               PropertyDeclarationSyntax property)
 => IsInBody(position, default(BlockSyntax), property.GetExpressionBodySyntax(), property.SemicolonToken);
예제 #4
0
 /// <summary>
 /// A position is inside a property body only if it is inside an expression body.
 /// All block bodies for properties are part of the accessor declaration (a type
 /// of BaseMethodDeclaration), not the property declaration.
 /// </summary>
 internal static bool IsInBody(int position,
     PropertyDeclarationSyntax property)
 {
     var exprOpt = property.GetExpressionBodySyntax();
     return IsInExpressionBody(position, exprOpt, property.SemicolonToken);
 }
예제 #5
0
 /// <summary>
 /// A position is inside a property body only if it is inside an expression body.
 /// All block bodies for properties are part of the accessor declaration (a type
 /// of BaseMethodDeclaration), not the property declaration.
 /// </summary>
 internal static bool IsInBody(int position,
     PropertyDeclarationSyntax property)
     => IsInBody(position, default(BlockSyntax), property.GetExpressionBodySyntax(), property.SemicolonToken);