Compensator.PrepareRecord(LogRecord) 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.
Delivers a log record in forward order during the prepare phase.
public:
virtual bool PrepareRecord(System::EnterpriseServices::CompensatingResourceManager::LogRecord ^ rec);
public virtual bool PrepareRecord (System.EnterpriseServices.CompensatingResourceManager.LogRecord rec);
abstract member PrepareRecord : System.EnterpriseServices.CompensatingResourceManager.LogRecord -> bool
override this.PrepareRecord : System.EnterpriseServices.CompensatingResourceManager.LogRecord -> bool
Public Overridable Function PrepareRecord (rec As LogRecord) As Boolean
Parameters
- rec
- LogRecord
The log record to forward.
Returns
true
if the delivered record should be forgotten; otherwise, false
.
Examples
The following code example demonstrates the implementation of this method.
public:
virtual bool PrepareRecord(LogRecord^ log) override
{
// Check the validity of the record.
if (log == nullptr)
{
return false;
}
array<Object^>^ record = dynamic_cast<array<Object^>^>(log->Record);
if (record == nullptr)
{
return false;
}
if (record->Length != 2)
{
return false;
}
// The record is valid.
receivedPrepareRecord = true;
return true;
}
public override bool PrepareRecord (LogRecord log)
{
// Check the validity of the record.
if (log == null) return(true);
Object[] record = log.Record as Object[];
if (record == null) return(true);
if (record.Length != 2) return(true);
// The record is valid.
receivedPrepareRecord = true;
return(false);
}
Public Overrides Function PrepareRecord(ByVal log As LogRecord) As Boolean
' Check the validity of the record.
If log Is Nothing Then
Return True
End If
Dim record As [Object]() = log.Record
If record Is Nothing Then
Return True
End If
If record.Length <> 2 Then
Return True
End If
' The record is valid.
receivedPrepareRecord = True
Return False
End Function 'PrepareRecord
Applies to
التعاون معنا على GitHub
يمكن العثور على مصدر هذا المحتوى على GitHub حيث يمكنك أيضاً إضافة مشاكل وطلبات سحب ومراجعتها. للحصول على معلومات إضافية، اطلع على دليل المساهم لدينا.
الملاحظات
https://aka.ms/ContentUserFeedback.
قريبًا: خلال عام 2024، سنتخلص تدريجيًا من GitHub Issues بوصفها آلية إرسال ملاحظات للمحتوى ونستبدلها بنظام ملاحظات جديد. لمزيد من المعلومات، راجعإرسال الملاحظات وعرضها المتعلقة بـ