The following code in the unit of a package demonstrates how to iterate the names of the environment options in the Delphi IDE
procedure Register;var LOTAServices: IOTAServices; LEnvironmentOptions: IOTAEnvironmentOptions; LOptionNames: TOTAOptionNameArray; LOptionName: TOTAOptionName; SL: TStringList; LKind, LName, Line: string;begin if Supports(BorlandIDEServices, IOTAServices, LOTAServices) then begin LEnvironmentOptions := LOTAServices.GetEnvironmentOptions; LOptionNames := LEnvironmentOptions.GetOptionNames; SL := TStringList.Create; for LOptionName in LOptionNames do begin LKind := GetEnumName(typeinfo(TTypeKind), Ord(LOptionName.Kind)); LName := LOptionName.Name; Line :=Format('<tr>'#13#10+'<td>%s</td>'#13#10+'<td>%s</td>'#13#10+'</tr>'#13#10, [LName, LKind]); SL.Add(Line); end; SL.Sort; Clipboard.AsText := SL.Text; SL.Free; end;end;
In 2017, with the release of Delphi 10.2 Tokyo, Embarcadero introduced a specialized implementation of the Observer pattern into the System.Classes unit. While it has been in the wild for 9 years, it remains a "hidden" architecture for many, primarily because it serves as the invisible engine behind LiveBindings. Other than live bindings, you can also use the Observer pattern as a way to update component settings to the Windows registry, an .ini file, or persist it elsewhere.
System.Classes