SyntaxCheck.cs 992 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // System.ComponentModel.SyntaxCheck.cs
  3. //
  4. // Author:
  5. // Andreas Nahr ([email protected])
  6. //
  7. // (C) 2003 Andreas Nahr
  8. //
  9. using System.IO;
  10. namespace System.ComponentModel
  11. {
  12. // LAMESPEC should be sealed or event internal?
  13. public class SyntaxCheck
  14. {
  15. private SyntaxCheck ()
  16. {
  17. }
  18. [MonoTODO ("Don't know what MS wants to do with this")]
  19. public static bool CheckMachineName (string value)
  20. {
  21. if (value == null || value.Trim ().Length == 0)
  22. return false;
  23. return Environment.MachineName.Equals (value);
  24. }
  25. [MonoTODO ("Don't know what MS wants to do with this")]
  26. public static bool CheckPath (string value)
  27. {
  28. if (value == null || value.Trim ().Length == 0)
  29. return false;
  30. try {
  31. Path.GetFullPath (value);
  32. } catch {
  33. return false;
  34. }
  35. return true;
  36. }
  37. public static bool CheckRootedPath (string value)
  38. {
  39. if (value == null || value.Trim ().Length == 0)
  40. return false;
  41. return Path.IsPathRooted (value);
  42. }
  43. }
  44. }