ComponentFactory.Krypton.Navigator.KryptonPage.GetImageMapping C# (CSharp) Method

GetImageMapping() public method

Gets the image that matches the mapping request.
public GetImageMapping ( MapKryptonPageImage mapping ) : Image
mapping MapKryptonPageImage Image mapping.
return Image
        public virtual Image GetImageMapping(MapKryptonPageImage mapping)
        {
            Image ret = null;

            // Recover the first preference value
            switch (mapping)
            {
                case MapKryptonPageImage.Small:
                case MapKryptonPageImage.SmallMedium:
                case MapKryptonPageImage.SmallMediumLarge:
                    ret = ImageSmall;
                    break;
                case MapKryptonPageImage.Medium:
                case MapKryptonPageImage.MediumLarge:
                case MapKryptonPageImage.MediumSmall:
                    ret = ImageMedium;
                    break;
                case MapKryptonPageImage.Large:
                case MapKryptonPageImage.LargeMedium:
                case MapKryptonPageImage.LargeMediumSmall:
                    ret = ImageLarge;
                    break;
                case MapKryptonPageImage.ToolTip:
                    ret = ToolTipImage;
                    break;
            }

            // If nothing found then...
            if (ret == null)
            {
                // Recover the second preference value
                switch (mapping)
                {
                    case MapKryptonPageImage.MediumSmall:
                        ret = ImageSmall;
                        break;
                    case MapKryptonPageImage.SmallMedium:
                    case MapKryptonPageImage.SmallMediumLarge:
                    case MapKryptonPageImage.LargeMedium:
                    case MapKryptonPageImage.LargeMediumSmall:
                        ret = ImageMedium;
                        break;
                    case MapKryptonPageImage.MediumLarge:
                        ret = ImageLarge;
                        break;
                }
            }

            // If nothing found then...
            if (ret == null)
            {
                // Recover the third preference value
                switch (mapping)
                {
                    case MapKryptonPageImage.LargeMediumSmall:
                        ret = ImageSmall;
                        break;
                    case MapKryptonPageImage.SmallMediumLarge:
                        ret = ImageLarge;
                        break;
                }
            }

            return ret;
        }