473,386 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Question about the word Attribute in attribute class names

KJ
Hello All,

I am wondering about attributes: in the Framework, they all seem to end
in the word Attribute, for example, BindableAttribute. But when you use
them, you can either code Bindable(true) or BindableAttribute(true). I
don't know of any other classes that work this way. Is this a "magic"
behavior of attribute classes? What is the reasoning for this?

Sep 15 '06 #1
2 1256
This is a feature of the C# compiler. If the attribute class ends with
"Attribute" (and it should, as per the naming guidelines), then you can use
it without the "Attribute" part at the end.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"KJ" <n_**********@mail.comwrote in message
news:11********************@e3g2000cwe.googlegroup s.com...
Hello All,

I am wondering about attributes: in the Framework, they all seem to end
in the word Attribute, for example, BindableAttribute. But when you use
them, you can either code Bindable(true) or BindableAttribute(true). I
don't know of any other classes that work this way. Is this a "magic"
behavior of attribute classes? What is the reasoning for this?

Sep 15 '06 #2
KJ
Thanks Nicholas.

Nicholas Paldino [.NET/C# MVP] wrote:
This is a feature of the C# compiler. If the attribute class ends with
"Attribute" (and it should, as per the naming guidelines), then you can use
it without the "Attribute" part at the end.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"KJ" <n_**********@mail.comwrote in message
news:11********************@e3g2000cwe.googlegroup s.com...
Hello All,

I am wondering about attributes: in the Framework, they all seem to end
in the word Attribute, for example, BindableAttribute. But when you use
them, you can either code Bindable(true) or BindableAttribute(true). I
don't know of any other classes that work this way. Is this a "magic"
behavior of attribute classes? What is the reasoning for this?
Sep 15 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
50
by: Will McGugan | last post by:
Hi, Why is that a tuple doesnt have the methods 'count' and 'index'? It seems they could be present on a immutable object. I realise its easy enough to convert the tuple to a list and do this,...
1
by: Jeffrey Borkent | last post by:
Hi There, Please let me rephrase the problem as many people misunderstood what i was trying to ask. I know that the __init__ is the class constructor, that was not my question. under the...
6
by: Alex Hunsley | last post by:
I know that I can catch access to unknown attributes with code something like the following: class example: def __getattr__(self, name): if name == 'age': return __age else: raise...
2
by: Michael C | last post by:
Hi all, I'm playing around with an XML structured like this: <root> <subone> <setting name = "xyz" value = "100" /> </subone> <subtwo> <list name = "abcde" value = "1000" />
11
by: Random | last post by:
I'm confused about the proper use and usefulness of namespaces. I beleive I understand the purpose is so the developer can put classes within namespaces to essentially organize your code. And I...
0
by: RYoung | last post by:
Hi all, Hope no one minds this long message, but I'm puzzled: --------------- The following is a shortened version of schema located at...
14
by: JoeC | last post by:
I have been writing games and I also read about good programming techniques. I tend to create large objects that do lots of things. A good example I have is a unit object. The object controls...
14
by: MartinRinehart | last post by:
Working on parser for my language, I see that all classes (Token, Production, Statement, ...) have one thing in common. They all maintain start and stop positions in the source text. So it seems...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.