private Class179 <string, string> method_0(Type type_0)
        {
            Class179 <string, string> class2;
            Class179 <string, string> class3;

            if (this.dictionary_0.TryGetValue(type_0, out class2))
            {
                return(class2);
            }
            lock (this.dictionary_0)
            {
                if (!this.dictionary_0.TryGetValue(type_0, out class2))
                {
                    class2 = new Class179 <string, string>(StringComparer.OrdinalIgnoreCase, StringComparer.OrdinalIgnoreCase);
                    foreach (FieldInfo info in type_0.GetFields())
                    {
                        string str3;
                        string name = info.Name;
                        if (func_0 == null)
                        {
                            func_0 = new Func <EnumMemberAttribute, string>(StringEnumConverter.smethod_1);
                        }
                        string str2 = info.GetCustomAttributes(typeof(EnumMemberAttribute), true).Cast <EnumMemberAttribute>().Select <EnumMemberAttribute, string>(func_0).SingleOrDefault <string>() ?? info.Name;
                        if (class2.method_2(str2, out str3))
                        {
                            throw new InvalidOperationException("Enum name '{0}' already exists on enum '{1}'.".smethod_1(CultureInfo.InvariantCulture, str2, type_0.Name));
                        }
                        class2.method_0(name, str2);
                    }
                    this.dictionary_0[type_0] = class2;
                }
                return(class2);
            }
            return(class3);
        }
Example #2
0
        public string GetReference(object context, object value)
        {
            string str;
            Class179 <string, object> class2 = this.method_0(context);

            if (!class2.method_2(value, out str))
            {
                this.int_0++;
                str = this.int_0.ToString(CultureInfo.InvariantCulture);
                class2.method_0(str, value);
            }
            return(str);
        }