public static IntermediateSymbolDefinition ByType(ExampleSymbolDefinitionType type) { switch (type) { case ExampleSymbolDefinitionType.Example: return(ExampleSymbolDefinitions.Example); case ExampleSymbolDefinitionType.ExampleSearch: return(ExampleSymbolDefinitions.ExampleSearch); default: throw new ArgumentOutOfRangeException(nameof(type)); } }
public static bool TryGetSymbolType(string name, out ExampleSymbolDefinitionType type) { return(Enum.TryParse(name, out type)); }