mscorlib(4.0.0.0) API with additions
SyntaxCheck.cs
1 using System.IO;
3 
4 namespace System.ComponentModel
5 {
7  [HostProtection(SecurityAction.LinkDemand, SharedState = true)]
8  public static class SyntaxCheck
9  {
14  public static bool CheckMachineName(string value)
15  {
16  if (value == null)
17  {
18  return false;
19  }
20  value = value.Trim();
21  if (value.Equals(string.Empty))
22  {
23  return false;
24  }
25  return value.IndexOf('\\') == -1;
26  }
27 
32  public static bool CheckPath(string value)
33  {
34  if (value == null)
35  {
36  return false;
37  }
38  value = value.Trim();
39  if (value.Equals(string.Empty))
40  {
41  return false;
42  }
43  return value.StartsWith("\\\\");
44  }
45 
50  public static bool CheckRootedPath(string value)
51  {
52  if (value == null)
53  {
54  return false;
55  }
56  value = value.Trim();
57  if (value.Equals(string.Empty))
58  {
59  return false;
60  }
61  return Path.IsPathRooted(value);
62  }
63  }
64 }
Definition: __Canon.cs:3
static bool CheckPath(string value)
Checks the syntax of the path to see whether it starts with "\\".
Definition: SyntaxCheck.cs:32
SecurityAction
Specifies the security actions that can be performed using declarative security.
static bool CheckRootedPath(string value)
Checks the syntax of the path to see if it starts with "\" or drive letter "C:".
Definition: SyntaxCheck.cs:50
static bool CheckMachineName(string value)
Checks the syntax of the machine name to confirm that it does not contain "\".
Definition: SyntaxCheck.cs:14
static bool IsPathRooted(string path)
Gets a value indicating whether the specified path string contains a root.
Definition: Path.cs:1084
Performs operations on T:System.String instances that contain file or directory path information....
Definition: Path.cs:13
Provides methods to verify the machine name and path conform to a specific syntax....
Definition: SyntaxCheck.cs:8