Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@ -81,9 +81,7 @@ namespace System.IO.IsolatedStorage {
}
[CLSCompliant (false)]
#if NET_4_0
[Obsolete]
#endif
public virtual ulong CurrentSize {
get {
throw new InvalidOperationException (
@ -104,9 +102,7 @@ namespace System.IO.IsolatedStorage {
}
[CLSCompliant (false)]
#if NET_4_0
[Obsolete]
#endif
public virtual ulong MaximumSize {
get {
throw new InvalidOperationException (
@ -118,7 +114,6 @@ namespace System.IO.IsolatedStorage {
get { return storage_scope; }
}
#if NET_4_0
[ComVisible (false)]
public virtual long AvailableFreeSpace {
get {
@ -139,7 +134,6 @@ namespace System.IO.IsolatedStorage {
throw new InvalidOperationException ("This property is not defined for this store.");
}
}
#endif
protected virtual char SeparatorExternal {
get { return System.IO.Path.DirectorySeparatorChar; }
@ -182,12 +176,10 @@ namespace System.IO.IsolatedStorage {
}
public abstract void Remove ();
#if NET_4_0
[ComVisible (false)]
public virtual bool IncreaseQuotaTo (long newQuotaSize)
{
return false;
}
#endif
}
}

View 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)

View File

@ -64,12 +64,10 @@ namespace System.IO.IsolatedStorage {
#endif
}
#if NET_4_0
if (isf.IsDisposed)
throw new ObjectDisposedException ("IsolatedStorageFile");
if (isf.IsClosed)
throw new InvalidOperationException ("Storage needs to be open for this operation.");
#endif
// ensure that the _root_ isolated storage can be (and is) created.
FileInfo fi = new FileInfo (isf.Root);
@ -212,12 +210,10 @@ namespace System.IO.IsolatedStorage {
base.Flush ();
}
#if NET_4_0
public override void Flush (bool flushToDisk)
{
base.Flush (flushToDisk);
}
#endif
public override int Read (byte[] buffer, int offset, int count)
{

View File

@ -26,7 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_4_0
namespace System.IO.IsolatedStorage
{
public enum IsolatedStorageSecurityOptions
@ -35,5 +34,4 @@ namespace System.IO.IsolatedStorage
}
}
#endif

View File

@ -28,7 +28,6 @@
using System.Security;
#if NET_4_0
namespace System.IO.IsolatedStorage
{
@ -65,5 +64,4 @@ namespace System.IO.IsolatedStorage
}
}
#endif