Documents.Parent 属性

获取 Documents 集合的直接父对象。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
ReadOnly Property Parent As DTE
    Get
DTE Parent { get; }
property DTE^ Parent {
    DTE^ get ();
}
abstract Parent : DTE
function get Parent () : DTE

属性值

类型:EnvDTE.DTE
一个 DTE 对象。

备注

Parent 属性返回对象或集合的直接父对象或父集合。

示例

public void Example(DTE2 dte)
{
   try
   {
      // Run this code after opening a project with at least one document.
      Documents docs;

      // Return the documents collection in the current application instance.
      docs = dte.Documents;

      // Show the number of open documents in the current application.
      MessageBox.Show(docs.Count.ToString());

      // Show the parent object of the current docs collection.
      MessageBox.Show(docs.Parent.FullName);
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.Message);
   }
}

.NET Framework 安全性

请参见

参考

Documents 接口

EnvDTE 命名空间

其他资源

如何:编译和运行自动化对象模型代码示例