private static EPatternType StringToPatternType(string str) { return (EPatternType)Enum.Parse(typeof(EPatternType), str); }