July 2018
Beginner to intermediate
668 pages
16h 29m
English
Duck typing is a very broad topic and allows you to do wonderful things with a few lines of code. In this recipe's code, there is a bonus recipe project called DuckTypingUsingRTTIExtended.dproj, which contains an advanced version of the base recipe. It uses a fluent interface, allows you to select the components that you want to change, and defines what type of change to make on those components; something similar to the following code snippets. Set all the Caption properties of the components on the form to On All Captions:
Duck(Self).All.SetProperty('Caption').ToValue('On All Captions');
Set all the Text properties to 'Hello There' for the components with a name starting with 'Edit', using an anonymous method as a filter ...
Read now
Unlock full access