public static string MapBackground(IBackground bg) { if (bg != null) { if (bg.GetType() == typeof(ImageBackground)) { return(((ImageBackground)bg).ImagePath); } if (bg.GetType() == typeof(ColorBackground)) { return(ConvertColor(((ColorBackground)bg).Color).ToString()); } } return(null); }
public Image GetImage(IBackground bg) { if (bg != null) { if (bg.GetType() == typeof(ImageBackground)) { return(GetImage(((ImageBackground)bg).ImagePath)); } if (bg.GetType() == typeof(ColorBackground)) { return(ImageUtils.GetEmptyImage(DefaultImageSize, ((ColorBackground)bg).Color)); } } return(null); }
public Image GetThumb(IBackground bg) { if (bg != null) { if (bg.GetType() == typeof(ImageBackground)) { var img = GetThumbFromRelPath(((ImageBackground)bg).ImagePath); if (img != null) { return(img); } } else if (bg.GetType() == typeof(ColorBackground)) { return(ImageUtils.GetEmptyImage(DefaultThumbSize, ((ColorBackground)bg).Color)); } } return(ImageUtils.GetEmptyImage(DefaultThumbSize, DefaultEmptyColor)); }