Merge pull request #1067 from esdrubal/bug19862
authorZoltan Varga <vargaz@gmail.com>
Thu, 29 May 2014 00:01:34 +0000 (02:01 +0200)
committerZoltan Varga <vargaz@gmail.com>
Thu, 29 May 2014 00:01:34 +0000 (02:01 +0200)
Removed NET_2_1 conditional blocks from FileInfo. Fixes #19862.

mcs/class/corlib/System.IO/FileInfo.cs

index 0911f8152c4827f7fdafb5f2dd993d302a651da0..530dae189da6df5012620c190cfa6f6f7a79b14a 100644 (file)
 using System.Runtime.InteropServices;
 using System.Runtime.Serialization;
 using System.Security;
-
-#if !NET_2_1
 using System.Security.AccessControl;
-#endif
 
 namespace System.IO {
 
@@ -93,7 +90,6 @@ namespace System.IO {
                        }
                }
 
-#if !NET_2_1
                public bool IsReadOnly {
                        get {
                                if (!Exists)
@@ -138,7 +134,6 @@ namespace System.IO {
                        // handling this exception to work properly.
                        throw new NotSupportedException (Locale.GetText ("File encryption isn't supported on any file system."));
                }
-#endif
 
                public long Length {
                        get {
@@ -265,15 +260,9 @@ namespace System.IO {
 
                public override string ToString ()
                {
-#if NET_2_1
-                       // for Moonlight we *never* return paths, since ToString is not [SecurityCritical] we simply return the Name
-                       return Name;
-#else
                        return OriginalPath;
-#endif
                }
 
-#if !NET_2_1
                public FileSecurity GetAccessControl ()
                {
                        return File.GetAccessControl (FullPath); 
@@ -329,6 +318,5 @@ namespace System.IO {
                {
                        File.SetAccessControl (FullPath, fileSecurity);
                }
-#endif
        }
 }