• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what does this mean?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what does this mean? is it using enums here ? where does it get and set from? please let me know this

 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's using a C# mechanism called "anonymous properties". What it does is create a private member variable behing the scenes, and generate corresponding getters/setters for the properties. It's a nice shorthand - I was never particularly sold on the idea of properties as an improvement on get/set methods until this was introduced.

For example, this:

Is roughly equivalent to this:

There are no Enums unless one of the types you're referring to (e.g. NoteType) is an enum.

(I've formatted your code to make it easier to follow - you can do that yourself: see UseCodeTags).
 
spars anu
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you also explain me what does ?? mean in the following code:

 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's just C# property initializer syntax. These are standard features of the language (as of C#3.0, I think) - they'll be included in any introductory book on the language. Have a guess - what does it look like it does?
 
spars anu
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
public enum ActionKey
{
[EnumMember]
FraudBatch = 139,
}
I defined enum in this way.Can i implement in the above way
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what you mean. Have you tried it? That's usually the best and most reliable way of finding out if you can do something.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic