2
0

FileSystemInfo.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. //------------------------------------------------------------------------------
  2. //
  3. // System.IO.FileSystemInfo.cs
  4. //
  5. // Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
  6. //
  7. // Author: Jim Richardson, [email protected]
  8. // Created: Monday, August 13, 2001
  9. //
  10. //------------------------------------------------------------------------------
  11. using System;
  12. namespace System.IO
  13. {
  14. /// <summary>
  15. ///
  16. /// </summary>
  17. public abstract class FileSystemInfo : MarshalByRefObject
  18. {
  19. private FileAttributes itsAttributes;
  20. private DateTime itsCreated;
  21. private DateTime itsLastAccess;
  22. private DateTime itsLastWrite;
  23. //private string itsFullName;
  24. protected string FullPath;
  25. protected string OriginalPath;
  26. public FileSystemInfo()
  27. {
  28. //
  29. // TODO: Add constructor logic here
  30. //
  31. }
  32. public FileAttributes Attributes
  33. {
  34. get
  35. {
  36. return itsAttributes;
  37. }
  38. set
  39. {
  40. itsAttributes = value;
  41. }
  42. }
  43. public DateTime CreationTime
  44. {
  45. get
  46. {
  47. return itsCreated;
  48. }
  49. set
  50. {
  51. itsCreated = value;
  52. }
  53. }
  54. public abstract bool Exists {get;}
  55. public abstract string Name {get;}
  56. public abstract void Delete();
  57. /// <summary>
  58. /// Get the extension of this item
  59. /// </summary>
  60. public string Extension
  61. {
  62. get
  63. {
  64. return Path.GetExtension(FullPath);
  65. }
  66. }
  67. public string FullName
  68. {
  69. get
  70. {
  71. return FullPath;
  72. }
  73. }
  74. public DateTime LastAccessTime
  75. {
  76. get
  77. {
  78. return itsLastAccess;
  79. }
  80. }
  81. public DateTime LastWriteTime
  82. {
  83. get
  84. {
  85. return itsLastWrite;
  86. }
  87. }
  88. public override int GetHashCode()
  89. {
  90. return FullPath.GetHashCode();
  91. }
  92. public override bool Equals(object obj)
  93. {
  94. return false;
  95. }
  96. new public static bool Equals(object obj1, object obj2)
  97. {
  98. return false;
  99. }
  100. public void Refresh()
  101. {
  102. }
  103. /* TODO: determine if we need these
  104. public override ObjRef CreateObjRef(Type requestedType)
  105. {
  106. return null;
  107. }
  108. /*public object GetLifeTimeService ()
  109. {
  110. return null;
  111. }
  112. public override object InitializeLifeTimeService ()
  113. {
  114. return null;
  115. }
  116. */
  117. }
  118. }