26 May 2019

c#basics event Enum EnumFlags Attributes

C_Enum

We learned about how the events are implemented inside an interface. we learned about .NET Enum type (Enumerator): Enums expose a list of const values. they are actually integer numbers “behind the scenes”. we saw a variety set of Enum api functions which we can use, such as: Parse, GetValues, etc. We saw the Flags attribute which is used to define the Enum as a multi-selection Enum (using binary 1 and 0). we can use methods like HasFlags and pipe ( | ) operator in order to read and write values of the flag Enum instance

More topics covered:

  • Enum static methods
  • Enum in switch-case
  • Enum as a method argument 
  • Enum as a method return value
  • Enum printed as string
  • Enum GetValues and GetNames
  • Enum.TryParse
  • C# Attributes

Links:

Leave a comment

Design a site like this with WordPress.com
Get started