DelphiBasics
  Home  |  Delphi .net Home  |  System NameSpace
 .NET Framework
 Namespace References

 System
 
  Array  Class 
  Boolean  Structure 
  Buffer  Class 
  Byte  Structure 
  Char  Structure 
  Console  Class 
  Convert  Class 
  DateTime  Structure 
  DayOfWeek  Enumeration 
  Decimal  Structure 
  Double  Structure 
  Enum  Class 
  Environment  Class 
  Exception  Class 
  ICloneable  Interface 
  Int16  Structure 
  Int32  Structure 
  Int64  Structure 
  Math  Class 
  Object  Class 
  OperatingSystem  Class 
  Random  Class 
  SByte  Structure 
  Single  Structure 
  String  Class 
  TimeSpan  Structure 
  UInt16  Structure 
  UInt32  Structure 
  UInt64  Structure 
  Version  Class 
 System.Collections
 System.Globalization
 System.IO

 Articles and Tutorials

 Overview of .NET
 Delphi and .NET
 Winform Applications
 ASP .Net Applications
 php Web Services
 Framework Collections
 Framework String Handling
 Framework Files and Folders


 
 
  System.Enum Class
 
 Description
Enumerations in .Net are similar to enumerations in native Delphi. They provide a means of naming constant values, with a particular enumeration value only allowed to have one of the named values.
 
For example, the DayOfWeek enumeration has the following contents :
 
Sunday = 0
Monday = 1
Tuesday = 2
Wednesday = 3
Thursday = 4
Friday = 5
Saturday = 6

 
Unlike native Delphi, .Net Enumerations can be optionally treated as Flags. They therefore become equivalent to Sets in native Delphi. An enum is a set of flags when the [FlagsAttribute] is specified immediately prior to the Enum definition :
 
type
 
[FlagsAttribute]
 
Flags = (Sexy, Clever, Handsome);
 Methods
CompareTo  Compare the current enum value to another enum
Equals  Determines if the current enum value equals another
Format  Formats the current Enum value into a string
GetName  Gets the name of a specified enumeration value
GetNames  Gets a list of the names of a specified enumeration type
GetValues  Gets a list of the names of a specified enumeration type
IsDefined  Determines whether an object has a valid enumerated value
Parse  Builds an enum object from an enum type and a string of enum values
ToObject  Creates an Enum object of the specified type and value
ToString  Converts the current Enum value to a string


 Microsoft MSDN links
 
System
System.enum
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page