ViewInfosCollection 接口

定义

包含 ViewInfoObject Microsoft InfoPath 表单中每个视图的 对象。

public interface class ViewInfosCollection : Microsoft::Office::Interop::InfoPath::SemiTrust::ViewInfos
[System.Runtime.InteropServices.Guid("096cd601-0786-11d1-95fa-0080c78ee3bb")]
public interface ViewInfosCollection : Microsoft.Office.Interop.InfoPath.SemiTrust.ViewInfos
type ViewInfosCollection = interface
    interface ViewInfos
Public Interface ViewInfosCollection
Implements ViewInfos
属性
实现

示例

在以下示例(实现为表单上按钮的 OnClick 事件处理程序)中,XDocument 对象的 ViewInfos 属性用于设置对 ViewInfos 集合的引用。 然后代码循环遍历该集合并显示其中所包含的每个 ViewInfo 对象的位置索引和名称。

[InfoPathEventHandler(MatchPath="ShowViewNames", EventType=InfoPathEventType.OnClick)]
public void ShowViewNames_OnClick(DocActionEvent e)
{
 // Set a reference to the ViewInfos collection.
 ViewInfos viewInfos= thisXDocument.<span class="label">ViewInfos</span>;

 // Loop through the collection and display the name
 // of each ViewInfo object that it contains.
 for (int i=0; i &lt; viewInfos.Count; i++)
 {
  thisXDocument.UI.Alert("View name " + i + ": " + 
   viewInfos[i].Name);
 }
}

注解

此类型是用于 Coclass(托管代码需要此 Coclass 来实现 COM 互操作性)的包装。 使用此类型来访问由此 Coclass 实现的 COM 接口。 有关 COM 接口的信息(包括指向其成员说明的链接),请参阅ViewInfos

ViewInfosCollection 集合实现可用于访问表单关联的 ViewInfoObject 对象的属性,并且可通过 ViewInfos 对象的 属性访问该XDocument对象。

ViewInfosCollection 集合只能用于获取该集合所包含的 ViewInfoObject 对象的数目,或返回对指定 ViewInfoObject 对象的引用。 不能用于创建、添加或删除 ViewInfoObject 对象。

属性

Count

获取集合中包含的对象数 ViewInfoObjectViewInfosCollection 计数。

(继承自 ViewInfos)
Item[Object]

从集合中ViewInfosCollection获取指定的 ViewInfoObject 对象。

(继承自 ViewInfos)

方法

GetEnumerator()

获取一个循环访问对象中所有条目的 ViewInfosCollectionIEnumerator

(继承自 ViewInfos)

适用于