共用方式為


TextSnapshotToTextReader.ReadBlock Method

Reads a maximum of count characters from the current stream and writes the data to the buffer, beginning at index.

Namespace:  Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)

Syntax

'宣告
Public Overrides Function ReadBlock ( _
    buffer As Char(), _
    index As Integer, _
    count As Integer _
) As Integer
public override int ReadBlock(
    char[] buffer,
    int index,
    int count
)
public:
virtual int ReadBlock(
    array<wchar_t>^ buffer, 
    int index, 
    int count
) override
abstract ReadBlock : 
        buffer:char[] * 
        index:int * 
        count:int -> int 
override ReadBlock : 
        buffer:char[] * 
        index:int * 
        count:int -> int 
public override function ReadBlock(
    buffer : char[], 
    index : int, 
    count : int
) : int

Parameters

  • buffer
    Type: array<System.Char[]
    When this method returns, contains the specified character array from the current source.
  • index
    Type: System.Int32
    The place in buffer at which to begin writing.
  • count
    Type: System.Int32
    The maximum number of characters to read.

Return Value

Type: System.Int32
The number of characters that have been read. The number will be less than or equal to count, depending on whether the data is available within the stream. This method returns zero if called when no more characters are left to read.

Exceptions

Exception Condition
ArgumentNullException

buffer is nulla null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

index or count is negative, or the buffer length minus index is less than count.

ObjectDisposedException

The reader is closed.

.NET Framework Security

See Also

Reference

TextSnapshotToTextReader Class

Microsoft.VisualStudio.Text Namespace