-
Notifications
You must be signed in to change notification settings - Fork 9
/
WindowsCollection.xml
69 lines (65 loc) · 4.48 KB
/
WindowsCollection.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<Type Name="WindowsCollection" FullName="Microsoft.Office.Interop.InfoPath.SemiTrust.WindowsCollection">
<TypeSignature Language="C#" Value="public interface WindowsCollection : Microsoft.Office.Interop.InfoPath.SemiTrust.Windows" />
<TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract WindowsCollection implements class Microsoft.Office.Interop.InfoPath.SemiTrust.Windows" />
<TypeSignature Language="DocId" Value="T:Microsoft.Office.Interop.InfoPath.SemiTrust.WindowsCollection" />
<TypeSignature Language="VB.NET" Value="Public Interface WindowsCollection
Implements Windows" />
<TypeSignature Language="C++ CLI" Value="public interface class WindowsCollection : Microsoft::Office::Interop::InfoPath::SemiTrust::Windows" />
<TypeSignature Language="F#" Value="type WindowsCollection = interface
 interface Windows" />
<AssemblyInfo>
<AssemblyName>Microsoft.Office.Interop.InfoPath.SemiTrust</AssemblyName>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Interfaces>
<Interface>
<InterfaceName>Microsoft.Office.Interop.InfoPath.SemiTrust.Windows</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.CoClass(typeof(Microsoft.Office.Interop.InfoPath.SemiTrust.WindowsCollectionWrapper))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.InteropServices.Guid("096cd58b-0786-11d1-95fa-0080c78ee3bb")</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Contains a <see cref="T:Microsoft.Office.Interop.InfoPath.SemiTrust.WindowObject" /> object for each Microsoft InfoPath window that is currently open.</summary>
<remarks>
<para>This type is a wrapper for a coclass that is required by managed code for COM interoperability. Use this type to access the members of the COM interface implemented by this coclass. For information about the COM interface, including a link to descriptions of its members, see<see cref="T:Microsoft.Office.Interop.InfoPath.SemiTrust.Windows" />.</para>
<para>
<b>WindowObject</b> objects represent the two types of windows that are used in the InfoPath application: the editing window that is used as the form area when a user fills out a form, and the designing window that is used as the design mode when a user designs a form.</para>
<para>The <b>WindowsCollection</b> collection implements properties that can be used to access a form's associated Window objects, and it is accessible through the <see cref="P:Microsoft.Office.Interop.InfoPath.SemiTrust._Application2.Windows" /> property of the <see cref="T:Microsoft.Office.Interop.InfoPath.SemiTrust.Application" /> object.</para>
<para>
<b>Note</b>: The <b>WindowsCollection</b> collection can be used only to get the count of <b>WindowObject</b> objects that it contains or to return a reference to a specified <b>WindowObject</b> object. It cannot be used to create, add, or remove <b>WindowObject</b> objects.</para>
<para />
</remarks>
<example>
<para>In the following example, implemented as an <see cref="E:Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_Event.OnClick" /> event handler for a button on a form, the <see cref="P:Microsoft.Office.Interop.InfoPath.SemiTrust._Application2.Windows" /> property of the <see cref="T:Microsoft.Office.Interop.InfoPath.SemiTrust.Application" /> object is used to set a reference to the <b>WindowsCollection</b> collection. The code then loops through the collection and displays the type of each Window object that it contains.</para>
<code>[InfoPathEventHandler(MatchPath="ShowWindowTypes", EventType=InfoPathEventType.OnClick)]
public void ShowWindowTypes_OnClick(DocActionEvent e)
{
// Set a reference to the Windows collection.
<span class="label">WindowsCollection</span> windows = thisApplication.Windows;
// Loop through the collection and display the type
// of each Window object that it contains.
for (int i=0; i &lt; windows.Count; i++)
{
string windowType = "";
switch (windows[i].WindowType)
{
case XdWindowType.xdEditorWindow:
windowType = "Editing window";
break;
case XdWindowType.xdDesignerWindow:
windowType = "Designing window";
break;
}
thisXDocument.UI.Alert("Window type " + i + ": " + windowType);
}
}
</code>
<para>For code examples, see How to: Work with Form Windows Using the InfoPath 2003 Object Model.</para>
</example>
</Docs>
<Members />
</Type>