_Solution.Remove 方法
將指定的專案從方案中移除。
命名空間: EnvDTE
組件: EnvDTE (在 EnvDTE.dll 中)
語法
'宣告
Sub Remove ( _
proj As Project _
)
void Remove(
Project proj
)
void Remove(
[InAttribute] Project^ proj
)
abstract Remove :
proj:Project -> unit
function Remove(
proj : Project
)
參數
- proj
型別:EnvDTE.Project
必要項。要從方案中移除的專案。
範例
Sub RemoveExample()
' This function loads a solution, deletes the first project,
' and then closes the solution.
Dim soln As Solution
Dim proj As Project
Dim msg As String
'Create a reference to the solution.
soln = DTE.Solution
' Open the solution just created.
soln.Open("c:\temp2\newsolution.sln")
' Delete the newly-created VB Console application project in
' this solution.
MsgBox("Ready to delete the project.")
proj = soln.Projects.Item(1)
soln.Remove(proj)
MsgBox("Project was deleted from the solution.")
' Close the solution from the IDE.
soln.Close()
End Sub
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。