Solution4.Projects 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取解决方案中当前项目的集合。
public:
property EnvDTE::Projects ^ Projects { EnvDTE::Projects ^ get(); };
[System.Runtime.InteropServices.DispId(41)]
public EnvDTE.Projects Projects { [System.Runtime.InteropServices.DispId(41)] get; }
[<System.Runtime.InteropServices.DispId(41)>]
[<get: System.Runtime.InteropServices.DispId(41)>]
member this.Projects : EnvDTE.Projects
Public ReadOnly Property Projects As Projects
属性值
一个 Projects 集合。
实现
- 属性
示例
Sub ProjectsExample(ByVal dte As DTE2)
‘ Display the number of projects in a solution.
' Open a solution in Visual Studio before running this example.
Try
Dim soln As Solution4 = CType(_applicationObject.Solution, _
Solution4)
Dim solnName As String = _
System.IO.Path.GetFileNameWithoutExtension(soln.FullName)
MsgBox("Solution " & solnName & _
" has " & soln.Projects.Count.ToString() & " projects")
Catch ex As System.Exception
MsgBox(ex.ToString)
End Try
End Sub
using System.Windows.Forms;
public void ProjectExample(DTE2 dte)
{
// Display the number of projects in a solution.
// Open a solution in Visual Studio before running this example.
try
{
Solution4 soln = (Solution4)_applicationObject.Solution;
string solnName =
System.IO.Path.GetFileNameWithoutExtension(soln.FullName);
MessageBox.Show("Solution " + solnName + "has "
+ soln.Projects.Count.ToString() + " projects.");
}
catch(SystemException ex)
{
MessageBox.Show("ERROR: " + ex);
}
}