2
0
Эх сурвалжийг харах

* isimplementorof/referenceinfo, bug #10567

git-svn-id: trunk@9647 -
marco 17 жил өмнө
parent
commit
408d5831ea

+ 18 - 0
rtl/objpas/classes/compon.inc

@@ -24,6 +24,24 @@ begin
     Result:=TComponent(FComponents.Items[Aindex]);
 end;
 
+function TComponent.IsImplementorOf (const Intf:IInterface):boolean;
+var ref : IInterfaceComponentReference;
+begin
+ result:=assigned(intf) and supports(intf,IInterfaceComponentReference,ref);
+ if result then
+   result:=ref.getcomponent=self;
+end;
+
+procedure TComponent.ReferenceInterface(const intf:IInterface;op:TOperation);
+var ref : IInterfaceComponentReference;
+    comp : TComponent;
+begin
+ if assigned(intf) and supports(intf,IInterfaceComponentReference,ref) then
+   begin
+    comp:=ref.getcomponent;
+    comp.notification(self,op); 
+   end;
+end;
 
 Function  TComponent.GetComponentCount: Integer;