Compensator.PrepareRecord(LogRecord) 메서드

정의

준비 단계 중에 전달 순서에 따라 로그 레코드를 전달합니다.

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

매개 변수

rec
LogRecord

전달할 로그 레코드입니다.

반환

전달된 레코드가 무시되어야 하면 true이고, 그렇지 않으면 false입니다.

예제

다음 코드 예제에는이 메서드의 구현을 보여 줍니다.

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

적용 대상