Bug 1773 - Enum Method
Summary: Enum Method
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 1.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-10-28 15:31 UTC by Jonathan Pobst
Modified: 2011-11-04 09:05 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Jonathan Pobst 2011-10-28 15:31:34 UTC
new AlertDialog.Builder (this, (int)DialogThemes.Traditional)

should be Android.App.DialogThemes instead of int
Comment 1 Jonathan Pobst 2011-10-28 16:19:51 UTC
Also:

AlertDialog.SetButton - whichButton should be DialogInterfaceButton


DialogClickEventArgs.Which is DialogInterfaceButton, but should be int, because in this context, it will also tell you which item was clicked in a list, which does not correspond to the enum
Comment 2 Atsushi Eno 2011-11-03 08:26:13 UTC
On DialogThemes, I noticed that I shouldn't have converted that from int to enum. I'm going to revert them and AlertDialog.Builder.ctor() will be kept as is.

Here is the reason: there is AlertDialog.ctor (Context context, int theme). It is from API Level 1. The int fields in AlertDialog were actually introduced in API Level 11. So, if we use enums for those values, it is now impossible to use that constructor in the earlier platforms.
Comment 3 Atsushi Eno 2011-11-04 09:05:22 UTC
Fixed DialogClickEventArgs.Which issue too. Actually reverted lots of similar "Which" stuff and removed DialogInterfaceButton enum (otherwise it will become just unusable).