LogRecordSequence.Dispose Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Releases the resources used by the component.
public:
virtual void Dispose();
public void Dispose ();
abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit
Public Sub Dispose ()
Implements
Exceptions
The method was called after the sequence has been disposed of.
There is not enough memory to continue the execution of the program.
Examples
This example shows how to use Dispose to release resources:
// Create log stream 1.
sequence1 = new LogRecordSequence(logStream1,
FileMode.OpenOrCreate,
FileAccess.ReadWrite,
FileShare.ReadWrite);
// Log Extents are shared between the two streams.
// Add two extents to sequence1.
sequence1.LogStore.Extents.Add("MyExtent0", containerSize);
sequence1.LogStore.Extents.Add("MyExtent1");
// Create log stream 2.
sequence2 = new LogRecordSequence(logStream2,
FileMode.OpenOrCreate,
FileAccess.ReadWrite,
FileShare.ReadWrite);
' Create log stream 1.
sequence1 = New LogRecordSequence(logStream1, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite)
' Log Extents are shared between the two streams.
' Add two extents to sequence1.
sequence1.LogStore.Extents.Add("MyExtent0", containerSize)
sequence1.LogStore.Extents.Add("MyExtent1")
' Create log stream 2.
sequence2 = New LogRecordSequence(logStream2, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite)
Console.WriteLine();
// Cleanup...
sequence1.Dispose();
sequence2.Dispose();
Console.WriteLine()
' Cleanup...
sequence1.Dispose()
sequence2.Dispose()
Applies to
Colaborați cu noi pe GitHub
Sursa pentru acest conținut poate fi găsită pe GitHub, unde puteți, de asemenea, să creați și să consultați probleme și solicitări de tragere. Pentru mai multe informații, consultați ghidul nostru pentru colaboratori.