Is it possible to define customer attributes in a J# application? I've seen
it done in C#, but i tried it in J# and it wouldn't work. I tried the
following code:
/** @attribute System.AttributeUsage (System.AttributeTargets.Assembly) */
public class BuildLocationAttribute extends Attribute
{
private String BuildLocation;
public BuildLocationAttribute(String bl){BuildLocation = bl;}
public String getBuildLocation(){return BuildLocation;}
}
and I get an error saying "Cannot author attributes, enums or value types".
It doesn't seem to like the fact that i'm extending from the Attribute class
Is there a way around this? I just want to state the build location inside
the application exe's Version Tab in the file properties. Any help with this
would be greatly appreciated =)
--
http://www.hungryshadow.com
Avid J# Programmer - 28 Jan 2005 21:59 GMT
oops, small typo, it should say custom instead of customer on the first line
> Is it possible to define customer attributes in a J# application? I've seen
> it done in C#, but i tried it in J# and it wouldn't work. I tried the
[quoted text clipped - 16 lines]
> --
> http://www.hungryshadow.com
Lars-Inge T?nnessen [VJ# MVP] - 28 Jan 2005 22:56 GMT
> Is it possible to define customer attributes in a J# application? I've
> seen
Please see:
http://msdn.microsoft.com/library/en-us/dv_vjsharp/html/vjgrfUnsupportedNETFeatu
res.asp
Regards,
Lars-Inge T?nnessen
Bruno Jouhier [MVP] - 30 Jan 2005 11:49 GMT
You cannot do it with VS 2003 (you can "consume" attributes in J# but you
cannot "author" them).
You will be able to do it with the upcoming VS 2005.
Bruno.
"Avid J# Programmer" <AvidJProgrammer@discussions.microsoft.com> a ?crit
dans le message de news:
88A95F0A-90EB-435D-8072-EC3EFAE16978@microsoft.com...
> Is it possible to define customer attributes in a J# application? I've
> seen
[quoted text clipped - 20 lines]
> --
> http://www.hungryshadow.com
SamAbo - 28 Feb 2005 23:43 GMT
I compiled the code using VS 2005, and it worked. I made a tiny change though
by using System.Attribute instead od Attribute:
/** @attribute System.AttributeUsage (System.AttributeTargets.Assembly) */
public class BuildLocationAttribute extends System.Attribute
{
private String BuildLocation;
public BuildLocationAttribute(String bl) { BuildLocation = bl; }
public String getBuildLocation() { return BuildLocation; }
}
> You cannot do it with VS 2003 (you can "consume" attributes in J# but you
> cannot "author" them).
[quoted text clipped - 29 lines]
> > --
> > http://www.hungryshadow.com