forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNullString.cs
More file actions
51 lines (41 loc) · 1.32 KB
/
Copy pathNullString.cs
File metadata and controls
51 lines (41 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
using System;
namespace System.Management.Automation.Language
{
/// <summary>
/// This type is introduced to provide a way to pass null into a .NET method that has a string parameter
/// </summary>
public class NullString
{
#region private_members
// Private member for instance.
private static readonly NullString _value = new NullString();
#endregion private_members
#region public_property
/// <summary>
/// This overrides ToString() method and returns null.
/// </summary>
public override string ToString()
{
return null;
}
/// <summary>
/// This returns the singleton instance of NullString
/// </summary>
public static NullString Value
{
get { return _value; }
}
#endregion public_property
#region private Constructor
/// <summary>
/// This is a private constructor, meaning no outsiders have access.
/// </summary>
private NullString()
{
}
#endregion private Constructor
}
}