Compartilhar via


CSharpExtensions.TryGetSpeculativeSemanticModel Method

Definition

Overloads

TryGetSpeculativeSemanticModel(SemanticModel, Int32, ArrowExpressionClauseSyntax, SemanticModel)

Get a SemanticModel object that is associated with an expression body that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of an expression body that did not appear in source code.

TryGetSpeculativeSemanticModel(SemanticModel, Int32, AttributeSyntax, SemanticModel)

Get a SemanticModel object that is associated with an attribute that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of an attribute that did not appear in source code.

TryGetSpeculativeSemanticModel(SemanticModel, Int32, ConstructorInitializerSyntax, SemanticModel)

Get a SemanticModel object that is associated with a constructor initializer that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of a constructor initializer that did not appear in source code.

NOTE: This will only work in locations where there is already a constructor initializer.

TryGetSpeculativeSemanticModel(SemanticModel, Int32, CrefSyntax, SemanticModel)

Get a SemanticModel object that is associated with a cref syntax node that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of a cref syntax that did not appear in source code.

TryGetSpeculativeSemanticModel(SemanticModel, Int32, EqualsValueClauseSyntax, SemanticModel)

Get a SemanticModel object that is associated with an initializer that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of a field initializer or default parameter value that did not appear in source code.

TryGetSpeculativeSemanticModel(SemanticModel, Int32, PrimaryConstructorBaseTypeSyntax, SemanticModel)

Get a SemanticModel object that is associated with a constructor initializer that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of a constructor initializer that did not appear in source code.

NOTE: This will only work in locations where there is already a constructor initializer.

TryGetSpeculativeSemanticModel(SemanticModel, Int32, StatementSyntax, SemanticModel)

Get a SemanticModel object that is associated with a statement that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of a statement that did not appear in source code.

TryGetSpeculativeSemanticModel(SemanticModel, Int32, TypeSyntax, SemanticModel, SpeculativeBindingOption)

Get a SemanticModel object that is associated with a type syntax node that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of a type syntax that did not appear in source code.

TryGetSpeculativeSemanticModel(SemanticModel, Int32, ArrowExpressionClauseSyntax, SemanticModel)

Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs

Get a SemanticModel object that is associated with an expression body that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of an expression body that did not appear in source code.

public:
[System::Runtime::CompilerServices::Extension]
 static bool TryGetSpeculativeSemanticModel(Microsoft::CodeAnalysis::SemanticModel ^ semanticModel, int position, Microsoft::CodeAnalysis::CSharp::Syntax::ArrowExpressionClauseSyntax ^ expressionBody, [Runtime::InteropServices::Out] Microsoft::CodeAnalysis::SemanticModel ^ % speculativeModel);
public static bool TryGetSpeculativeSemanticModel (this Microsoft.CodeAnalysis.SemanticModel semanticModel, int position, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody, out Microsoft.CodeAnalysis.SemanticModel speculativeModel);
public static bool TryGetSpeculativeSemanticModel (this Microsoft.CodeAnalysis.SemanticModel? semanticModel, int position, Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax expressionBody, out Microsoft.CodeAnalysis.SemanticModel? speculativeModel);
static member TryGetSpeculativeSemanticModel : Microsoft.CodeAnalysis.SemanticModel * int * Microsoft.CodeAnalysis.CSharp.Syntax.ArrowExpressionClauseSyntax * SemanticModel -> bool
<Extension()>
Public Function TryGetSpeculativeSemanticModel (semanticModel As SemanticModel, position As Integer, expressionBody As ArrowExpressionClauseSyntax, ByRef speculativeModel As SemanticModel) As Boolean

Parameters

semanticModel
SemanticModel
position
Int32
speculativeModel
SemanticModel

Returns

Applies to

TryGetSpeculativeSemanticModel(SemanticModel, Int32, AttributeSyntax, SemanticModel)

Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs

Get a SemanticModel object that is associated with an attribute that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of an attribute that did not appear in source code.

public:
[System::Runtime::CompilerServices::Extension]
 static bool TryGetSpeculativeSemanticModel(Microsoft::CodeAnalysis::SemanticModel ^ semanticModel, int position, Microsoft::CodeAnalysis::CSharp::Syntax::AttributeSyntax ^ attribute, [Runtime::InteropServices::Out] Microsoft::CodeAnalysis::SemanticModel ^ % speculativeModel);
public static bool TryGetSpeculativeSemanticModel (this Microsoft.CodeAnalysis.SemanticModel semanticModel, int position, Microsoft.CodeAnalysis.CSharp.Syntax.AttributeSyntax attribute, out Microsoft.CodeAnalysis.SemanticModel speculativeModel);
public static bool TryGetSpeculativeSemanticModel (this Microsoft.CodeAnalysis.SemanticModel? semanticModel, int position, Microsoft.CodeAnalysis.CSharp.Syntax.AttributeSyntax attribute, out Microsoft.CodeAnalysis.SemanticModel? speculativeModel);
static member TryGetSpeculativeSemanticModel : Microsoft.CodeAnalysis.SemanticModel * int * Microsoft.CodeAnalysis.CSharp.Syntax.AttributeSyntax * SemanticModel -> bool
<Extension()>
Public Function TryGetSpeculativeSemanticModel (semanticModel As SemanticModel, position As Integer, attribute As AttributeSyntax, ByRef speculativeModel As SemanticModel) As Boolean

Parameters

semanticModel
SemanticModel
position
Int32
attribute
AttributeSyntax
speculativeModel
SemanticModel

Returns

Applies to

TryGetSpeculativeSemanticModel(SemanticModel, Int32, ConstructorInitializerSyntax, SemanticModel)

Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs

Get a SemanticModel object that is associated with a constructor initializer that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of a constructor initializer that did not appear in source code.

NOTE: This will only work in locations where there is already a constructor initializer.

public:
[System::Runtime::CompilerServices::Extension]
 static bool TryGetSpeculativeSemanticModel(Microsoft::CodeAnalysis::SemanticModel ^ semanticModel, int position, Microsoft::CodeAnalysis::CSharp::Syntax::ConstructorInitializerSyntax ^ constructorInitializer, [Runtime::InteropServices::Out] Microsoft::CodeAnalysis::SemanticModel ^ % speculativeModel);
public static bool TryGetSpeculativeSemanticModel (this Microsoft.CodeAnalysis.SemanticModel semanticModel, int position, Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorInitializerSyntax constructorInitializer, out Microsoft.CodeAnalysis.SemanticModel speculativeModel);
public static bool TryGetSpeculativeSemanticModel (this Microsoft.CodeAnalysis.SemanticModel? semanticModel, int position, Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorInitializerSyntax constructorInitializer, out Microsoft.CodeAnalysis.SemanticModel? speculativeModel);
static member TryGetSpeculativeSemanticModel : Microsoft.CodeAnalysis.SemanticModel * int * Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorInitializerSyntax * SemanticModel -> bool
<Extension()>
Public Function TryGetSpeculativeSemanticModel (semanticModel As SemanticModel, position As Integer, constructorInitializer As ConstructorInitializerSyntax, ByRef speculativeModel As SemanticModel) As Boolean

Parameters

semanticModel
SemanticModel
position
Int32
constructorInitializer
ConstructorInitializerSyntax
speculativeModel
SemanticModel

Returns

Applies to

TryGetSpeculativeSemanticModel(SemanticModel, Int32, CrefSyntax, SemanticModel)

Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs

Get a SemanticModel object that is associated with a cref syntax node that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of a cref syntax that did not appear in source code.

public:
[System::Runtime::CompilerServices::Extension]
 static bool TryGetSpeculativeSemanticModel(Microsoft::CodeAnalysis::SemanticModel ^ semanticModel, int position, Microsoft::CodeAnalysis::CSharp::Syntax::CrefSyntax ^ crefSyntax, [Runtime::InteropServices::Out] Microsoft::CodeAnalysis::SemanticModel ^ % speculativeModel);
public static bool TryGetSpeculativeSemanticModel (this Microsoft.CodeAnalysis.SemanticModel semanticModel, int position, Microsoft.CodeAnalysis.CSharp.Syntax.CrefSyntax crefSyntax, out Microsoft.CodeAnalysis.SemanticModel speculativeModel);
public static bool TryGetSpeculativeSemanticModel (this Microsoft.CodeAnalysis.SemanticModel? semanticModel, int position, Microsoft.CodeAnalysis.CSharp.Syntax.CrefSyntax crefSyntax, out Microsoft.CodeAnalysis.SemanticModel? speculativeModel);
static member TryGetSpeculativeSemanticModel : Microsoft.CodeAnalysis.SemanticModel * int * Microsoft.CodeAnalysis.CSharp.Syntax.CrefSyntax * SemanticModel -> bool
<Extension()>
Public Function TryGetSpeculativeSemanticModel (semanticModel As SemanticModel, position As Integer, crefSyntax As CrefSyntax, ByRef speculativeModel As SemanticModel) As Boolean

Parameters

semanticModel
SemanticModel
position
Int32
crefSyntax
CrefSyntax
speculativeModel
SemanticModel

Returns

Applies to

TryGetSpeculativeSemanticModel(SemanticModel, Int32, EqualsValueClauseSyntax, SemanticModel)

Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs

Get a SemanticModel object that is associated with an initializer that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of a field initializer or default parameter value that did not appear in source code.

public:
[System::Runtime::CompilerServices::Extension]
 static bool TryGetSpeculativeSemanticModel(Microsoft::CodeAnalysis::SemanticModel ^ semanticModel, int position, Microsoft::CodeAnalysis::CSharp::Syntax::EqualsValueClauseSyntax ^ initializer, [Runtime::InteropServices::Out] Microsoft::CodeAnalysis::SemanticModel ^ % speculativeModel);
public static bool TryGetSpeculativeSemanticModel (this Microsoft.CodeAnalysis.SemanticModel semanticModel, int position, Microsoft.CodeAnalysis.CSharp.Syntax.EqualsValueClauseSyntax initializer, out Microsoft.CodeAnalysis.SemanticModel speculativeModel);
public static bool TryGetSpeculativeSemanticModel (this Microsoft.CodeAnalysis.SemanticModel? semanticModel, int position, Microsoft.CodeAnalysis.CSharp.Syntax.EqualsValueClauseSyntax initializer, out Microsoft.CodeAnalysis.SemanticModel? speculativeModel);
static member TryGetSpeculativeSemanticModel : Microsoft.CodeAnalysis.SemanticModel * int * Microsoft.CodeAnalysis.CSharp.Syntax.EqualsValueClauseSyntax * SemanticModel -> bool
<Extension()>
Public Function TryGetSpeculativeSemanticModel (semanticModel As SemanticModel, position As Integer, initializer As EqualsValueClauseSyntax, ByRef speculativeModel As SemanticModel) As Boolean

Parameters

semanticModel
SemanticModel
position
Int32
speculativeModel
SemanticModel

Returns

Applies to

TryGetSpeculativeSemanticModel(SemanticModel, Int32, PrimaryConstructorBaseTypeSyntax, SemanticModel)

Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs

Get a SemanticModel object that is associated with a constructor initializer that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of a constructor initializer that did not appear in source code.

NOTE: This will only work in locations where there is already a constructor initializer.

public static bool TryGetSpeculativeSemanticModel (this Microsoft.CodeAnalysis.SemanticModel? semanticModel, int position, Microsoft.CodeAnalysis.CSharp.Syntax.PrimaryConstructorBaseTypeSyntax constructorInitializer, out Microsoft.CodeAnalysis.SemanticModel? speculativeModel);
static member TryGetSpeculativeSemanticModel : Microsoft.CodeAnalysis.SemanticModel * int * Microsoft.CodeAnalysis.CSharp.Syntax.PrimaryConstructorBaseTypeSyntax * SemanticModel -> bool
<Extension()>
Public Function TryGetSpeculativeSemanticModel (semanticModel As SemanticModel, position As Integer, constructorInitializer As PrimaryConstructorBaseTypeSyntax, ByRef speculativeModel As SemanticModel) As Boolean

Parameters

semanticModel
SemanticModel
position
Int32
constructorInitializer
PrimaryConstructorBaseTypeSyntax
speculativeModel
SemanticModel

Returns

Applies to

TryGetSpeculativeSemanticModel(SemanticModel, Int32, StatementSyntax, SemanticModel)

Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs

Get a SemanticModel object that is associated with a statement that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of a statement that did not appear in source code.

public:
[System::Runtime::CompilerServices::Extension]
 static bool TryGetSpeculativeSemanticModel(Microsoft::CodeAnalysis::SemanticModel ^ semanticModel, int position, Microsoft::CodeAnalysis::CSharp::Syntax::StatementSyntax ^ statement, [Runtime::InteropServices::Out] Microsoft::CodeAnalysis::SemanticModel ^ % speculativeModel);
public static bool TryGetSpeculativeSemanticModel (this Microsoft.CodeAnalysis.SemanticModel semanticModel, int position, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement, out Microsoft.CodeAnalysis.SemanticModel speculativeModel);
public static bool TryGetSpeculativeSemanticModel (this Microsoft.CodeAnalysis.SemanticModel? semanticModel, int position, Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax statement, out Microsoft.CodeAnalysis.SemanticModel? speculativeModel);
static member TryGetSpeculativeSemanticModel : Microsoft.CodeAnalysis.SemanticModel * int * Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax * SemanticModel -> bool
<Extension()>
Public Function TryGetSpeculativeSemanticModel (semanticModel As SemanticModel, position As Integer, statement As StatementSyntax, ByRef speculativeModel As SemanticModel) As Boolean

Parameters

semanticModel
SemanticModel
position
Int32
statement
StatementSyntax
speculativeModel
SemanticModel

Returns

Applies to

TryGetSpeculativeSemanticModel(SemanticModel, Int32, TypeSyntax, SemanticModel, SpeculativeBindingOption)

Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs
Source:
CSharpExtensions.cs

Get a SemanticModel object that is associated with a type syntax node that did not appear in this source code. This can be used to get detailed semantic information about sub-parts of a type syntax that did not appear in source code.

public static bool TryGetSpeculativeSemanticModel (this Microsoft.CodeAnalysis.SemanticModel semanticModel, int position, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, out Microsoft.CodeAnalysis.SemanticModel speculativeModel, Microsoft.CodeAnalysis.SpeculativeBindingOption bindingOption = Microsoft.CodeAnalysis.SpeculativeBindingOption.BindAsExpression);
public static bool TryGetSpeculativeSemanticModel (this Microsoft.CodeAnalysis.SemanticModel? semanticModel, int position, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, out Microsoft.CodeAnalysis.SemanticModel? speculativeModel, Microsoft.CodeAnalysis.SpeculativeBindingOption bindingOption = Microsoft.CodeAnalysis.SpeculativeBindingOption.BindAsExpression);
static member TryGetSpeculativeSemanticModel : Microsoft.CodeAnalysis.SemanticModel * int * Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax * SemanticModel * Microsoft.CodeAnalysis.SpeculativeBindingOption -> bool
<Extension()>
Public Function TryGetSpeculativeSemanticModel (semanticModel As SemanticModel, position As Integer, type As TypeSyntax, ByRef speculativeModel As SemanticModel, Optional bindingOption As SpeculativeBindingOption = Microsoft.CodeAnalysis.SpeculativeBindingOption.BindAsExpression) As Boolean

Parameters

semanticModel
SemanticModel
position
Int32
type
TypeSyntax
speculativeModel
SemanticModel
bindingOption
SpeculativeBindingOption

Returns

Applies to