// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Globalization;
namespace Microsoft.AspNet.Localization
{
///
/// Details about the culture for an .
///
public class RequestCulture
{
///
/// Creates a new object has its and
/// properties set to the same value.
///
/// The for the request.
public RequestCulture(CultureInfo culture)
: this(culture, culture)
{
}
///
/// Creates a new object has its and
/// properties set to the same value.
///
/// The culture for the request.
public RequestCulture(string culture)
: this(culture, culture)
{
}
///
/// Creates a new object has 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 has 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)
{
if (culture == null)
{
throw new ArgumentNullException(nameof(culture));
}
if (uiCulture == null)
{
throw new ArgumentNullException(nameof(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; }
}
}