public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
        {
            if (destinationType == typeof(string))
            {
                ImageOverlay imageOverlay = value as ImageOverlay;
                if (imageOverlay != null)
                {
                    if (imageOverlay.Image == null)
                    {
                        return("(none)");
                    }
                    else
                    {
                        return("(set)");
                    }
                }
                TextOverlay textOverlay = value as TextOverlay;
                if (textOverlay != null)
                {
                    if (String.IsNullOrEmpty(textOverlay.Text))
                    {
                        return("(none)");
                    }
                    else
                    {
                        return("(set)");
                    }
                }
            }

            return(base.ConvertTo(context, culture, value, destinationType));
        }
Exemple #2
0
 /// <summary>
 /// Initialize the standard image and text overlays
 /// </summary>
 protected virtual void InitializeStandardOverlays()
 {
     OverlayImage = new ImageOverlay();
     AddOverlay(OverlayImage);
     OverlayText = new TextOverlay();
     AddOverlay(OverlayText);
 }