コード例 #1
0
		/// <summary>Converts a LanguageString into a Description_Type</summary>
		/// <param name="langString"></param>
		/// <returns></returns>
		public static DescriptionType ToIMDIDescriptionType(this LanguageString langString)
		{
			var desc = new DescriptionType { Value = langString.Value };
			if (!string.IsNullOrEmpty(langString.Iso3LanguageId))
				desc.LanguageId = LanguageList.FindByISO3Code(langString.Iso3LanguageId).Id;

			return desc;
		}
コード例 #2
0
ファイル: IMDIExtensions.cs プロジェクト: vkarthim/libpalaso
        /// <summary>Converts a LanguageString into a Description_Type</summary>
        /// <param name="langString"></param>
        /// <returns></returns>
        public static DescriptionType ToIMDIDescriptionType(this LanguageString langString)
        {
            var desc = new DescriptionType {
                Value = langString.Value
            };

            if (!string.IsNullOrEmpty(langString.Iso3LanguageId))
            {
                desc.LanguageId = LanguageList.FindByISO3Code(langString.Iso3LanguageId).Id;
            }

            return(desc);
        }
コード例 #3
0
        /// <summary>Compare 2 LanguageString objects. They are identical if they have the same Iso3LanguageId</summary>
        public int CompareTo(object obj)
        {
            if (obj == null)
            {
                return(1);
            }

            DescriptionType other = obj as DescriptionType;

            if (other == null)
            {
                throw new ArgumentException();
            }

            return(String.Compare(LanguageId, other.LanguageId, StringComparison.Ordinal));
        }
コード例 #4
0
 /// <summary>Compare 2 LanguageString objects. They are identical if they have the same Iso3LanguageId</summary>
 public static int Compare(DescriptionType langStrA, DescriptionType langStrB)
 {
     return(langStrA.CompareTo(langStrB));
 }