The ViewInfos collection contains a ViewInfo object for each view in the current solution. This object provides descriptive information about each view. The ViewInfos collection contains the properties shown in Table A.16.
| Name | Security Level | Description |
|---|---|---|
| Count Property | 1 | A read-only property that contains a total count of the current number of ViewInfo objects |
| Item Property | 1 | A read-only property that returns a reference to the specified ViewInfo object from the collection |
| Note | This collection cannot be used to create, add, or remove ViewInfo objects. |
Listing A.4 loops through all the current views within a solution file and displays their names .
| |
// Set a reference to the ViewInfos collection. var objViewInfos = XDocument.ViewInfos; // Loop through the collection and display the namefor (i=0; i < objViewInfos.Count; i++) { XDocument.UI.Alert("View name: " + objViewInfos(i).Name); } | |