Files
PowerShell/src/System.Management.Automation/engine/CultureVariable.cs
T
PowerShell Team 60b3b304f2 Move files from psl-monad submodule to super-project
This commit uses psl-monad branch source-depot 7209cb9
And corresponds to [SD:688741]
2016-03-30 17:16:23 -07:00

66 lines
1.9 KiB
C#

/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
using System;
using System.Management.Automation.Runspaces;
namespace System.Management.Automation
{
/// <summary>
/// A variable that represents $PSCulture
/// </summary>
internal class PSCultureVariable : PSVariable
{
/// <summary>
/// Constructs an instance of the variable.
/// </summary>
internal PSCultureVariable()
: base(SpecialVariables.PSCulture, true, ScopedItemOptions.ReadOnly | ScopedItemOptions.AllScope,
RunspaceInit.DollarPSCultureDescription)
{
}
/// <summary>
/// Gets or sets the value of the variable.
/// </summary>
///
public override object Value
{
get
{
DebuggerCheckVariableRead();
return System.Globalization.CultureInfo.CurrentCulture.Name;
}
}
}
/// <summary>
/// A variable that represents $PSUICulture
/// </summary>
internal class PSUICultureVariable : PSVariable
{
/// <summary>
/// Constructs an instance of the variable.
/// </summary>
internal PSUICultureVariable()
: base(SpecialVariables.PSUICulture, true, ScopedItemOptions.ReadOnly | ScopedItemOptions.AllScope,
RunspaceInit.DollarPSUICultureDescription)
{
}
/// <summary>
/// Gets or sets the value of the variable.
/// </summary>
///
public override object Value
{
get
{
DebuggerCheckVariableRead();
return System.Globalization.CultureInfo.CurrentUICulture.Name;
}
}
}
}