本文整理汇总了C#中System.IO.Log.LogRecordSequence.Append方法的典型用法代码示例。如果您正苦于以下问题:C# LogRecordSequence.Append方法的具体用法?C# LogRecordSequence.Append怎么用?C# LogRecordSequence.Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.Log.LogRecordSequence
的用法示例。
在下文中一共展示了LogRecordSequence.Append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppendRecords
// 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...");
}
示例2: CreateData
// Start Appending in two streams with interleaving appends.
SequenceNumber previous1 = SequenceNumber.Invalid;
SequenceNumber previous2 = SequenceNumber.Invalid;
Console.WriteLine("Appending interleaving records in stream1 and stream2...");
Console.WriteLine();
// Append two records in stream1.
previous1 = sequence1.Append(
CreateData("MyLogStream1: Hello World!"),
SequenceNumber.Invalid,
SequenceNumber.Invalid,
RecordAppendOptions.ForceFlush);
previous1 = sequence1.Append(
CreateData("MyLogStream1: This is my first Logging App"),
previous1,
previous1,
RecordAppendOptions.ForceFlush);
// Append two records in stream2.
previous2 = sequence2.Append(
CreateData("MyLogStream2: Hello World!"),
SequenceNumber.Invalid,
SequenceNumber.Invalid,
RecordAppendOptions.ForceFlush);
previous2 = sequence2.Append(
CreateData("MyLogStream2: This is my first Logging App"),
previous2,
previous2,
RecordAppendOptions.ForceFlush);
// Append the third record in stream1.
previous1 = sequence1.Append(CreateData(
"MyLogStream1: Using LogRecordSequence..."),
previous1,
previous1,
RecordAppendOptions.ForceFlush);
// Append the third record in stream2.
previous2 = sequence2.Append(
CreateData("MyLogStream2: Using LogRecordSequence..."),
previous2,
previous2,
RecordAppendOptions.ForceFlush);