Esempio n. 1
0
 /// <summary>
 /// Create the LanguageTag instance
 /// </summary>
 /// <param name="lang">primary language</param>
 /// <param name="variants">enumarate of variant subtags</param>
 /// <param name="extSubtags">enumarate of extensions subtags</param>
 public LanguageTag(Language lang, IEnumerable <Variant> variants, IEnumerable <ExtensionSubtag> extSubtags)
     : this()
 {
     Language   = lang;
     Variants   = VariantCollection.Create(Language, Script, variants);
     Extensions = new ExtensionSubtagCollection(extSubtags);
 }
Esempio n. 2
0
        public void VariantCollectionCreate(string tagText)
        {
            var tag      = new LanguageTag(tagText);
            var variants = VariantCollection.Create(tag.Language, tag.Script, tag.Variants);

            Assert.That(variants, Is.EqualTo(tag.Variants));
        }
Esempio n. 3
0
 /// <summary>
 /// Create the LanguageTag instance
 /// </summary>
 /// <param name="lang">primary language</param>
 /// <param name="variants">enumarate of variant subtags</param>
 /// <param name="privateUseSubtags">private use subtag</param>
 public LanguageTag(Language lang, IEnumerable <Variant> variants, PrivateUseSubtags privateUseSubtags)
     : this()
 {
     Language   = lang;
     Variants   = VariantCollection.Create(Language, Script, variants);
     PrivateUse = privateUseSubtags;
 }
Esempio n. 4
0
 /// <summary>
 /// Create the LanguageTag instance
 /// </summary>
 /// <param name="lang">primary language</param>
 /// <param name="script">script subtag</param>
 /// <param name="variants">enumarate of variant subtags</param>
 public LanguageTag(Language lang, Script?script, IEnumerable <Variant> variants)
     : this()
 {
     Language = lang;
     Script   = script;
     Variants = VariantCollection.Create(Language, Script, variants);
 }
Esempio n. 5
0
 /// <summary>
 /// Create the LanguageTag instance
 /// </summary>
 /// <param name="lang">primary language</param>
 /// <param name="region">region subtag</param>
 /// <param name="variants">enumarate of variant subtags</param>
 public LanguageTag(Language lang, Region?region, IEnumerable <Variant> variants)
     : this()
 {
     Language = lang;
     Region   = region;
     Variants = VariantCollection.Create(Language, Script, variants);
 }
Esempio n. 6
0
 public void VariantCollectionCreate(string tagText, Variant appendVariant)
 {
     Assert.Throws <FormatException>(() =>
     {
         var tag = new LanguageTag(tagText);
         VariantCollection.Create(tag.Language, tag.Script, tag.Variants.Union(new Variant[] { appendVariant }));
     });
 }
Esempio n. 7
0
 /// <summary>
 /// Create the LanguageTag instance
 /// </summary>
 /// <param name="lang">primary language</param>
 /// <param name="script">script subtag</param>
 /// <param name="region">region subtag</param>
 /// <param name="variants">enumarate of variant subtags</param>
 /// <param name="privateUseSubtags">private use subtag</param>
 public LanguageTag(Language lang, Script?script, Region?region, IEnumerable <Variant> variants, PrivateUseSubtags privateUseSubtags)
     : this()
 {
     Language   = lang;
     Script     = script;
     Region     = region;
     Variants   = VariantCollection.Create(Language, Script, variants);
     PrivateUse = privateUseSubtags;
 }
Esempio n. 8
0
 /// <summary>
 /// Create the LanguageTag instance
 /// </summary>
 /// <param name="lang">primary language</param>
 /// <param name="script">script subtag</param>
 /// <param name="variants">enumarate of variant subtags</param>
 /// <param name="extSubtags">enumarate of extensions subtags</param>
 /// <param name="privateUseSubtags">private use subtag</param>
 public LanguageTag(Language lang, Script?script, IEnumerable <Variant> variants, IEnumerable <ExtensionSubtag> extSubtags, PrivateUseSubtags privateUseSubtags)
     : this()
 {
     Language   = lang;
     Script     = script;
     Variants   = VariantCollection.Create(Language, Script, variants);
     Extensions = new ExtensionSubtagCollection(extSubtags);
     PrivateUse = privateUseSubtags;
 }