|Metadata In ArcMap TOC
Illustrates how metadata can be used with datasets in ArcMap. For each layer that is loaded into ArcMap, an element from the layer's metadata is displayed in the Table of Contents next to the layer's name. The user specifies the metadata element that is displayed from a dialog box that is implemented as an ArcMap Command button.
How to use:
Steps for adding a command/tool from a DLL:
Register this sample's dll by compiling the sample or by using Regsvr32.exe.
In the Customize dialog, click on 'Add from file' and select this sample's dll.
Under the Commands tab, select the Metadata In TOC command from the Developer Samples category, and drag it on to a toolbar. Dismiss the Customize dialog.
Click the new 'Metadata in TOC' button. This will open a dialog box - click the 'Yes' option button to enable metadata display in the TOC, and click 'OK' to close the dialog.
Add some data to ArcMap. If the dataset you added has metadata, then you'll see content from the metadata written next to the dataset's name in ArcMap (the default setting is to show the dataset's status). If the dataset has no metadata, then the words <not present> will be shown instead. (If the data format does not support metadata, then nothing is shown for that layer).
Any dataset that has metadata created through ArcCatalog.
||Describes all components of the project in detail.
||Code that implements the ArcMap command button interface.
||The dialog displayed in ArcMap used to control what is shown in the TOC.
||Visual Basic 6 project file.
||Compiled output DLL.
||Global variables and shared code.
||Resource file containing image used for command button icon.
IDataLayer, IMetadata, IPropertySet, IMxDocument, IContentsView
IDataLayer::DataSourceName, IMetadata::Metadata, IPropertySet::GetProperty, IMxDocument::CurrentContentsView