CSharpTest.Net
BackgroundWriter Constructor(Stream,Boolean)
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.IO Namespace > BackgroundWriter Class > BackgroundWriter Constructor : BackgroundWriter Constructor(Stream,Boolean)

stream
closeStream

Glossary Item Box

Create the writer and thread

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal stream As Stream, _
   ByVal closeStream As Boolean _
)
C# 
public BackgroundWriter( 
   Stream stream,
   bool closeStream
)

Parameters

stream
closeStream

Example

Library/Library.Test/TestBackgroundWriter.cs

C#Copy Code
using (TestStream io = new TestStream())
using (BackgroundWriter wtr = new BackgroundWriter(io, false))
{
    wtr.Dispose();
    Assert.IsFalse(io.Disposed);
    io.Write(new byte[1], 0, 1);
}
VB.NETCopy Code
Using io As New TestStream()
    Using wtr As New BackgroundWriter(io, False)
        wtr.Dispose()
        Assert.IsFalse(io.Disposed)
        io.Write(New Byte(1) {}, 0, 1)
    End Using
End Using

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys