I am using ArcObjects in ArcMap to select a Bing aerial layer in the Table of Contents of ArcMap. I want to find out information about the service, such as the service name and URL. But I am having trouble figuring out what interface the Bing aerial service implements. Here is what I have so far:
pLayer = (ILayer)mxDoc.SelectedItem; // Get the selected layer from the ArcMap TOC
IBasemapLayer bmLayer = (IBasemapLayer)pLayer;
ICompositeLayer bmCompositeLayer = (ICompositeLayer)bmLayer;
IBasemapSubLayer bmSubLayer = (IBasemapSubLayer)bmCompositeLayer.get_Layer(0);
ILayer innerLayer = bmSubLayer.Layer;
But once I get to the actual inner layer of the Bing aerial service, I can't figure out what other interface this implements that might have information such as the URL or service name. So I basically have two questions: 1. What interface does the Bing aerial service implement that might provide useful information about that service, and 2. Is there an easier way of figuring out what interfaces a layer implements rather than a bunch of "If" statements asking: Is it this interface? No. Is it this? No. Is it this? No. It was a real guessing game just getting the few lines of code above. Thanks.