コード例 #1
0
ファイル: LookupPosition.cs プロジェクト: zlphoenix/roslyn
        /// <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,
                                      IndexerDeclarationSyntax indexer)
        {
            var exprOpt = indexer.GetExpressionBodySyntax();

            return(IsInExpressionBody(position, exprOpt, indexer.SemicolonToken));
        }
コード例 #2
0
ファイル: LookupPosition.cs プロジェクト: belav/roslyn
 /// <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, IndexerDeclarationSyntax indexer) =>
 IsInBody(
     position,
     blockOpt: null,
     indexer.GetExpressionBodySyntax(),
     indexer.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,
                               IndexerDeclarationSyntax indexer)
 => IsInBody(position, default(BlockSyntax), indexer.GetExpressionBodySyntax(), indexer.SemicolonToken);
コード例 #4
0
ファイル: LookupPosition.cs プロジェクト: tvsonar/roslyn
 /// <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,
     IndexerDeclarationSyntax indexer)
 {
     var exprOpt = indexer.GetExpressionBodySyntax();
     return IsInExpressionBody(position, exprOpt, indexer.SemicolonToken);
 }
コード例 #5
0
ファイル: LookupPosition.cs プロジェクト: jkotas/roslyn
 /// <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,
     IndexerDeclarationSyntax indexer)
     => IsInBody(position, default(BlockSyntax), indexer.GetExpressionBodySyntax(), indexer.SemicolonToken);