Răsfoiți Sursa

2004-05-12 Sebastien Pouliot <[email protected]>

	* IsolatedStorage.cs: More details on MonoTODO. Throw exceptions on
	AssemblyIdentity and DomainIdentity properties.
	* IsolatedStorageFile.cs: More details on MonoTODO.
	* IsolatedStorageFileStream.cs: Removed MonoTODO on class. Now use
	Path.Combine to build filenames (constructor) and throw an exception
	when we try to get the handle (as documented).

svn path=/trunk/mcs/; revision=27208
Sebastien Pouliot 21 ani în urmă
părinte
comite
fceba28ede

+ 9 - 0
mcs/class/corlib/System.IO.IsolatedStorage/ChangeLog

@@ -1,3 +1,12 @@
+2004-05-12  Sebastien Pouliot  <[email protected]>
+
+	* IsolatedStorage.cs: More details on MonoTODO. Throw exceptions on
+	AssemblyIdentity and DomainIdentity properties.
+	* IsolatedStorageFile.cs: More details on MonoTODO.
+	* IsolatedStorageFileStream.cs: Removed MonoTODO on class. Now use 
+	Path.Combine to build filenames (constructor) and throw an exception 
+	when we try to get the handle (as documented).
+
 2003-07-30  Duncan Mak  <[email protected]>
 
 	* IsolatedStorageInfo.cs (CreateAssemblyFilename):

+ 13 - 6
mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorage.cs

@@ -23,9 +23,12 @@ namespace System.IO.IsolatedStorage
                 protected static IsolatedStorageScope storage_scope;
 
 		// Properties
-                [MonoTODO]
+		[MonoTODO ("Code Identity is CAS related")]
 		public object AssemblyIdentity {
-			get {return null;}                        
+			get {
+				throw new NotImplementedException (
+					Locale.GetText ("CAS related")); 
+			}
 		}
 
 		[CLSCompliant (false)]
@@ -36,9 +39,12 @@ namespace System.IO.IsolatedStorage
                         }
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Code Identity is CAS related")]
 		public object DomainIdentity {
-			get {return null;}
+			get {
+				throw new NotImplementedException (
+					Locale.GetText ("CAS related")); 
+			}
 		}
 
 		[CLSCompliant (false)]
@@ -64,11 +70,12 @@ namespace System.IO.IsolatedStorage
 		// Methods
 		protected abstract IsolatedStoragePermission GetPermission (PermissionSet ps);
 
-		[MonoTODO]
+		[MonoTODO ("Evidences are CAS related")]
 		protected void InitStore (
                         IsolatedStorageScope scope, Type domainEvidenceType,
                         Type assemblyEvidenceType)
-		{
+		{
+			// no exception here because this can work without CAS
 		}
 
 		public abstract void Remove ();

+ 5 - 5
mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs

@@ -31,7 +31,7 @@ namespace System.IO.IsolatedStorage
 		}
 
 		[CLSCompliant(false)]
-                [MonoTODO("The IsolatedStorage area should be limited, to prevent DOS attacks.  What's a reasonable size?")]
+                [MonoTODO ("The IsolatedStorage area should be limited, to prevent DOS attacks.  What's a reasonable size?")]
 		public override ulong MaximumSize {
 			get {return ulong.MaxValue;}
 		}
@@ -43,7 +43,7 @@ namespace System.IO.IsolatedStorage
 			return a.GetEnumerator ();
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Functional but missing CAS support")]
 		public static IsolatedStorageFile GetStore (
 			IsolatedStorageScope scope,
 			System.Security.Policy.Evidence domainEvidence,
@@ -54,7 +54,7 @@ namespace System.IO.IsolatedStorage
 			return GetStore (scope);
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Functional but missing CAS support")]
 		public static IsolatedStorageFile GetStore (
 			IsolatedStorageScope scope,
 			object domainIdentity,
@@ -63,7 +63,7 @@ namespace System.IO.IsolatedStorage
 			return GetStore (scope);
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Functional but missing CAS support")]
 		public static IsolatedStorageFile GetStore (
 			IsolatedStorageScope scope,
 			Type domainEvidenceType,
@@ -165,7 +165,7 @@ namespace System.IO.IsolatedStorage
 		{
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Permissions are CAS related")]
 		protected override IsolatedStoragePermission GetPermission (PermissionSet ps)
 		{
 			throw new NotImplementedException ();

+ 7 - 3
mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs

@@ -3,21 +3,22 @@
 // Sean MacIsaac ([email protected])
 //
 // (C) 2001 Ximian, Inc.
+// (C) 2004 Novell (http://www.novell.com)
 
 using System;
+using System.Globalization;
 using System.IO;
 using System.Reflection;
 
 namespace System.IO.IsolatedStorage {
 
-	[MonoTODO]
 	public class IsolatedStorageFileStream : FileStream
 	{
 		private static string CreateIsolatedPath (string path)
 		{
 			string dir = IsolatedStorageInfo.CreateAssemblyFilename (Assembly.GetEntryAssembly());
 
-			string file = dir + "/" + path;
+			string file = Path.Combine (dir, path);
 
 			// Ensure that the file can be created.
 			FileInfo fi = new FileInfo (file);
@@ -80,7 +81,10 @@ namespace System.IO.IsolatedStorage {
 		}
 
 		public override IntPtr Handle {
-			get {return base.Handle;}
+			get {
+				throw new IsolatedStorageException (
+					Locale.GetText ("Information is restricted"));
+			}
 		}
 
 		public override bool IsAsync {