示例#1
0
 /// <summary>
 /// Create a JSON representation of the given internationalized string.
 /// </summary>
 /// <param name="JPropertyKey">The name of the JSON property key.</param>
 /// <param name="I18N">An internationalized string.</param>
 public static JProperty ToJSON(String JPropertyKey, I18NString I18N)
 {
     if (I18N.Any())
         return new JProperty(JPropertyKey, JSONHelper.ToJSON(I18N));
     else
         return null;
 }
示例#2
0
        /// <summary>
        /// Create 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()));
        }
示例#3
0
        /// <summary>
        /// Create a JSON representation of the given internationalized string.
        /// </summary>
        /// <param name="I18NString">An internationalized string.</param>
        public static JObject ToJSON(this I18NString I18NString)
        {
            if (I18NString == null || !I18NString.Any())
            {
                return(new JObject());
            }

            return(new JObject(I18NString.SafeSelect(i18n => new JProperty(i18n.Language.ToString(), i18n.Text))));
        }
示例#4
0
 /// <summary>
 /// Create a JSON representation of the given internationalized string.
 /// </summary>
 /// <param name="JPropertyKey">The name of the JSON property key.</param>
 /// <param name="I18N">An internationalized string.</param>
 public static JProperty ToJSON(String JPropertyKey, I18NString I18N)
 {
     if (I18N.Any())
     {
         return(new JProperty(JPropertyKey, JSONHelper.ToJSON(I18N)));
     }
     else
     {
         return(null);
     }
 }
示例#5
0
        /// <summary>
        /// Create a new brand having the given brand identification.
        /// </summary>
        /// <param name="Id">The unique identification of this brand.</param>
        /// <param name="Name">The multi-language brand name.</param>
        /// <param name="Logo">The logo of this brand.</param>
        /// <param name="Homepage">The homepage of this brand.</param>
        public Brand(Brand_Id Id,
                     I18NString Name,
                     String Logo     = null,
                     String Homepage = null)

            : base(Id)

        {
            #region Initial checks

            if (Name == null || !Name.Any())
            {
                throw new ArgumentNullException("Name", "The given brand name must not be null or empty!");
            }

            #endregion

            this._Name     = Name;
            this._LogoURI  = Logo;
            this._Homepage = Homepage;
        }