[Mono-osx] [MonoMac] PopupBindings Sample

Miguel de Icaza miguel at novell.com
Tue Nov 23 09:40:50 EST 2010


Hello,

I at first write the Person.cs class with C# native type but what I found
> myself doing all the time was converting to and from native to NSString all
> over the place so thought that made the code messy.  For instance in the
> SetValueForKey method.  If those methods should be using string instead of
> NSString I could change them when I find them.
>

We should change that, and then introduce a "LowLevelSetValueForKey" if we
need, like we do in NSDictionary for those that want to pass handles
directly.

I totally agree with you on the C# 3 features.  One of the questions that I
> was going to post was how to get around the NSDictionary use and convert
> back and forth to native Dictionary types easily.  I guess I am missing that
> part to start using more of the C# features.  An example would definitely be
> welcome on how to go about that.
>

The good news is that NSDictionary implements IDictionary, so we can always
treat NSDictionary in a .NET way.

The problem is that it comes with some overhead, so it might be a good idea
to write NSDictionary->Dictionary and back helper methods.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20101123/9a872495/attachment.html 


More information about the Mono-osx mailing list