Solved

C# Syntax Question

Posted on 2014-03-21
2
278 Views
Last Modified: 2014-03-21
In doing some code review I have encountered something I'm not familiar with:

namespace test
{
[I1ActiveReport("/Reports/..., ReportAccess.userAccount, "Description"]
   public class Name : I1ActiveReport
   {
      ...
   }
}

And then again in a different example, inside a property:

protected className I1Parameters
{
[System.Diagnostics.DebuggerStepThrough]
   get
   {
       ...
    }
}

What do those brackets [  ]   do?
0
Comment
Question by:pzozulka
2 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 250 total points
Comment Utility
It's an attribute. Attributes are kind of like meta-programming. They have a variety of uses, and are more of an advanced topic--at least creating them is.
0
 
LVL 62

Assisted Solution

by:Fernando Soto
Fernando Soto earned 250 total points
Comment Utility
Hi pzozulka;

They are attributes associated with a class, property function and so on and during execution can be accessed using reflections. Please see MS Documentation.

Attributes (C# and Visual Basic)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now