Created
March 25, 2018 19:59
-
-
Save Pasquina/6f81371656756e4c14b15cd26697839d to your computer and use it in GitHub Desktop.
LiveBindings Demo Creating the TObjectBindSourceAdapter<TCorp> (Alias CorpObjectBSWrapper)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ When the Adapter Bind Source for the Corp is created, this event handler creates the | |
necessary CorpBSWrapper and passes it back to the Bind Source Adapter } | |
procedure TMDLBO.absCorpCreateAdapter( | |
Sender: TObject; | |
var ABindSourceAdapter: TBindSourceAdapter); | |
begin | |
{ Begin by creating the CorpWrapper and saving it in the current form } | |
CorpWrapper := CorpObjectBSWrapper.Create( // create the Corp Wrapper | |
self, // (a Type Alias for TObjectBindSourceAdapter<TCorp>) | |
Corp, // The Wrapper points to TCorp | |
False); // we keep responsibility for ownership | |
{ Return the CorpWrapper to the AdapterBindSource } | |
ABindSourceAdapter := CorpWrapper; // this gives the TAdapterBindSource the ability to display the Corp object | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shows how the TObjectBindSourceAdapter is created and linked to the TAdapterBindSource.