Hello,
As we are not doing updates to third party projects on a regular basis, we often struggle to keep up with changes but it was always a smooth ride with Spring4D.
Sadly, this time round, it's not as easy because of the following commit:
Revision: 4f2540cdddc5f4c509d95c6a4e107dfc4787a26b
Author: Stefan Glienke <-...@---.org>
Date: 03/12/2020 03:24:53
Message:
event optimizations
----
Modified: Source/Base/Collections/Spring.Collections.Events.pas
Modified: Source/Base/Spring.Events.Base.pas
Modified: Source/Base/Spring.Events.pas
Added: Source/Base/Spring.HazardEra.pas
Modified: Source/Base/Spring.ResourceStrings.pas
Modified: Source/Base/Spring.pas
Modified: Source/Core/Container/Spring.Container.Builder.pas
Modified: Tests/Source/Base/Spring.Tests.Base.pas
Modified: Tests/Source/Base/Spring.Tests.Collections.pas
In this commit, the TEvent<T> class has been removed altogether and we can't seem to find any obvious replacement to be used in our code.
Here is what we usually do:
type
TOnFieldHashStringChanged = procedure(AField: TToolDataField) of object;
class
TSomeClass = class
private
FOnHashStringChanged: IEvent<TOnFieldHashStringChanged>;
public
constructor Create;
end;
constructor
TSomeClass.Create;
begin
inherited Create;
FOnHashStringChanged := TEvent<TOnFieldHashStringChanged>.Create;
end;
This used to work just fine, but now that we have updated Sprig4D it no longer compiles
As an interim measure, I have reintroduced the class myself in our local copy, but I'm not sure this is a viable long term solution.
Any suggestion is most welcome.
Regards
Olivier