How to use
See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.
- Load a map document into the PageLayoutControl.
- Select a style sheet or type the style sheet's file path.
- Right-click a layer on the TOCControl to show its metadata.
Additional information
A browse dialog box allows you to search and select map documents (*.mxd) that are validated and loaded into the PageLayoutControl using the CheckMxFile and LoadMxFile methods. The ITOCControl.HitTest method is used in the ITOCControlEvents.OnMouseDown event when right-clicked to determine if a layer has been clicked.
If the layer is an IDataLayer, the metadata is retrieved using the IMetadata.Metadata property. The IXmlPropertySet2.SaveAsFile method is used to create a temporary metadata.htm file in the same folder as the sample code. The metadata.htm file contains the metadata XML transformed using the selected style sheet. The Web Browser control is used to show this file.
AssemblyInfo.cs | Assembly information. |
MetadataViewer.cs | Form file. |
AssemblyInfo.vb | Assembly information. |
MetadataViewer.vb | Form file. |
Download the files for all languages
See Also:
TOCControl classITOCControl interface
Development licensing | Deployment licensing |
---|---|
Engine Developer Kit | Engine |
ArcGIS for Desktop Basic | |
ArcGIS for Desktop Standard | |
ArcGIS for Desktop Advanced |