[Mono-osx] Working with delegates

Florian Heiber fh at rtfnt.com
Tue Nov 30 11:08:03 EST 2010

Thanks for your hints. So this is basically the way you choose when it comes to implementing NSTableView data sources as well, right?

Just for the background: Is there nothing like the concept of protocols on the .NET-side?


On 30.11.2010, at 16:40, Miguel de Icaza wrote:

> I know two possibilities: use object of separate class which will
> inherit from NSWindowDelegate, overriding specific methods; or mark
> [Export("windowShouldClose:...")] methods in your controller class.
> There may be other ways, though.
> That pretty much covers it.
> To recap, if you want to go strongly typed, you have two options: (a) inherit from NSWindowDelegate and override methods or (b) Use C# events exposed on the NSWindow class.
> If you do not mind going loosely typed, then all you have to do is create any class that derives from NSObject and decorate the methods with [Export] very much like we do in the source code for MonoMac itself.
> Miguel
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20101130/9980a501/attachment.html 

More information about the Mono-osx mailing list