共用方式為


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 中包含的專案。

傳回

備註

只有在 針對 ChangeCompilationOptions 傳回 false 時 CanApplyChange(ApplyChangesKind) ,才會呼叫這個方法。 如果 CanApplyChange(ApplyChangesKind) 傳回 true,則表示允許所有變更,而且不需要呼叫這個方法。

適用於