Workspace.CanApplyCompilationOptionChange 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
调用期间调用以确定 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
- project
- Project
传递给TryApplyChanges(Solution)的Solution项目中包含的项目。
返回
注解
仅当返回 false for ChangeCompilationOptions时CanApplyChange(ApplyChangesKind),才调用此方法。 如果 CanApplyChange(ApplyChangesKind) 返回 true,则表示允许所有更改,并且不需要调用此方法。