What do the brackets mean in c#? I mean these" [ ] when they are not referencing arrays

I am trying to read some C# code that someone else has written.

I am coming across this line and am having trouble understanding it.

        [System.Xml.Serialization.XmlIgnore()]

in

    public class Schedule
    {
        public struct Interval
        {
            public int length;
            public string unit;
        }
        [System.Xml.Serialization.XmlIgnore()]
        public bool intervalSpecified;
        public Interval interval;
}

I am weak at Serialization, but that is another issue. I was thinking that [] was only an array symbol, but System.Xml.Serialization.XmlIgnore doesn't seem to be part of any array. If I remove the [], then I get a "Invalid Token" error. So, essentially, what does the [] do?

Thanks!
freezegravityAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Malik1947Commented:
look at this article
http://msdn2.microsoft.com/en-us/library/a3hd7ste(vs.80).aspx

the square brackets seem to be referring to a "pointer" or a token to something else in the application.
0
JimBrandleyCommented:
Statements like that above methods, properties or members are called Attributes. In this case, it acts like qualifier, and will cause a serializer to ignore the boolean member called intervalSpecified. You can also define and create your own custom attributes that can be very useful when using reflection into your own assemblies.

Jim
0
Liquid90605Commented:
That is called an Attribute, that one is specifically an XML Serialization Attribute. Those Markers are used at specify certain things. That attribute in particular is used to tell a the program at runtime Not To Include That Data Member In Serialization.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SolutionsCSCommented:
Liquid90605:Perfect answer go with it.
0
freezegravityAuthor Commented:
After reading the answer, I still had a few questions. However, I looked them up and the answer is correct.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.