//---------------------------------------------------------------------
        private string GetImageKey(
            MonitoringClass monitoringClass
            )
        {
            ReadOnlyCollection <MonitoringImageReference> imageRefs;

            if (m_classIdToMonitoringImageReferences.ContainsKey(monitoringClass.Id))
            {
                imageRefs = m_classIdToMonitoringImageReferences[monitoringClass.Id];
            }
            else
            {
                imageRefs = monitoringClass.GetMonitoringImageReferences();
                m_classIdToMonitoringImageReferences.Add(monitoringClass.Id, imageRefs);
            }

            string imageKey = string.Empty;

            foreach (ManagementPackImageReference imageRef in imageRefs)
            {
                MonitoringImageObject imageObj;

                if (m_imageIdToImageMap.ContainsKey(imageRef.ImageID.Id))
                {
                    imageObj = m_imageIdToImageMap[imageRef.ImageID.Id];
                }
                else
                {
                    imageObj = m_managementGroup.GetMonitoringImageObject(imageRef.ImageID.Id);
                    m_imageIdToImageMap.Add(imageRef.ImageID.Id, imageObj);
                }

                Bitmap classImage = new Bitmap(imageObj.ImageData);

                if (classImage.Height == 16 && classImage.Width == 16)
                {
                    imageKey = imageRef.ImageID.Id.ToString();
                    break;
                }
            }

            if (imageKey == string.Empty)
            {
                if (monitoringClass.Base == null)
                {
                    return(imageKey);
                }

                MonitoringClass parentMonitoringClass = m_managementGroup.GetMonitoringClass(monitoringClass.Base.Id);

                imageKey = GetImageKey(parentMonitoringClass);
            }

            return(imageKey);
        }