Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6133851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:16:52+00:00 2026-05-23T17:16:52+00:00

I was recently re-reading some old posts on Eric Lippert’s ridiculously awesome blog and

  • 0

I was recently re-reading some old posts on Eric Lippert’s ridiculously awesome blog and came across this tidbit:

A considerable fraction of the keywords of C# are used in two or more
ways: fixed, into, partial, out, in, new, delegate, where, using,
class, struct, true, false, base, this, event, return and void all
have at least two different meanings.

Just for fun my coworkers and I quizzed ourselves and I was able to come up with at least two uses for all but one of those keywords. The one that stumped me is event.

Obviously, using event when declaring a member field of a delegate type turns it into an event (e.g. only add/remove operators are exposed). What’s the other meaning of event?

EDIT (Answer):

Thanks to @Hans Passant I dug up this bit out of the C# spec that explains the other use of event — as (the default) attribute target specifier for attributes on an event (from section 17.2):

An attribute specified on an event declaration that omits event
accessors can apply to the event being declared, to the associated
field (if the event is not abstract), or to the associated add and
remove methods. In the absence of an attribute-target-specifier, the
attribute applies to the event. The presence of the event
attribute-target-specifier indicates that the attribute applies to the
event; the presence of the field attribute-target-specifier indicates
that the attribute applies to the field; and the presence of the
method attribute-target-specifier indicates that the attribute applies
to the methods.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:16:52+00:00Added an answer on May 23, 2026 at 5:16 pm

    As the attribute target specifier. I can’t think of a good reason you would do this:

    [AttributeUsage(AttributeTargets.Event)]
    class MyAttribute : Attribute { }
    
    class foo {
        [event: MyAttribute]
        public event EventHandler goo;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was reading some Java recently and came across something (an idiom?) new to
I was recently reading a question here (some time this week), which I can't
Recently, I am reading some Linux kernel space codes, I see this uint64_t used;
I was recently reading this thread , on some of the worst PHP practices.
I was recently reading about artificial life and came across the statement, Conway’s Game
I was recently reading a book as prep for an interview and came across
I am fairly new to Java, and recently I was reading some material about
I was recently reading this discussion at SO where somebody commented that not all
I was recently reading an article in the bitsquid blog about how to manage
I was reading a forum recently, and saw this comment: So, you see you've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.