views:

49

answers:

1

Silverlight uses an IsolatedStorageFileStream to open files.

The IsolatedStorageFileStreamunder NET.4 claims to support the Lock Method (Inherited from FileStream)

The following code

IsolatedStorageFile isf;
IsolatedStorageFileStream lockStream = new IsolatedStorageFileStream( "my.lck", FileMode.OpenOrCreate, isf );
lockStream.Lock( 0, 0 );

generates the following error, wrapped for readability, under VS2010 and Silverlight 4

'System.IO.IsolatedStorage.IsolatedStorageFileStream' does not contain a definition for 'Lock' 
and no extension method 'Lock' accepting a first argument of type 'System.IO.IsolatedStorage.IsolatedStorageFileStream' could be found 
(are you missing a using directive or an assembly reference?)   
A: 

Lock and Unlock are not actually supported but are present so that the System.IO.FileStream classes are consistent between frameworks and allows for the feature to be implemented in the future.

AnthonyWJones