|
|
@@ -390,9 +390,10 @@ implementation
|
|
|
|
|
|
|
|
|
Resourcestring
|
|
|
- SErrNotObserver = 'Instance of class %s is not an observer.';
|
|
|
- SErrInvalidPropertyName = '%s is not a valid published property of class %s';
|
|
|
- SErrObjectCannotBeObserved = 'Cannot observe an instance of class %d';
|
|
|
+ SErrNotObserver = 'Instance of class %s is not an observer.';
|
|
|
+ SErrDuplicateObserver = 'Cannot add an instance of class %s twice as observer';
|
|
|
+ SErrInvalidPropertyName = '%s is not a valid published property of class %s';
|
|
|
+ SErrObjectCannotBeObserved = 'Cannot observe an instance of class %s';
|
|
|
sErrInvalidFieldName = 'No fieldname specified for column %d';
|
|
|
sErrInvalidAlignmentChar = 'Invalid alignment character "%s" specified for column %d';
|
|
|
sErrInvalidWidthSpecifier = 'Invalid with "%s" specified for column %d';
|
|
|
@@ -492,7 +493,9 @@ begin
|
|
|
If Not AObserver.GetInterface(SGUIDObserver,I) then
|
|
|
Raise EObserver.CreateFmt(SErrNotObserver,[AObserver.ClassName]);
|
|
|
If not Assigned(FObservers) then
|
|
|
- FObservers:=TFPList.Create;
|
|
|
+ FObservers:=TFPList.Create
|
|
|
+ else if FObservers.IndexOf(aObserver)<>-1 then
|
|
|
+ Raise EObserver.CreateFmt(SErrDuplicateObserver,[AObserver.ClassName]);
|
|
|
FObservers.Add(I);
|
|
|
end;
|
|
|
|