// --------------------------------------------------------------------------------------------------------------------
//
// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
//
//
// Represents a language.
//
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.Interop.Interop.Model
{
///
/// Represents a language.
///
public class Language
{
///
/// Initializes a new instance of the class.
///
///
/// The english name.
///
///
/// The native name.
///
///
/// The code.
///
public Language(string englishName, string nativeName, string code)
{
this.EnglishName = englishName;
this.NativeName = nativeName;
this.Code = code;
}
///
/// Gets the english name of the language.
///
public string EnglishName { get; private set; }
///
/// Gets the native name of the language.
///
public string NativeName { get; private set; }
///
/// Gets the language code.
///
public string Code { get; private set; }
///
/// Gets the display string for the language.
///
public string Display
{
get
{
if (!string.IsNullOrEmpty(this.NativeName) && this.NativeName != this.EnglishName)
{
return this.EnglishName + " (" + this.NativeName + ")";
}
return this.EnglishName;
}
}
///
/// Gets the string representation of the language.
///
/// The string representation of the language.
public override string ToString()
{
return this.Display;
}
}
}