Delphi annotations

我的未来我决定 提交于 2019-12-24 17:19:56

问题


I was looking at the implementation of the TCustomComboBoxEx object since I need to create a custom combo box in delphi and I was triying to get what I needed, when suddenly I came over this piece of code:

...
[UIPermission(SecurityAction.LinkDemand, Window=UIPermissionWindow.AllWindows)]
procedure TCustomComboBoxEx.CreateWnd;
var
  ChildHandle: THandle;
  I: Integer;
  StrEnum: IEnumString;
  EditHandle: THandle;
begin
...

What is that upon the procedure name? What is its purpose?

Code like that work in delphi 2007 (my code needs to keep compatibility with that version)


回答1:


Those are attributes. They were added to the standard VCL controls for support of the VCL.NET (which no longer exists, BTW). Attributes are supported now with Delphi 2010 and up.

You can read more in the Delphi documentation wiki



来源:https://stackoverflow.com/questions/4088811/delphi-annotations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!