LogRecord Klasa

Definicja

Reprezentuje nieustrukturyzowany rekord dziennika dostarczony jako struktura COM+ CrmLogRecordRead . Klasa ta nie może być dziedziczona.

public ref class LogRecord sealed
public sealed class LogRecord
type LogRecord = class
Public NotInheritable Class LogRecord
Dziedziczenie
LogRecord

Przykłady

Poniższy przykład kodu pokazuje użycie tej klasy.

public:
    virtual bool AbortRecord(LogRecord^ log) override
    {

        // Check the validity of the record.
        if (log == nullptr)
        {
            return true;
        }
        array<Object^>^ record = dynamic_cast<array<Object^>^>(log->Record);
        if (record == nullptr)
        {
            return true;
        }
        if (record->Length != 2)
        {
            return true;
        }

        // Extract old account data from the record.
        String^ filename = (String^) record[0];
        int balance = (int) record[1];

        // Restore the old state of the account.
        WriteAccountBalance(filename, balance);

        return false;
    }
public override bool AbortRecord (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);

    // Extract old account data from the record.
    string filename = (string) record[0];
    int balance = (int) record[1];

    // Restore the old state of the account.
    AccountManager.WriteAccountBalance(filename, balance);

    return(false);
}
Public Overrides Function AbortRecord(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 
    ' Extract old account data from the record.
    Dim filename As String = CStr(record(0))
    Dim balance As Integer = Fix(record(1))
    
    ' Restore the old state of the account.
    AccountManager.WriteAccountBalance(filename, balance)
    
    Return False

End Function 'AbortRecord

Uwagi

Rekordy dzienników bez struktury są dostarczane jako struktura COM+ CrmLogRecordRead . Oprócz danych użytkownika (pojedynczego obiektu BLOB) zawiera to dodatkowe pola przydatne do debugowania lub znajdowania błędów. Pole Flags jest nieco polem, które zawiera dodatkowe informacje o tym, czy ten rekord został zapomniany w pewnym momencie i kiedy został napisany. Pole Sequence zawiera numer sekwencji rekordu dziennika. W większości przypadków numery sekwencji są sekwencyjne, ale niekoniecznie są ciągłe z powodu wewnętrznych rekordów dziennika, które nie są dostarczane do kompensatora Resource Manager wyrównujących (CRM).

Właściwości

Flags

Pobiera wartość wskazującą, kiedy rekord dziennika został zapisany.

Record

Pobiera dane użytkownika rekordu dziennika.

Sequence

Numer sekwencji rekordu dziennika.

Metody

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera bieżące wystąpienie.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy