ApplicationCat = (ESRI.ArcGIS.CatalogUI.IGxApplication)ArcCatalog.Application;
IGxSelection Selected;
IEnumGxObject SelectedObjects;
IGxObject SelectedObject;
//get the selection of the contents window
Selected = ApplicationCat.Selection;
if (Selected.Count > 0)
{
SelectedObjects = Selected.SelectedObjects;
//loop through the selection
while ((SelectedObject = SelectedObjects.Next()) != null)
{
IName ObjectType = Dataset.InternalObjectName;
}