Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 89c8adc5 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

EnumHelper: removed not needed function

parent cef15e9c
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,6 @@ using System; ...@@ -33,7 +33,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
namespace TUGraz.VectoCommon.Utils namespace TUGraz.VectoCommon.Utils
{ {
...@@ -48,22 +47,5 @@ namespace TUGraz.VectoCommon.Utils ...@@ -48,22 +47,5 @@ namespace TUGraz.VectoCommon.Utils
{ {
return Enum.GetValues(typeof(T)).Cast<T>(); return Enum.GetValues(typeof(T)).Cast<T>();
} }
private static readonly Dictionary<Type, Dictionary<Enum, string>> Names =
new Dictionary<Type, Dictionary<Enum, string>>();
[MethodImpl(MethodImplOptions.Synchronized)]
public static string AsString(this Enum e)
{
var t = e.GetType();
if (!Names.ContainsKey(t)) {
Names[t] = new Dictionary<Enum, string> { { e, e.ToString() } };
}
if (!Names[t].ContainsKey(e)) {
Names[t][e] = e.ToString();
}
return Names[t][e];
}
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment