Xceed .NET Libraries Documentation
Xceed.BZip2 Assembly / Xceed.BZip2 Namespace / BZip2File Class / BZip2File Constructor / BZip2File Constructor(FileSystemEvents,Object,AbstractFile)
A object that will be used to raise events. Cannot be .Opaque data that will be passed back to the event handler when an event is raised.


In This Topic
    BZip2File Constructor(FileSystemEvents,Object,AbstractFile)
    In This Topic
    Initializes a new instance of the GZippedFile class for accessing the first file in the GZip archive and enabling event notifications while the object is being created.
    Syntax
    'Declaration
     
    
    Public Function New( _
       ByVal events As FileSystemEvents, _
       ByVal userData As Object, _
       ByVal hostFile As AbstractFile _
    )
    'Usage
     
    
    Dim events As FileSystemEvents
    Dim userData As Object
    Dim hostFile As AbstractFile
     
    Dim instance As New BZip2File(events, userData, hostFile)

    Parameters

    events
    A object that will be used to raise events. Cannot be .Opaque data that will be passed back to the event handler when an event is raised.
    userData
    hostFile
    Example
    AbstractFile hostFile = new DiskFile( @"d:\hello.gz" ); AbstractFile file1 = new GZippedFile( hostFile ); //Calling the constructor a second time when passing a host file that is empty will return a DIFFERENT filename. AbstractFile file2 = new GZippedFile( hostFile ); Console.WriteLine( "file1: {0} {1}", file1.Name, file1.Exists ); Console.WriteLine( "file2: {0} {1}", file2.Name, file2.Exists ); //The item is created by calling the Create method. file2.Create(); //Once the Create method has been called to create an item, calling the ctor always returns that item. AbstractFile file3 = new GZippedFile( hostFile ); Console.WriteLine( "file1: {0} {1}", file1.Name, file1.Exists ); Console.WriteLine( "file2: {0} {1}", file2.Name, file2.Exists ); Console.WriteLine( "file3: {0} {1}", file3.Name, file3.Exists );
    Example
    AbstractFile hostFile = new DiskFile( @"d:\hello.gz" ); AbstractFile file1 = new GZippedFile( hostFile ); //Calling the constructor a second time when passing a host file that is empty will return a DIFFERENT filename. AbstractFile file2 = new GZippedFile( hostFile ); Console.WriteLine( "file1: {0} {1}", file1.Name, file1.Exists ); Console.WriteLine( "file2: {0} {1}", file2.Name, file2.Exists ); //The item is created by calling the Create method. file2.Create(); //Once the Create method has been called to create an item, calling the ctor always returns that item. AbstractFile file3 = new GZippedFile( hostFile ); Console.WriteLine( "file1: {0} {1}", file1.Name, file1.Exists ); Console.WriteLine( "file2: {0} {1}", file2.Name, file2.Exists ); Console.WriteLine( "file3: {0} {1}", file3.Name, file3.Exists );
    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Standard: netstandard2.0, netstandard2.1

    .NET Framework: net20, net35, net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also