Esempio n. 1
0
        /// <summary>
        /// Return a JSON representation of the given internationalized string.
        /// </summary>
        /// <param name="I18NString">An internationalized string.</param>
        /// <param name="JPropertyKey">The name of the JSON property key.</param>
        public static JProperty ToJSON(this I18NString I18NString, String JPropertyKey)
        {
            if (I18NString == null || !I18NString.Any())
            {
                return(null);
            }

            return(new JProperty(JPropertyKey, I18NString.ToJSON()));
        }
Esempio n. 2
0
 /// <summary>
 /// Return the first string of a multi-language string.
 /// </summary>
 public static String FirstText(this I18NString Text)
 => Text != null && Text.Any()
            ? Text.First().Text
            : null;
Esempio n. 3
0
 /// <summary>
 /// The multi-language string is neither null nor empty.
 /// </summary>
 public static Boolean IsNeitherNullNorEmpty(this I18NString Text)
 => Text != null && Text.Any();
Esempio n. 4
0
 /// <summary>
 /// The multi-language string is empty.
 /// </summary>
 public static Boolean IsNullOrEmpty(this I18NString Text)
 => Text == null || !Text.Any();
Esempio n. 5
0
 /// <summary>
 /// The I18N text is not empty.
 /// </summary>
 public static Boolean IsNotNullOrEmpty(this I18NString Text)
 => Text != null && Text.Any();