mail-archives/mono-osx/2010-November/003421.html

104 строки
3.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-osx] Working with delegates
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20Working%20with%20delegates&In-Reply-To=AANLkTi%3DFDkHF2p_3Dz7bwzi5MTLp7BaC%3D4MXWvXtG2XR%40mail.gmail.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="003418.html">
<LINK REL="Next" HREF="003425.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-osx] Working with delegates</H1>
<B>Florian Heiber</B>
<A HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20Working%20with%20delegates&In-Reply-To=AANLkTi%3DFDkHF2p_3Dz7bwzi5MTLp7BaC%3D4MXWvXtG2XR%40mail.gmail.com"
TITLE="[Mono-osx] Working with delegates">fh at rtfnt.com
</A><BR>
<I>Tue Nov 30 11:08:03 EST 2010</I>
<P><UL>
<LI>Previous message: <A HREF="003418.html">[Mono-osx] Working with delegates
</A></li>
<LI>Next message: <A HREF="003425.html">[Mono-osx] Working with delegates
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#3421">[ date ]</a>
<a href="thread.html#3421">[ thread ]</a>
<a href="subject.html#3421">[ subject ]</a>
<a href="author.html#3421">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>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?
&#8211;f
On 30.11.2010, at 16:40, Miguel de Icaza wrote:
&gt;<i>
</I>&gt;<i> I know two possibilities: use object of separate class which will
</I>&gt;<i> inherit from NSWindowDelegate, overriding specific methods; or mark
</I>&gt;<i> [Export(&quot;windowShouldClose:...&quot;)] methods in your controller class.
</I>&gt;<i>
</I>&gt;<i> There may be other ways, though.
</I>&gt;<i>
</I>&gt;<i> That pretty much covers it.
</I>&gt;<i>
</I>&gt;<i> 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.
</I>&gt;<i>
</I>&gt;<i> 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.
</I>&gt;<i>
</I>&gt;<i> Miguel
</I>&gt;<i> _______________________________________________
</I>&gt;<i> Mono-osx mailing list
</I>&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">Mono-osx at lists.ximian.com</A>
</I>&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">http://lists.ximian.com/mailman/listinfo/mono-osx</A>
</I>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <A HREF="http://lists.ximian.com/pipermail/mono-osx/attachments/20101130/9980a501/attachment.html">http://lists.ximian.com/pipermail/mono-osx/attachments/20101130/9980a501/attachment.html</A>
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="003418.html">[Mono-osx] Working with delegates
</A></li>
<LI>Next message: <A HREF="003425.html">[Mono-osx] Working with delegates
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#3421">[ date ]</a>
<a href="thread.html#3421">[ thread ]</a>
<a href="subject.html#3421">[ subject ]</a>
<a href="author.html#3421">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-osx">More information about the Mono-osx
mailing list</a><br>
</body></html>