Exemple #1
0
//---------------------------------------------------------------------------
void __fastcall TAddressBook::AssignTo(TPersistent* Dest)
{
	TStrings *DestStrings = dynamic_cast<TStrings *>(Dest);

	if (DestStrings) {
		DestStrings->BeginUpdate();
		try {
			DestStrings->Clear();
			DestStrings->AddStrings(FNames);
		}
		__finally {
			DestStrings->EndUpdate();
		}
	}
}
TStrings * ExceptionToMoreMessages(Exception * E)
{
  TStrings * Result = nullptr;
  UnicodeString Message;
  if (ExceptionMessage(E, Message))
  {
    Result = new TStringList();
    Result->Add(Message);
    ExtException * ExtE = dyn_cast<ExtException>(E);
    if ((ExtE != nullptr) && (ExtE->GetMoreMessages() != nullptr))
    {
      Result->AddStrings(ExtE->GetMoreMessages());
    }
  }
  return Result;
}
Exemple #3
0
TStrings * ExceptionToMoreMessages(Exception * E)
{
  TStrings * Result = nullptr;
  UnicodeString Message;
  if (ExceptionMessage(E, Message))
  {
    Result = new TStringList();
    Result->Add(Message);
    ExtException * ExtE = NB_STATIC_DOWNCAST(ExtException, E);
    if ((ExtE != nullptr) && (ExtE->GetMoreMessages() != nullptr))
    {
      Result->AddStrings(ExtE->GetMoreMessages());
    }
  }
  return Result;
}