heavy rocker dude
heavy rocker dude

Reputation: 2301

What does [input] mean in C#?

I saw this in saample source code project.

    [Input]
    public int Length { get; set; }

It was defined in a class:

    namespace PowerLanguage.Strategy
    {
        public class MovAvg_Cross_SE : SignalObject
        {
   ....

What does the [input] mean?

Upvotes: 0

Views: 245

Answers (2)

Andy
Andy

Reputation: 8562

Its an attribute. The full class name is InputAttribute. Code can reflect over properties and discover attributes, which may modify the behavior or trigger other functionality. Another example of adding functionality is Data Annotations, which when used with something that will discover and run them, can be thought of as adding behavior. You can read more about attributes here (while older, the concept is the same).

Upvotes: 0

Reacher Gilt
Reacher Gilt

Reputation: 1813

That's an Attribute -- a way to declare information about your source code. What your particular attribute means depends on the namespace of the attribute. You can hover over it to get information on it or (if the declaration is part of your project) ctrl-click on it to see its source.

Upvotes: 5

Related Questions