ComponentFactory.Krypton.Navigator.KryptonPage.GetTextMapping C# (CSharp) Метод

GetTextMapping() публичный Метод

Gets the string that matches the mapping request.
public GetTextMapping ( MapKryptonPageText mapping ) : string
mapping MapKryptonPageText Text mapping.
Результат string
        public virtual string GetTextMapping(MapKryptonPageText mapping)
        {
            string ret = string.Empty;

            // Recover the first preference value
            switch (mapping)
            {
                case MapKryptonPageText.Text:
                case MapKryptonPageText.TextTitle:
                case MapKryptonPageText.TextTitleDescription:
                case MapKryptonPageText.TextDescription:
                    ret = Text;
                    break;
                case MapKryptonPageText.Title:
                case MapKryptonPageText.TitleDescription:
                case MapKryptonPageText.TitleText:
                    ret = TextTitle;
                    break;
                case MapKryptonPageText.Description:
                case MapKryptonPageText.DescriptionText:
                case MapKryptonPageText.DescriptionTitle:
                case MapKryptonPageText.DescriptionTitleText:
                    ret = TextDescription;
                    break;
                case MapKryptonPageText.ToolTipTitle:
                    ret = ToolTipTitle;
                    break;
                case MapKryptonPageText.ToolTipBody:
                    ret = ToolTipBody;
                    break;
            }

            // If nothing found then...
            if (string.IsNullOrEmpty(ret))
            {
                // Recover the second preference value
                switch (mapping)
                {
                    case MapKryptonPageText.TitleText:
                    case MapKryptonPageText.DescriptionText:
                        ret = Text;
                        break;
                    case MapKryptonPageText.TextTitle:
                    case MapKryptonPageText.TextTitleDescription:
                    case MapKryptonPageText.DescriptionTitle:
                    case MapKryptonPageText.DescriptionTitleText:
                        ret = TextTitle;
                        break;
                    case MapKryptonPageText.TextDescription:
                    case MapKryptonPageText.TitleDescription:
                        ret = TextDescription;
                        break;
                }
            }

            // If nothing found then...
            if (string.IsNullOrEmpty(ret))
            {
                // Recover the third preference value
                switch (mapping)
                {
                    case MapKryptonPageText.DescriptionTitleText:
                        ret = Text;
                        break;
                    case MapKryptonPageText.TextTitleDescription:
                        ret = TextDescription;
                        break;
                }
            }

            // We do not want to return a null
            if (ret == null)
                ret = string.Empty;

            return ret;
        }