delphi - 如何在 delphi 中将属性标记为已弃用?

标签 delphi properties deprecated

我想将 Delphi 中的一个属性标记为已弃用,以便稍后删除。根据 Delphi 文档,不推荐使用可以附加到任何声明中,但它不适用于属性。有办法做到这一点吗?

这是我尝试过的:

property SomeProp: string
  read   FSomeProp
  write  SetSomeProp; deprecated 'Use SomeOtherProp instead';

最佳答案

不,这是不可能的。根据the documentation ,

The 'hint' directives platform, deprecated, and library may be appended to any declaration. These directives will produce warnings at compile time. Hint directives can be applied to type declarations, variable declarations, class, interface, and structure declarations, field declarations within classes or records, procedure, function, and method declarations, and unit declarations.

关于delphi - 如何在 delphi 中将属性标记为已弃用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9499919/

相关文章:

android webview setDatabasePath 已弃用

delphi - 如何以编程方式连接和重新连接 USB 设备

Delphi TPageControl 不响应选项卡上的点击

delphi - 是否有 DCC32.exe 命令行开关使其使用/创建 .dcu 文件?

c# - 在 PropertyGrid C# 中显示 DebuggerDisplay

javascript - 将属性附加到函数对象是否安全/可接受?

javascript - JS如何向对象添加价格并通过参数传递

methods - .aidl 文件中的方法是否有 "@Deprecated"注释?

java - 使用 EnumSet(不同类型)作为参数的相同方法名称

multithreading - 如何从单独的单元执行线程同步