2018-02-13 09:23:53 -08:00
|
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
// Licensed under the MIT License.
|
2016-07-29 13:02:49 -07:00
|
|
|
|
2016-03-30 14:20:52 -07:00
|
|
|
namespace System.Management.Automation.Language
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2019-01-06 04:40:24 +05:00
|
|
|
/// This type is introduced to provide a way to pass null into a .NET method that has a string parameter.
|
2016-03-30 14:20:52 -07:00
|
|
|
/// </summary>
|
|
|
|
|
public class NullString
|
|
|
|
|
{
|
|
|
|
|
#region private_members
|
|
|
|
|
|
|
|
|
|
// Private member for instance.
|
|
|
|
|
|
|
|
|
|
#endregion private_members
|
|
|
|
|
|
|
|
|
|
#region public_property
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-01-16 13:31:14 -08:00
|
|
|
/// This overrides ToString() method and returns null.
|
2016-03-30 14:20:52 -07:00
|
|
|
/// </summary>
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2019-01-06 04:40:24 +05:00
|
|
|
/// This returns the singleton instance of NullString.
|
2016-03-30 14:20:52 -07:00
|
|
|
/// </summary>
|
2016-08-02 13:29:09 -07:00
|
|
|
public static NullString Value { get; } = new NullString();
|
2016-03-30 14:20:52 -07:00
|
|
|
|
|
|
|
|
#endregion public_property
|
|
|
|
|
|
|
|
|
|
#region private Constructor
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This is a private constructor, meaning no outsiders have access.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private NullString()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion private Constructor
|
|
|
|
|
}
|
|
|
|
|
}
|