IdeaBlade DevForce 2010 Help Reference
Restore(Stream,Boolean,Boolean) Method
See Also  Send Feedback
IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace > EntityCacheState Class > Restore Method : Restore(Stream,Boolean,Boolean) Method



stream
Stream to be read
closeOnExit
Whether or not to close the stream when done.
useBinaryFormat
True to restore a file in binary format, false to restore a file in text format.
Static (Shared in Visual Basic) method which creates and loads an EntityCacheState from the stream specified.

Syntax

Visual Basic (Declaration) 
Public Overloads Shared Function Restore( _
   ByVal stream As Stream, _
   Optional ByVal closeOnExit As Boolean, _
   Optional ByVal useBinaryFormat As Boolean _
) As EntityCacheState
Visual Basic (Usage)Copy Code
Dim stream As Stream
Dim closeOnExit As Boolean
Dim useBinaryFormat As Boolean
Dim value As EntityCacheState
 
value = EntityCacheState.Restore(stream, closeOnExit, useBinaryFormat)
C# 
public static EntityCacheState Restore( 
   Stream stream,
   bool closeOnExit,
   bool useBinaryFormat
)
C++/CLI 
public:
static EntityCacheState^ Restore( 
   Stream^ stream,
   bool closeOnExit,
   bool useBinaryFormat
) 

Parameters

stream
Stream to be read
closeOnExit
Whether or not to close the stream when done.
useBinaryFormat
True to restore a file in binary format, false to restore a file in text format.

Return Value

An EntityCacheState

Remarks

Use Restore to deserialize an EntityCacheState which was previously saved to a stream or file.

Note that this method does not merge the EntityCacheState into an EntityManager. Call Merge or CacheStateManager.RestoreCacheState(EntityCacheState) for this. Instead of performing the Restore and merge/restore as separate steps, you can instead use CacheStateManager.RestoreCacheState(Stream, RestoreStrategy, bool) to accomplish the same thing.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.