internal BfType method_12(TypeDefinition typeDefinition_0, BfAssembly bfAssembly_0) { string text = BfCache.smethod_2(typeDefinition_0); BfType result; if (!bfAssembly_0.method_4().ContainsKey(text)) { BfType bfType = new BfType(this, typeDefinition_0, bfAssembly_0); bfAssembly_0.method_4().Add(BfCache.smethod_2(typeDefinition_0), bfType); this.Types.method_1(bfType); bfAssembly_0.Namespaces.method_1(bfType.Namespace); result = bfType; } else { Logger.LogWarning("CreateBfType", "Why the hell is this type already exist " + text); result = bfAssembly_0.method_4()[text]; } return(result); }
internal BfType method_12(TypeDefinition typeDefinition_0, BfAssembly bfAssembly_0) { string text = BfCache.smethod_2(typeDefinition_0); BfType result; if (!bfAssembly_0.method_4().ContainsKey(text)) { BfType bfType = new BfType(this, typeDefinition_0, bfAssembly_0); bfAssembly_0.method_4().Add(BfCache.smethod_2(typeDefinition_0), bfType); this.Types.method_1(bfType); bfAssembly_0.Namespaces.method_1(bfType.Namespace); result = bfType; } else { Logger.LogWarning("CreateBfType", "Why the hell is this type already exist " + text); result = bfAssembly_0.method_4()[text]; } return result; }
internal BfType method_7(TypeReference typeReference_0) { BfType result; if (typeReference_0 == null) { result = null; } else { BfType bfType = null; typeReference_0 = BfCache.smethod_3(typeReference_0); if (typeReference_0 is GenericParameter) { IEnumerable <BfAssembly> arg_53_0 = this.dictionary_0.Values; if (BfCache.func_1 == null) { BfCache.func_1 = new Func <BfAssembly, bool>(BfCache.smethod_6); } BfAssembly bfAssembly = arg_53_0.Where(BfCache.func_1).FirstOrDefault <BfAssembly>(); if (bfAssembly == null) { IEnumerable <BfAssembly> arg_8F_0 = this.dictionary_0.Values; if (BfCache.func_2 == null) { BfCache.func_2 = new Func <BfAssembly, bool>(BfCache.smethod_7); } bfAssembly = arg_8F_0.Where(BfCache.func_2).FirstOrDefault <BfAssembly>(); } if (bfAssembly.method_4().ContainsKey(typeReference_0.FullName)) { bfType = bfAssembly.method_4()[typeReference_0.FullName]; } else { bfType = this.method_12(new TypeDefinition(typeReference_0.Name, typeReference_0.Namespace, TypeAttributes.Abstract, null), bfAssembly); } result = bfType; } else { BfAssembly bfAssembly2 = null; try { if (typeReference_0.Scope is AssemblyNameReference) { bfAssembly2 = this.dictionary_0[((AssemblyNameReference)typeReference_0.Scope).FullName]; } else if (typeReference_0.Scope is ModuleDefinition) { bfAssembly2 = this.dictionary_0[((ModuleDefinition)typeReference_0.Scope).Assembly.Name.FullName]; } else if (typeReference_0.Scope is ModuleReference) { bfAssembly2 = this.dictionary_1[((ModuleReference)typeReference_0.Scope).Name]; } } catch (KeyNotFoundException) { throw new Exception("Could not find assembly: " + typeReference_0.Scope.ToString()); } bfAssembly2.method_4().TryGetValue(BfCache.smethod_2(typeReference_0), out bfType); if (bfType == null) { foreach (ModuleDefinition moduleDefinition in bfAssembly2.method_3().Modules) { foreach (TypeDefinition typeDefinition in moduleDefinition.Types) { if (typeReference_0.FullName == typeDefinition.FullName) { bfType = this.method_12(typeDefinition, bfAssembly2); break; } } } } if (bfType != null) { result = bfType; } else { Logger.LogInfo("can't find: " + typeReference_0.FullName); result = null; } } } return(result); }