using System.Globalization;
using System;
namespace Oqtane.Models
{
///
/// Culture information describing a Culture
///
public class RequestCulture
{
///
/// Creates a new object with its and
/// properties set to the same value.
///
/// The for the request.
public RequestCulture(CultureInfo culture)
: this(culture, culture)
{
}
///
/// Creates a new object with its and
/// properties set to the same value.
///
/// The culture for the request.
public RequestCulture(string culture)
: this(culture, culture)
{
}
///
/// Creates a new object with its and
/// properties set to the respective values provided.
///
/// The culture for the request to be used for formatting.
/// The culture for the request to be used for text, i.e. language.
public RequestCulture(string culture, string uiCulture)
: this(new CultureInfo(culture), new CultureInfo(uiCulture))
{
}
///
/// Creates a new object with its and
/// properties set to the respective values provided.
///
/// The for the request to be used for formatting.
/// The for the request to be used for text, i.e. language.
public RequestCulture(CultureInfo culture, CultureInfo uiCulture)
{
ArgumentNullException.ThrowIfNull(culture);
ArgumentNullException.ThrowIfNull(uiCulture);
Culture = culture;
UICulture = uiCulture;
}
///
/// Gets the for the request to be used for formatting.
///
public CultureInfo Culture { get; }
///
/// Gets the for the request to be used for text, i.e. language;
///
public CultureInfo UICulture { get; }
}
}