[bcl] Remove NET_4_0 defines from class libs.
[mono.git] / mcs / class / corlib / System.IO.IsolatedStorage / IsolatedStorageFile.cs
index 48e98f516ea998949cf974eb58379aef37c0ea2f..935bd6c890c64370d97ae89f1b98ff2a650c442f 100644 (file)
@@ -57,10 +57,8 @@ namespace System.IO.IsolatedStorage {
                private static readonly Mutex mutex = new Mutex ();
 #endif
                
-#if NET_4_0
                private bool closed;
                private bool disposed;
-#endif
 
                public static IEnumerator GetEnumerator (IsolatedStorageScope scope)
                {
@@ -279,13 +277,11 @@ namespace System.IO.IsolatedStorage {
                        return storageFile;
                }
 
-#if NET_4_0
                [ComVisible (false)]
                public static IsolatedStorageFile GetUserStoreForSite ()
                {
                        throw new NotSupportedException ();
                }
-#endif
 
                public static void Remove (IsolatedStorageScope scope)
                {
@@ -441,17 +437,13 @@ namespace System.IO.IsolatedStorage {
                }
 
                [CLSCompliant(false)]
-#if NET_4_0
                [Obsolete]
-#endif
                public override ulong CurrentSize {
                        get { return GetDirectorySize (directory); }
                }
 
                [CLSCompliant(false)]
-#if NET_4_0
                [Obsolete]
-#endif
                public override ulong MaximumSize {
                        // return an ulong but default is signed long
                        get {
@@ -504,7 +496,6 @@ namespace System.IO.IsolatedStorage {
                        get { return directory.FullName; }
                }
 
-#if NET_4_0
                [ComVisible (false)]
                public override long AvailableFreeSpace {
                        get {
@@ -554,15 +545,12 @@ namespace System.IO.IsolatedStorage {
                                return disposed;
                        }
                }
-#endif
 
                // methods
 
                public void Close ()
                {
-#if NET_4_0
                        closed = true;
-#endif
                }
 
                public void CreateDirectory (string dir)
@@ -572,11 +560,7 @@ namespace System.IO.IsolatedStorage {
 
                        if (dir.IndexOfAny (Path.PathSeparatorChars) < 0) {
                                if (directory.GetFiles (dir).Length > 0)
-#if NET_4_0
                                        throw new IsolatedStorageException ("Unable to create directory.");
-#else
-                                       throw new IOException (Locale.GetText ("Directory name already exists as a file."));
-#endif
                                directory.CreateSubdirectory (dir);
                        } else {
                                string[] dirs = dir.Split (Path.PathSeparatorChars, StringSplitOptions.RemoveEmptyEntries);
@@ -584,18 +568,12 @@ namespace System.IO.IsolatedStorage {
 
                                for (int i = 0; i < dirs.Length; i++) {
                                        if (dinfo.GetFiles (dirs [i]).Length > 0)
-#if NET_4_0
                                                throw new IsolatedStorageException ("Unable to create directory.");
-#else
-                                               throw new IOException (Locale.GetText (
-                                                       "Part of the directory name already exists as a file."));
-#endif
                                        dinfo = dinfo.CreateSubdirectory (dirs [i]);
                                }
                        }
                }
 
-#if NET_4_0
                [ComVisible (false)]
                public void CopyFile (string sourceFileName, string destinationFileName)
                {
@@ -641,7 +619,6 @@ namespace System.IO.IsolatedStorage {
                {
                        return new IsolatedStorageFileStream (path, FileMode.Create, FileAccess.ReadWrite, FileShare.None, this);
                }
-#endif
 
                public void DeleteDirectory (string dir)
                {
@@ -676,15 +653,12 @@ namespace System.IO.IsolatedStorage {
 
                public void Dispose ()
                {
-#if NET_4_0
                        // Dispose may be calling Close, but we are not sure
                        disposed = true;
-#endif
                        // nothing to dispose, anyway we want to please the tools
                        GC.SuppressFinalize (this);
                }
 
-#if NET_4_0
                [ComVisible (false)]
                public bool DirectoryExists (string path)
                {
@@ -765,16 +739,13 @@ namespace System.IO.IsolatedStorage {
 
                        return Directory.GetLastWriteTime (full_path);
                }
-#endif
                
                public string[] GetDirectoryNames (string searchPattern)
                {
                        if (searchPattern == null)
                                throw new ArgumentNullException ("searchPattern");
-#if NET_4_0
                        if (searchPattern.Contains (".."))
                                throw new ArgumentException ("Search pattern cannot contain '..' to move up directories.", "searchPattern");
-#endif
 
                        // note: IsolatedStorageFile accept a "dir/file" pattern which is not allowed by DirectoryInfo
                        // so we need to split them to get the right results
@@ -807,13 +778,11 @@ namespace System.IO.IsolatedStorage {
                        return GetNames (adi);
                }
 
-#if NET_4_0
                [ComVisible (false)]
                public string [] GetDirectoryNames ()
                {
                        return GetDirectoryNames ("*");
                }
-#endif
 
                private string[] GetNames (FileSystemInfo[] afsi)
                {
@@ -827,10 +796,8 @@ namespace System.IO.IsolatedStorage {
                {
                        if (searchPattern == null)
                                throw new ArgumentNullException ("searchPattern");
-#if NET_4_0
                        if (searchPattern.Contains (".."))
                                throw new ArgumentException ("Search pattern cannot contain '..' to move up directories.", "searchPattern");
-#endif
 
                        // note: IsolatedStorageFile accept a "dir/file" pattern which is not allowed by DirectoryInfo
                        // so we need to split them to get the right results
@@ -854,7 +821,6 @@ namespace System.IO.IsolatedStorage {
                        return GetNames (afi);
                }
 
-#if NET_4_0
                [ComVisible (false)]
                public string [] GetFileNames ()
                {
@@ -953,13 +919,10 @@ namespace System.IO.IsolatedStorage {
                {
                        return new IsolatedStorageFileStream (path, mode, access, share, this);
                }
-#endif
 
                public override void Remove ()
                {
-#if NET_4_0
                        CheckOpen (false);
-#endif
                        try {
                                directory.Delete (true);
                        } catch {
@@ -979,7 +942,6 @@ namespace System.IO.IsolatedStorage {
                }
 
                // internal stuff
-#if NET_4_0
                void CheckOpen ()
                {
                        CheckOpen (true);
@@ -999,7 +961,6 @@ namespace System.IO.IsolatedStorage {
                {
                        return Path.GetFullPath (path).StartsWith (directory.FullName);
                }
-#endif
 
 #if !MOBILE
                private string GetNameFromIdentity (object identity)