共用方式為


RecordAppendOptions 列舉

定義

指定如何附加記錄。

此列舉支援其成員值的位元組合。

public enum class RecordAppendOptions
[System.Flags]
public enum RecordAppendOptions
[<System.Flags>]
type RecordAppendOptions = 
Public Enum RecordAppendOptions
繼承
RecordAppendOptions
屬性

欄位

ForceAppend 1

記錄順序必須在附加這筆記錄之後開始進行清除內部緩衝區的流程, 這不表示必須在附加作業完成之前將記錄永久寫入。 若要取得該行為,請指定 ForceFlush 旗標。

ForceFlush 2

記錄順序必須在附加這筆記錄之後清除任何內部緩衝區。 當附加作業完成時,代表已永久寫入指定的記錄。

None 0

資料會暫緩寫入。

範例

下列範例將示範如何使用這個列舉型別搭配 Append 方法,將記錄附加到記錄順序。

    // Append records. Appending three records.
    public void AppendRecords()
    {
        Console.WriteLine("Appending Log Records...");
        SequenceNumber previous = SequenceNumber.Invalid;

        previous = sequence.Append(CreateData("Hello World!"), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush);
        previous = sequence.Append(CreateData("This is my first Logging App"), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush);
        previous = sequence.Append(CreateData("Using LogRecordSequence..."), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush);

        Console.WriteLine("Done...");
    }
' Append records. Appending three records.  
Public Sub AppendRecords()
    Console.WriteLine("Appending Log Records...")
    Dim previous As SequenceNumber = SequenceNumber.Invalid

    previous = sequence.Append(CreateData("Hello World!"), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush)
    previous = sequence.Append(CreateData("This is my first Logging App"), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush)
    previous = sequence.Append(CreateData("Using LogRecordSequence..."), SequenceNumber.Invalid, SequenceNumber.Invalid, RecordAppendOptions.ForceFlush)

    Console.WriteLine("Done...")
End Sub

適用於