Class StringEnumeration
A Smart Enumeration class that includes additional 'Batteries' to enhance a standard enumeration. References: https://lostechies.com/jimmybogard/2008/08/12/enumeration-classes/
Namespace: Workspace.XBR.Xperiflow.Utilities.Text
Assembly: Xperiflow.dll
[JsonConverter(typeof(StringEnumerationConverter))]
public abstract class StringEnumeration : IComparable
Derived:
Expand
Workspace.XBR.Xperiflow.Conduit.Job.XperiflowActivityStatus, Workspace.XBR.Xperiflow.Core.Pagination.XperiflowPaginationExpressions, Workspace.XBR.Xperiflow.Core.Pagination.XperiflowPaginationOperators, Workspace.XBR.Xperiflow.Routines.Instances.RoutineInstanceFields, Workspace.XBR.Xperiflow.Routines.RoutineCallableType, Workspace.XBR.Xperiflow.Routines.RoutineTypeFields, Workspace.XBR.Xperiflow.Routines.Runs.ExecutionActivityStatusType, Workspace.XBR.Xperiflow.Routines.Runs.InvocationMethodType, Workspace.XBR.Xperiflow.Routines.Runs.RunMetadataInfoFields, Workspace.XBR.Xperiflow.Utilities.File.FileStorageTypes, Workspace.XBR.Xperiflow.Utilities.Text.StringFormatter.StringConversionTypes, Workspace.XBR.Xperiflow.VersionManagement.DependencyType
Implements:
System.IComparable
Properties
Value
public int Value { get; }
DisplayName
public string DisplayName { get; }
Methods
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
System.String
A string that represents the current object.
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Returns
System.Boolean
true if the specified object is equal to the current object; otherwise, false.
Parameters
| Type | Name | Description |
|---|---|---|
System.Object | obj | The object to compare with the current object. |
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
System.Int32
A hash code for the current object.
GetAll<T>()
Provides an iterator to iterate over all StringEnumeration constants.
public static IEnumerable<T> GetAll<T>() where T : StringEnumeration, new()
Returns
System.Collections.Generic.IEnumerable<{T}>
Type Parameters
T
AbsoluteDifference(StringEnumeration, StringEnumeration)
public static int AbsoluteDifference(StringEnumeration firstValue, StringEnumeration secondValue)
Returns
System.Int32
Parameters
| Type | Name |
|---|---|
| Workspace.XBR.Xperiflow.Utilities.Text.StringEnumeration | firstValue |
| Workspace.XBR.Xperiflow.Utilities.Text.StringEnumeration | secondValue |
FromValue<T>(int)
Creates a StringEnumeration Type from an expected value.
public static T FromValue<T>(int value) where T : StringEnumeration, new()
Returns
<T>
Parameters
| Type | Name |
|---|---|
System.Int32 | value |
Type Parameters
T
FromDisplayName<T>(string)
Creates a StringEnumeration Type from an expected display name.
public static T FromDisplayName<T>(string displayName) where T : StringEnumeration, new()
Returns
<T>
Parameters
| Type | Name |
|---|---|
System.String | displayName |
Type Parameters
T
Contains<T>(T)
Determines if the specified value is contained within the set of StringEnumeration constants.
public static bool Contains<T>(T value) where T : StringEnumeration, new()
Returns
System.Boolean
Parameters
| Type | Name |
|---|---|
<T> | value |
Type Parameters
T
DisplayNames<T>()
Retrieves all display names for the StringEnumeration constants.
public static List<string> DisplayNames<T>() where T : StringEnumeration, new()
Returns
System.Collections.Generic.List<System.String>
List of display names.
Type Parameters
| Name | Description |
|---|---|
T | Type of StringEnumeration. |
HasDisplayName<T>(string)
Checks if the given display name exists in the set of StringEnumeration constants.
public static bool HasDisplayName<T>(string displayName) where T : StringEnumeration, new()