On Apr 23, 2012, at 10:52 AM, tequila slammer wrote:
> I have noticed that there is an inconsistency between the 
> View.LongItemClickEventArgs and the View.ItemClickEventArgs. Both have a View 
> Property but on LongItemClickEvent its named V and on ClickItemEvent it is 
> called View. Maybe there is a reason for this and I did not recognized.

There's a "reason"...it's just not a particularly good one. ;-)

Most of Mono.Android.dll is generated from an API description of android..jar:

        http://docs.xamarin.com/android/tutorials/Binding_a_Java_Library_(.jar)

Events are also generated:

        
http://docs.xamarin.com/android/advanced_topics/api_design#Events_and_Listeners

The event generation logic turns event listener method parameters into 
properties on an EventArgs subclass; the AdpaterView.OnItemClickListener 
interface:

        
http://developer.android.com/reference/android/widget/AdapterView.OnItemClickListener.html

generates the AdapterView.ItemClickEventArgs type:

        
http://androidapi.xamarin.com/?link=T%3aAndroid.Widget.AdapterView.ItemClickEventArgs%2f*

If you squint at those two pages, you can see that every parameter in the 
AdapterView.OnItemClickListener.onItemClick() method is translated into a 
PascalCased property on the AdapterView.ItemClickEventArgs type.

This brings us to View.OnLongClickListener:

        
http://developer.android.com/reference/android/view/View.OnLongClickListener.html

For whatever reason, the parameter name is 'v' [0], so we mapped that to a 'V' 
property, as you see. (This is, in fact, erroneous; we should have mapped the 
'v' parameter to the `sender` parameter in the EventHandler, as was done with 
the View.Click event. We'll be fixing this in 4.2.)

 - Jon

[0] Why Google, Why?!

_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to