[Mono-bugs] [Bug 635129] New: View.Tag, View.SetTag(), View.GetTag() don't support C# objects

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Aug 27 11:36:19 EDT 2010


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

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


           Summary: View.Tag, View.SetTag(), View.GetTag() don't support
                    C# objects
    Classification: Mono
           Product: MonoDroid
           Version: SVN
          Platform: 64bit
        OS/Version: Mac System 7
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: mkestner at novell.com
        ReportedBy: amirw2k at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.127 Safari/533.4

I'm trying to set a Tag for a View, but it seems to be overly complicated.

For example, in Java this code works:
Button button;
button.setTag("2");

But in MonoDroid it fails because:
1. There is no implementation of setTag(object) but only of setTag(int key,
Object tag)
2. It won't work even if I use a key: button.SetTag(0, "2"). The compiler
complains that "2" isn't a Java.Lang.Object but it actually is an object!
3. Compiler complains about button.Tag = "2" as well.

I'd like to use any type of C# object as a Tag (not only strings).

*****
Sent as a follow-up to an email from Jonathan Pobst in
monodroid at lists.ximian.com


Reproducible: Always

Steps to Reproduce:
1. Button button;
2. button.SetTag("2");
===OR===
1. Button button;
2. button.Tag = "2";
===OR===
1. Button button;
2. button.Tag = 100;
===OR===
1. Button button;
2. MyClass myClass = new myClass();
3. button.Tag = myClass;
Actual Results:  
Just follow the steps above

Expected Results:  
Compiler error. Application doesn't compile.

-- 
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