csharp,delphi: Switch callback sender parameter to device type