Custom Attributes

17 views
Skip to first unread message

Aguxtin

unread,
Nov 24, 2014, 4:44:21 PM11/24/14
to shar...@googlegroups.com
Are custom attributes not currently supported ? 

  [JsType(JsMode.Clr)]
  class SomethingAttrib : Attribute
  {
    public string Name { get; set; }
    public SomethingAttrib(string name)
    {
      this.Name = name;
    }
  }


  [JsType(JsMode.Clr]
  public class Client 
  {
    [SomethingAttrib("Lorem")]
    jQuery _btnDemo;
 }


The bold part is not yielling any JS, therefore we lost that attribute. THanks !

Dan-el Khen

unread,
Nov 25, 2014, 4:54:33 AM11/25/14
to shar...@googlegroups.com
I believe that setting attributes on fields is not supported in jsclr, can you try changing your _btnDemo field into a property?

Cheers
Dan-el

--
You received this message because you are subscribed to the Google Groups "SharpKit Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sharpkit+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Agustin Garzon

unread,
Nov 25, 2014, 11:57:41 AM11/25/14
to shar...@googlegroups.com
Santas Compilaciones, Batman !

The member being a property instead of a field produced what looks like a functional javascript. 
I have to test it, and also confirm if the attribute can be exploited through reflection... or not.

Thanks :)

--
You received this message because you are subscribed to a topic in the Google Groups "SharpKit Support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sharpkit/ESz4H1kBjt0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sharpkit+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Agustin.

"You only need to change your direction," said the cat, and ate it up.

Dan-el Khen

unread,
Nov 25, 2014, 11:58:24 AM11/25/14
to shar...@googlegroups.com
No prob :-) Let me know if you need any help with this.
Cheers
D.
Reply all
Reply to author
Forward
0 new messages