[Mono-bugs] [Bug 692216] New: DialogClickEventArgs kind of needs integer value for "Which"

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri May 6 05:34:16 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=692216

https://bugzilla.novell.com/show_bug.cgi?id=692216#c0


           Summary: DialogClickEventArgs kind of needs integer value for
                    "Which"
    Classification: Mono
           Product: MonoDroid
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Minor
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: mkestner at novell.com
        ReportedBy: aenomoto at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Right now DialogClickEventArgs.Which is represented as DialogInterfaceButton
enumeration value, but the example code below shows that it is not only used as
an enumeration:

--------
using System;

using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Android.Preferences;
using Android.Util;

namespace MonoAndroidApplication1
{
    [Activity(Label = "MonoAndroidApplication1", MainLauncher = true, Icon =
"@drawable/icon")]
    public class Activity1 : Activity
    {
        int count = 1;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle); 

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            var db = new AlertDialog.Builder(this);
            db.SetTitle("Select Music Folder");

            string [] vars = {"A", "B", "C", "D"};
            db.SetItems(vars, delegate(object o, DialogClickEventArgs e) {
                Android.Util.Log.Debug("TEST", "selected item: " + (int)
e.Which);
            });
            var dlg = db.Show();
        }
    }
}

--------

When touched "D" in the list on the dialog, this prints like:

"TEST( 9045): selected item: 3"

As the repro above shows, it could be simply cast to int, but would be nicer if
there is additional property for int value or whatever in better shape.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list