共用方式為


OperationExtensions.GetVariableInitializer 方法

定義

取得指定 declarationOperation 之 的變數初始化運算式,檢查是否有父初始化運算式,如果單一變數初始化運算式為 null。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::CodeAnalysis::Operations::IVariableInitializerOperation ^ GetVariableInitializer(Microsoft::CodeAnalysis::Operations::IVariableDeclaratorOperation ^ declarationOperation);
public static Microsoft.CodeAnalysis.Operations.IVariableInitializerOperation GetVariableInitializer (this Microsoft.CodeAnalysis.Operations.IVariableDeclaratorOperation declarationOperation);
public static Microsoft.CodeAnalysis.Operations.IVariableInitializerOperation? GetVariableInitializer (this Microsoft.CodeAnalysis.Operations.IVariableDeclaratorOperation declarationOperation);
static member GetVariableInitializer : Microsoft.CodeAnalysis.Operations.IVariableDeclaratorOperation -> Microsoft.CodeAnalysis.Operations.IVariableInitializerOperation
<Extension()>
Public Function GetVariableInitializer (declarationOperation As IVariableDeclaratorOperation) As IVariableInitializerOperation

參數

declarationOperation
IVariableDeclaratorOperation

要擷取初始化運算式的單一變數宣告。

傳回

適用於