Exemple #1
0
        /// <summary>
        ///		Obtiene el texto de un span
        /// </summary>
        private string GetSpanText(string text, string[] formats, bool isBold, bool isItalic)
        {
            string tagStart = string.Empty, tagEnd = string.Empty;

            // Añade las etiquetas de apertura y cierre necesario
            if (!text.IsEmpty())
            {
                // Formatea el texto
                text = MLBuilder.FormatText(text, formats);
                // Añade las etiquetas de principio y fin si es negrita
                if (isBold)
                {
                    tagStart += "<strong>";
                    tagEnd    = "</strong>" + tagEnd;
                }
                // Añade las etiquetas de principio y fin si es cursiva
                if (isItalic)
                {
                    tagStart += "<em>";
                    tagEnd   += "</em>" + tagEnd;
                }
            }
            // Devuelve el texto
            return(tagStart + text + tagEnd);
        }