using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SuperSocket.Common { /// /// String extension /// public static partial class StringExtension { /// /// Tries parse string to enum. /// /// the enum type /// The value. /// if set to true [ignore case]. /// The enum value. /// public static bool TryParseEnum(this string value, bool ignoreCase, out T enumValue) where T : struct { return Enum.TryParse(value, ignoreCase, out enumValue); } } }