Enums

Introduction

This page is about enumerations included in LeoCorpLibrary.

The Enums namespace

Starting with version 4.4, all enums of LeoCorpLibrary have been moved to their own dedicated namespace. If you are upgrading from an older version of LeoCorpLibrary, you'll need to include the LeoCorpLibrary.Enums or LeoCorpLibrary.Core.Enums namespace if you want to use any enumerations:

C#

using LeoCorpLibrary.Enums;

VB

Imports LeoCorpLibrary.Enums

Note

In this documentation, most of the enumerations are available since version 4.4, in fact, most of these enumerations are available from the first versions of LeoCorpLibrary.

a. WindowsVersion

This enumeration is available in version 1.9 and higher.

Compatibility
FrameworksLeoCorpLibraryLeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

The WindowsVersion enumeration is used to represent all major versions of Windows. It has the following values:

  • Windows7
  • Windows8
  • Windows81
  • Windows10
  • Windows11
Enumeration valueMeaning
WindowsVersion.Windows7Microsoft Windows NT 6.1
WindowsVersion.Windows8Microsoft Windows NT 6.2
WindowsVersion.Windows81Microsoft Windows NT 6.3
WindowsVersion.Windows10Microsoft Windows NT 10.0
WindowsVersion.Windows11Microsoft Windows NT 10.0.22000 and higher

Go to top

b. TimeUnits

This enumeration is available in version 4.3 and higher.

Compatibility
FrameworksLeoCorpLibraryLeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

The TimeUnits enumeration is used to represent different time units. It has the following values:

  • Milliseconds
  • Seconds
  • Minutes
  • Hours
  • Days
Enumeration valueMeaning
TimeUnits.MillisecondsRepresent the Milliseconds time unit
TimeUnits.SecondsRepresent the Seconds time unit
TimeUnits.MinutesRepresent the Minutes time unit
TimeUnits.HoursRepresent the Hours time unit
TimeUnits.DaysRepresent the Days time unit

Go to top

c. SystemThemes

This enumeration is available in version 4.4 and higher.

Compatibility
FrameworksLeoCorpLibraryLeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

The SystemThemes enumeration is used to represent different Windows themes. It has the following values:

  • Dark
  • Light
  • Unknown
Enumeration valueMeaning
SystemThemes.DarkThe Windows theme is dark
SystemThemes.LightThe Windows theme is light
SystemThemes.UnknownThe theme of the current operating system cannot be determined

Go to top

d. OperatingSystems

This enumeration is available in version 4.4 and higher.

Compatibility
FrameworksLeoCorpLibraryLeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

The OperatingSystems enumeration is used to represent different operating systems. It has the following values:

  • Windows
  • macOS
  • Linux
  • Unknown
Enumeration valueMeaning
OperatingSystems.WindowsThe Windows operating system
OperatingSystems.macOSThe macOS operating system
OperatingSystems.LinuxThe Linux operating system/Linux based distribution
OperatingSystems.UnknownThe current operating system cannot be determined

Go to top

e. UnitType

This enumeration is available in version 4.4 and higher.

Compatibility
FrameworksLeoCorpLibraryLeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

The UnitTime enumeration is used to represent different storage units (kb, mb, gb...). It has the following values:

  • Byte
  • Kilobyte
  • Megabyte
  • Gigabyte
  • Terabyte
  • Petabyte

Go to top

f. ControlAlignment

This enumeration is available in version 4.4 and higher.

Compatibility
FrameworksLeoCorpLibraryLeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

The ControlAlignment enumeration is used to represent different System.Windows.Forms.Control alignment. It has the following values:

  • Horizontal
  • Vertical
  • Both
Enumeration valueMeaning
ControlAlignment.HorizontalThe control will be aligned horizontally
ControlAlignment.VerticalThe control will be aligned vertically
ControlAlignment.BothThe control will be aligned horizontally and vertically

Note

This enumeration is made for Windows Forms project.

Go to top

g. StatusCodeType

This enumeration is available in version 4.4 and higher.

Compatibility
FrameworksLeoCorpLibraryLeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

The StatusCodeType enumeration is used to represent different status codes when making a request to a website. It has the following values:

  • Informational
  • Success
  • Redirection
  • ClientError
  • ServerError

Learn more about status codesopen in new window.

Enumeration valueMeaning
StatusCodeType.InformationalThe status code is similar to 1xx.
StatusCodeType.SuccessThe status code is similar to 2xx.
StatusCodeType.RedirectionThe status code is similar to 3xx.
StatusCodeType.ClientErrorThe status code is similar to 4xx.
StatusCodeType.ServerErrorThe status code is similar to 5xx.

Here's an example of usage:

C#

StatusCodeType statusType = NetworkConnection.GetStatusCodeType("https://leocorporation.dev");

switch (statusType)
{
    case StatusCodeType.Informational:
        Console.WriteLine("Information message.");
        break;
    case StatusCodeType.Success:
        Console.WriteLine("Success message.");
        break;
    case StatusCodeType.Redirection:
        Console.WriteLine("Redirection message.");
        break;
    case StatusCodeType.ClientError:
        Console.WriteLine("Client error message.");
        break;
    case StatusCodeType.ServerError:
        Console.WriteLine("Server error message.");
        break;
}

VB

Dim statusType As StatusCodeType = NetworkConnection.GetStatusCodeType("https://leocorporation.dev")

Select Case statusType
    Case StatusCodeType.Informational
        Console.WriteLine("Information message.")
    Case StatusCodeType.Success
        Console.WriteLine("Success message.")
    Case StatusCodeType.Redirection
        Console.WriteLine("Redirection message.")
    Case StatusCodeType.ClientError
        Console.WriteLine("Client error message.")
    Case StatusCodeType.ServerError
        Console.WriteLine("Server error message.")
End Select

Go to top

h. PasswordPresets

This enumeration is available in version 4.4 and higher.

Compatibility
FrameworksLeoCorpLibraryLeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

The PasswordPresets enumeration is used to represent the complexity of a password. It has the following values:

  • Simple
  • Complex
Enumeration valueMeaning
PasswordPresets.SimpleThis preset will generate a password with simple characters (abc, 123).
PasswordPresets.ComplexThis preset will generate a strong password with unusual, hard and complex characters (abc, 123, àçé, {[@)

Go to top

i. PasswordStrength

This enumeration is available in version 4.4 and higher.

Compatibility
FrameworksLeoCorpLibraryLeoCorpLibrary.Core
.NET 6
.NET 5
.NET Core 3.1
.NET Framework 4.5

The PasswordStrength enumeration is used to evaluate how strong a password is. It has the following values:

  • VeryGood
  • Good
  • Medium
  • Low
  • Unknown
Enumeration valueMeaning
PasswordStrength.VeryGoodThe password is uncommon, strong
PasswordStrength.GoodThe password is complex, could be stronger
PasswordStrength.MediumThe password could be more complex.
PasswordStrength.LowThe password is too easy, not strong, you shouldn't use it
PasswordStrength.UnknownCannot determine the strength of the password

Go to top