我有一個簡單的界面接口和屬性顯示
ISomeProperties = interface
['{3AD52E4E-5190-4ABE-8AFC-062295E3A352}']
function GetPort: integer;
procedure SetPort(const Port: integer);
end;
GetFunction和SetFunction是在代碼complection可見。但在我添加這樣的屬性後
ISomeProperties = interface
['{3AD52E4E-5190-4ABE-8AFC-062295E3A352}']
function GetPort: integer;
procedure SetPort(const Port: integer);
property Port: integer read GetPort write SetPort;
end;
GetPort和SetPort方法只消失propert端口可見 - 很好。
現在我實現一個接口
TSomeProperties = class(TInterfacedObject, ISomeProperties)
private
function GetPort: integer;
procedure SetPort(const Port: integer);
end;
但物業端口不是從實現接口的類可見!這是一種理想的行爲,或者我做錯了什麼?
聲明屬性不會使方法不可見。 – 2013-02-19 17:22:11
@DavidHeffernan對不起,我的錯。代碼補全中不可見。這是正確的還是我的德爾福愚弄我? – JustMe 2013-02-19 18:28:42