I want to build an IDictionary with the feature layers of my TOC in ArcObjects. So I need key value pairs. The value will be an attribute of the feature layer but I am wondering what to use as key. I can use the layer name but there can theoretically be duplicate layer names in the TOC. Any suggestions on how I can get a unique reference to a feature layer?
Background is that I need to store the layers and their querydefinitions in a custom application that runs in desktop and ArcEngine environment. I don't know the layers before. It could be that the user defines layer groups that have sublayers with the same name. This would lead to an error when storing it in the dictionary.