//------------------------------------------------------------------------------
using System;
+using System.Runtime.InteropServices;
+using System.Runtime.Serialization;
namespace System.IO {
[Serializable]
- public abstract class FileSystemInfo : MarshalByRefObject {
+ public abstract class FileSystemInfo : MarshalByRefObject, ISerializable {
+ #region Implementation of ISerializable
+
+ [ComVisible(false)]
+ public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
+ {
+ info.AddValue ("OriginalPath", OriginalPath, typeof(string));
+ info.AddValue ("FullPath", FullPath, typeof(string));
+ }
+
+ #endregion Implementation of ISerializable
+
// public properties
public abstract bool Exists { get; }
value,
out error))
throw MonoIO.GetException (error);
+ Refresh (true);
}
}
if (!MonoIO.SetFileTime (FullName, filetime,
-1, -1, out error))
throw MonoIO.GetException (error);
+ Refresh (true);
}
}
+ [ComVisible(false)]
public DateTime CreationTimeUtc {
get {
return CreationTime.ToUniversalTime ();
filetime, -1,
out error))
throw MonoIO.GetException (error);
+ Refresh (true);
}
}
+ [ComVisible(false)]
public DateTime LastAccessTimeUtc {
get {
Refresh (false);
if (!MonoIO.SetFileTime (FullName, -1, -1,
filetime, out error))
throw MonoIO.GetException (error);
+ Refresh (true);
}
}
+ [ComVisible(false)]
public DateTime LastWriteTimeUtc {
get {
Refresh (false);
this.FullPath = null;
}
+ protected FileSystemInfo (SerializationInfo info, StreamingContext context)
+ {
+ if (info == null)
+ {
+ throw new ArgumentNullException("info");
+ }
+
+ FullPath = info.GetString("FullPath");
+ OriginalPath = info.GetString("OriginalPath");
+ }
+
protected string FullPath;
protected string OriginalPath;
MonoIO.GetFileStat (FullName, out stat, out error);
valid = true;
+
+ InternalRefresh ();
+ }
+
+ internal virtual void InternalRefresh ()
+ {
}
internal void CheckPath (string path)