[Mono-osx] [MonoMac] Bindings Regression Tests

kjpou kjpou at pt.lu
Mon Nov 29 00:39:17 EST 2010


Here is an example that I hope will explain what I mean.

Let's hope I grabbed the correct one this time.  I have so many 
different tests lying around ....

Kenneth

Here is the text that I sent to the list:

-----------------------------------------------------------------------

Hello all

Here is another attempt at making the Sample's bindings C#-ish.

With doing it this way there are no [Export(XXXX)] used and the Person 
class is very simple.  The binding in IB are mapped directly to Person 
properties.

Implementing the sample this way I was thinking that maybe the 
NSObject2.cs class could be extended with some helper methods of the form:

         public virtual bool CanConvertFrom(Type sourceType)

         public virtual bool CanConvertTo(Type destinationType)

         public virtual object ConvertFrom(object value)

         public virtual object ConvertTo(Type destinationType)

Then in each Class that derives from NSObject could override these 
methods with their specific implementation that corresponds to what the 
class accepts in their respective -> public static implicit operator <- 
implementations.

At the very least a default type converter in the genre of the provided 
MonoMacTypeConverter.cs class provided.  That way developers would have 
a lot of the implementation hidden as was suggested below.

Just throwing some ideas out there.

Kenneth




On 11/29/10 6:07 AM, Miguel de Icaza wrote:
>
>
>     Concerning the SetValueForKey and GetValueForKey, those were
>     working as well and now are not.  Shouldn't we be able to override
>     those methods and get it to work the same way?  In the last
>     PopupBinding sample program it worked fine as well and now it just
>     blows up with the error message below.
>
>     You can see the error from the last PopupBindings project that I
>     sent to the list.  It uses reflection to get and set the
>     properties instead of [Connect] or [Export].
>
>
> I am not sure I follow the question here at all.
>
> Miguel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20101129/e896cf44/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PopupBindings.zip
Type: application/zip
Size: 2102918 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20101129/e896cf44/attachment-0001.zip 


More information about the Mono-osx mailing list