2007-04-24 Marek Habersack <mhabersack@novell.com>
[mono.git] / mcs / class / corlib / System.IO / FileInfo.cs
index c06bdc628087db45c683169842e593f2185bcaa6..7ba28dce4c7e3978e6b05deb27e4b3c40f997042 100644 (file)
@@ -11,7 +11,7 @@
 //------------------------------------------------------------------------------
 
 //
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004, 2006 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-using System;
+using System.Runtime.InteropServices;
 
 namespace System.IO {
 
        [Serializable]
+#if NET_2_0
+       [ComVisible (true)]
+#endif
        public sealed class FileInfo : FileSystemInfo {
        
 
@@ -101,6 +104,28 @@ namespace System.IO {
                                File.SetAttributes(FullPath, attrs);
                        }
                }
+
+               [MonoLimitation ("File encryption isn't supported (even on NTFS).")]
+               [ComVisible (false)]
+               public void Encrypt ()
+               {
+                       // MS.NET support this only on NTFS file systems, i.e. it's a file-system (not a framework) feature.
+                       // otherwise it throws a NotSupportedException (or a PlatformNotSupportedException on older OS).
+                       // we throw the same (instead of a NotImplementedException) because most code should already be
+                       // handling this exception to work properly.
+                       throw new NotSupportedException (Locale.GetText ("File encryption isn't supported on any file system."));
+               }
+
+               [MonoLimitation ("File encryption isn't supported (even on NTFS).")]
+               [ComVisible (false)]
+               public void Decrypt ()
+               {
+                       // MS.NET support this only on NTFS file systems, i.e. it's a file-system (not a framework) feature.
+                       // otherwise it throws a NotSupportedException (or a PlatformNotSupportedException on older OS).
+                       // we throw the same (instead of a NotImplementedException) because most code should already be
+                       // handling this exception to work properly.
+                       throw new NotSupportedException (Locale.GetText ("File encryption isn't supported on any file system."));
+               }
 #endif
 
                public long Length {