From: <ah...@us...> - 2007-11-15 15:29:36
|
Revision: 11575 http://jvcl.svn.sourceforge.net/jvcl/?rev=11575&view=rev Author: ahuser Date: 2007-11-15 07:28:55 -0800 (Thu, 15 Nov 2007) Log Message: ----------- Finished GetProtectedObjectEvent and SetProtectedObjectEvent Modified Paths: -------------- trunk/jvcl/run/JvJCLUtils.pas Modified: trunk/jvcl/run/JvJCLUtils.pas =================================================================== --- trunk/jvcl/run/JvJCLUtils.pas 2007-11-15 12:49:32 UTC (rev 11574) +++ trunk/jvcl/run/JvJCLUtils.pas 2007-11-15 15:28:55 UTC (rev 11575) @@ -1413,22 +1413,25 @@ begin Info := Instance.GetType.GetEvent(EventName, BindingFlags.NonPublic or BindingFlags.Instance); if Info <> nil then - { TODO : Implement } - //Info.RemoveEventHandler(); + SetMethodProp(Instance, Info, Ev); end; end; function GetProtectedObjectEvent(Instance: TObject; const EventName: string): Delegate; var Info: EventInfo; + M: TMethod; begin Result := nil; if Instance <> nil then begin Info := Instance.GetType.GetEvent(EventName, BindingFlags.NonPublic or BindingFlags.Instance); if Info <> nil then - { TODO : Implement } - //Info.RemoveEventHandler(); + begin + M := GetMethodProp(Instance, Info); + if not M.IsEmpty then + Result := System.Delegate.CreateDelegate(Info.EventHandlerType, M.Data, MethodInfo(M.Code)); + end; end; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |