LogRecord.Record-Eigenschaft
Ruft die Benutzerdaten für den Protokolldatensatz ab.
Namespace: System.EnterpriseServices.CompensatingResourceManager
Assembly: System.EnterpriseServices (in system.enterpriseservices.dll)
Syntax
'Declaration
Public ReadOnly Property Record As Object
'Usage
Dim instance As LogRecord
Dim value As Object
value = instance.Record
public Object Record { get; }
public:
property Object^ Record {
Object^ get ();
}
/** @property */
public Object get_Record ()
public function get Record () : Object
Eigenschaftenwert
Ein einzelnes BLOB mit den Benutzerdaten.
Beispiel
Im folgenden Codebeispiel wird die Verwendung dieser Eigenschaft veranschaulicht.
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
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:
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 boolean AbortRecord(LogRecord log)
{
// Check the validity of the record.
if (log == null) {
return true;
}
Object record[] = new Object[] { log.get_Record() };
if (record == null) {
return true;
}
if (record.get_Length() != 2) {
return true;
}
// Extract old account data from the record.
String fileName = (String)(record.get_Item(0));
int balance = System.Convert.ToInt32(record[1]);
// Restore the old state of the account.
AccountManager.WriteAccountBalance(fileName, balance);
return false;
} //AbortRecord
.NET Framework-Sicherheit
- Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter .
Plattformen
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
LogRecord-Klasse
LogRecord-Member
System.EnterpriseServices.CompensatingResourceManager-Namespace