Workspace.CanApplyCompilationOptionChange 方法

定义

调用期间调用以确定 TryApplyChanges(Solution) 是否允许对特定更改 CompilationOptions 进行调用。

protected virtual bool CanApplyCompilationOptionChange (Microsoft.CodeAnalysis.CompilationOptions oldOptions, Microsoft.CodeAnalysis.CompilationOptions newOptions, Microsoft.CodeAnalysis.Project project);
public virtual bool CanApplyCompilationOptionChange (Microsoft.CodeAnalysis.CompilationOptions oldOptions, Microsoft.CodeAnalysis.CompilationOptions newOptions, Microsoft.CodeAnalysis.Project project);
abstract member CanApplyCompilationOptionChange : Microsoft.CodeAnalysis.CompilationOptions * Microsoft.CodeAnalysis.CompilationOptions * Microsoft.CodeAnalysis.Project -> bool
override this.CanApplyCompilationOptionChange : Microsoft.CodeAnalysis.CompilationOptions * Microsoft.CodeAnalysis.CompilationOptions * Microsoft.CodeAnalysis.Project -> bool
Protected Overridable Function CanApplyCompilationOptionChange (oldOptions As CompilationOptions, newOptions As CompilationOptions, project As Project) As Boolean
Public Overridable Function CanApplyCompilationOptionChange (oldOptions As CompilationOptions, newOptions As CompilationOptions, project As Project) As Boolean

参数

oldOptions
CompilationOptions

更改之前的项目的旧 CompilationOptions 版本。

newOptions
CompilationOptions

传递给TryApplyChanges(Solution)的项目的新CompilationOptions项。

project
Project

传递给TryApplyChanges(Solution)Solution项目中包含的项目。

返回

注解

仅当返回 false for ChangeCompilationOptionsCanApplyChange(ApplyChangesKind),才调用此方法。 如果 CanApplyChange(ApplyChangesKind) 返回 true,则表示允许所有更改,并且不需要调用此方法。

适用于