Show / Hide Table of Contents

Class EnumUtility

Enum Utility Methods.

Inheritance
System.Object
EnumUtility
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: StansAssets.Foundation
Assembly: cs.temp.dll.dll
Syntax
public static class EnumUtility

Methods

CanBeParsedToEnum<T>(String)

Check's if a given string can be parsed to a specified enum type.

Declaration
public static bool CanBeParsedToEnum<T>(string value)
Parameters
Type Name Description
System.String value

String enum value.

Returns
Type Description
System.Boolean
Type Parameters
Name Description
T

ParseEnum<T>(String)

Tries to parse string value to a specified enum type. Will print a warning in case of failure, and return default value for a given Enum type.

Declaration
public static T ParseEnum<T>(string value)
Parameters
Type Name Description
System.String value

String enum value.

Returns
Type Description
T
Type Parameters
Name Description
T

TryParseEnum<T>(String, out T)

Tries to parse string value to a specified enum type.

Declaration
public static bool TryParseEnum<T>(string value, out T result)
Parameters
Type Name Description
System.String value

String enum value.

T result

Enum result.

Returns
Type Description
System.Boolean
Type Parameters
Name Description
T
In This Article
Back to top Generated by DocFX