Udostępnij za pośrednictwem


VersionedBinaryReader.ReadVersioned Method

Definition

Overloads

ReadVersioned(Int32, VersionedBinaryReader+MultiVersionReadCallback)

Reads from the base stream, with version checking. callback is invoked regardless of the version of the stream. Use this overload if you want to support reading stream versions other than the expected version.

ReadVersioned(Int32, VersionedBinaryReader+ReadCallback, Boolean)

Reads from the base stream, with version checking.

ReadVersioned<T>(Int32, Func<VersionedBinaryReader,T>, Boolean)

Reads from the base stream, with version checking, returning the result from the callback.

ReadVersioned(Int32, VersionedBinaryReader+MultiVersionReadCallback)

Reads from the base stream, with version checking. callback is invoked regardless of the version of the stream. Use this overload if you want to support reading stream versions other than the expected version.

public:
 void ReadVersioned(int expectedVersion, Microsoft::VisualStudio::Utilities::VersionedBinaryReader::MultiVersionReadCallback ^ callback);
public void ReadVersioned (int expectedVersion, Microsoft.VisualStudio.Utilities.VersionedBinaryReader.MultiVersionReadCallback callback);
member this.ReadVersioned : int * Microsoft.VisualStudio.Utilities.VersionedBinaryReader.MultiVersionReadCallback -> unit
Public Sub ReadVersioned (expectedVersion As Integer, callback As VersionedBinaryReader.MultiVersionReadCallback)

Parameters

expectedVersion
Int32

The expected version of the stream.

callback
VersionedBinaryReader.MultiVersionReadCallback

The delegate that will read the body of the stream

Applies to

ReadVersioned(Int32, VersionedBinaryReader+ReadCallback, Boolean)

Reads from the base stream, with version checking.

public void ReadVersioned (int expectedVersion, Microsoft.VisualStudio.Utilities.VersionedBinaryReader.ReadCallback callback, bool throwOnUnexpectedVersion = false);
member this.ReadVersioned : int * Microsoft.VisualStudio.Utilities.VersionedBinaryReader.ReadCallback * bool -> unit
Public Sub ReadVersioned (expectedVersion As Integer, callback As VersionedBinaryReader.ReadCallback, Optional throwOnUnexpectedVersion As Boolean = false)

Parameters

expectedVersion
Int32

The expected version of the stream. If the actual version doesn't match the expected version, the stream position is advanced beyond the content but callback is not invoked.

callback
VersionedBinaryReader.ReadCallback

The delegate that will read the body of the stream

throwOnUnexpectedVersion
Boolean

True to throw an exception on encountering an unexpected version.

Applies to

ReadVersioned<T>(Int32, Func<VersionedBinaryReader,T>, Boolean)

Reads from the base stream, with version checking, returning the result from the callback.

public T ReadVersioned<T> (int expectedVersion, Func<Microsoft.VisualStudio.Utilities.VersionedBinaryReader,T> callback, bool throwOnUnexpectedVersion = false);
member this.ReadVersioned : int * Func<Microsoft.VisualStudio.Utilities.VersionedBinaryReader, 'T> * bool -> 'T
Public Function ReadVersioned(Of T) (expectedVersion As Integer, callback As Func(Of VersionedBinaryReader, T), Optional throwOnUnexpectedVersion As Boolean = false) As T

Type Parameters

T

Parameters

expectedVersion
Int32

The expected version of the stream. If the actual version doesn't match the expected version, the stream position is advanced beyond the content but callback is not invoked.

callback
Func<VersionedBinaryReader,T>

The delegate that will read the body of the stream

throwOnUnexpectedVersion
Boolean

true to throw when the read version is not the same as the expected; otherwise, false to return default in that cicumstance.

Returns

T

Applies to