【发布时间】:2015-07-25 08:04:07
【问题描述】:
我在 Delphi XE5 中有 2 个课程,并将一个传递给另一个:
TfrmBaseList = class(TForm)
private
FListOwner: TSystemBaseList<TSystemColumnEntity>;
public
constructor Create(AListOwner: TSystemBaseList<TSystemColumnEntity>); virtual;
end
TSystemBaseList<T: TSystemColumnEntity> = class(TPersistent)
public
procedure Execute;
property SelectedValues: TObjectList<T> read
end;
procedure TSystemBaseList<T>.Execute;
var
frmList: TfrmBaseList;
begin
//frmList := TfrmBaseList.Create(Self<T>)
//frmList := TfrmBaseList.Create(Self<TSystemColumnEntity>)
frmList := TfrmBaseList.Create(???????)
end;
如何将 TSystemBaseList 传递给 TfrmBaseList 类的构造函数?
这个构造函数只创建一个Form然后将AListOwner赋值给FListOwner, 我可以将此构造函数更改为这样的属性吗:
TfrmBaseList = class(TForm)
private
FListOwner: TSystemBaseList<TSystemColumnEntity>;
public
property ListOwner: TSystemBaseList<TSystemColumnEntity> read FListOwner write FListOwner;
end
我该如何设置?
【问题讨论】: