private WriterContext GetWriterContextForType(TypeDefinition type, ILanguage language)
 {
     V_0 = Utilities.GetOuterMostDeclaringType(type);
     if (!this.cacheService.AreNestedDecompiledTypesInCache(V_0, language, this.renameInvalidMembers))
     {
         V_1 = this.GetNestedDecompiledTypes(V_0, language);
         this.cacheService.AddNestedDecompiledTypesToCache(V_0, language, this.renameInvalidMembers, V_1);
     }
     else
     {
         V_1 = this.cacheService.GetNestedDecompiledTypesFromCache(V_0, language, this.renameInvalidMembers);
     }
     V_2 = this.GetTypeContext(V_0, language, V_1);
     this.AddTypeContextsToCache(V_1, V_0, language);
     V_3 = new Dictionary <string, MethodSpecificContext>();
     V_4 = new Dictionary <string, Statement>();
     if (!V_1.TryGetValue(type.get_FullName(), out V_5))
     {
         throw new Exception("Decompiled type missing from DecompiledTypes cache.");
     }
     if (V_2.get_GeneratedFilterMethods().get_Count() > 0)
     {
         this.AddGeneratedFilterMethodsToDecompiledType(V_5, V_2, language);
     }
     V_7 = V_5.get_DecompiledMembers().get_Values().GetEnumerator();
     try
     {
         while (V_7.MoveNext())
         {
             V_8 = V_7.get_Current();
             V_3.Add(V_8.get_MemberFullName(), V_8.get_Context());
             V_4.Add(V_8.get_MemberFullName(), V_8.get_Statement());
         }
     }
     finally
     {
         ((IDisposable)V_7).Dispose();
     }
     stackVariable63 = this.GetAssemblyContext(V_0.get_Module().get_Assembly(), language);
     V_6             = this.GetModuleContext(V_0.get_Module(), language);
     return(new WriterContext(stackVariable63, V_6, V_2, V_3, V_4));
 }