Compensator.AbortRecord(LogRecord) Метод
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Доставляет запись журнала в компенсатор CRM на этапе прерывания.
public:
virtual bool AbortRecord(System::EnterpriseServices::CompensatingResourceManager::LogRecord ^ rec);
public virtual bool AbortRecord (System.EnterpriseServices.CompensatingResourceManager.LogRecord rec);
abstract member AbortRecord : System.EnterpriseServices.CompensatingResourceManager.LogRecord -> bool
override this.AbortRecord : System.EnterpriseServices.CompensatingResourceManager.LogRecord -> bool
Public Overridable Function AbortRecord (rec As LogRecord) As Boolean
Параметры
- rec
- LogRecord
Доставляемая запись журнала.
Возвращаемое значение
Значение true
, если доставленную запись следует забыть; в противном случае — значение 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 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
Применяется к
GitHub сайтында бізбен бірлесіп жұмыс істеу
Бұл мазмұнның көзін GitHub сайтында табуға болады. Онда сонымен бірге мәселелер мен өзгертулерді енгізу сұрауларын жасауға және қарап шығуға болады. Қосымша ақпарат алу үшін қатысушы нұсқаулығын қараңыз.