public WriterContext(AssemblySpecificContext assemblyContext, ModuleSpecificContext moduleContext, TypeSpecificContext typeContext,
                      Dictionary <string, MethodSpecificContext> methodContexts, Dictionary <string, Statement> decompiledStatements)
 {
     this.AssemblyContext      = assemblyContext;
     this.ModuleContext        = moduleContext;
     this.TypeContext          = typeContext;
     this.MethodContexts       = methodContexts;
     this.DecompiledStatements = decompiledStatements;
 }
		public WriterContext(AssemblySpecificContext assemblyContext, ModuleSpecificContext moduleContext, TypeSpecificContext typeContext, 
			Dictionary<string, MethodSpecificContext> methodContexts, Dictionary<string, Statement> decompiledStatements)
		{
			this.AssemblyContext = assemblyContext;
			this.ModuleContext = moduleContext;
			this.TypeContext = typeContext;
			this.MethodContexts = methodContexts;
			this.DecompiledStatements = decompiledStatements;
		}
Example #3
0
 public WriterContext(AssemblySpecificContext assemblyContext, ModuleSpecificContext moduleContext, TypeSpecificContext typeContext, Dictionary <string, MethodSpecificContext> methodContexts, Dictionary <string, Statement> decompiledStatements)
 {
     base();
     this.set_AssemblyContext(assemblyContext);
     this.set_ModuleContext(moduleContext);
     this.set_TypeContext(typeContext);
     this.set_MethodContexts(methodContexts);
     this.set_DecompiledStatements(decompiledStatements);
     return;
 }
Example #4
0
        public static ICollection <string> GetAssemblyAndModuleNamespaceUsings(AssemblySpecificContext assemblyContext, ModuleSpecificContext moduleContext)
        {
            ICollection <string> result = new HashSet <string>();

            foreach (string namespaceUsing in assemblyContext.AssemblyNamespaceUsings)
            {
                result.Add(namespaceUsing);
            }

            foreach (string namespaceUsing in moduleContext.ModuleNamespaceUsings)
            {
                if (!result.Contains(namespaceUsing))
                {
                    result.Add(namespaceUsing);
                }
            }

            return(result);
        }
Example #5
0
        public static bool IsTypeNameInCollisionOnAssemblyLevel(string typeName, AssemblySpecificContext assemblyContext, ModuleSpecificContext mainModuleContext)
        {
            HashSet <string> usedNamespaces = new HashSet <string>();

            foreach (string usedNamespace in assemblyContext.AssemblyNamespaceUsings)
            {
                usedNamespaces.Add(usedNamespace);
            }

            usedNamespaces.UnionWith(mainModuleContext.ModuleNamespaceUsings);

            List <string> typeCollisionNamespaces;

            if (mainModuleContext.CollisionTypesData.TryGetValue(typeName, out typeCollisionNamespaces))
            {
                IEnumerable <string> namespacesIntersection = typeCollisionNamespaces.Intersect(usedNamespaces);

                if (namespacesIntersection.Count() > 1)
                {
                    return(true);
                }
            }

            return(false);
        }
 public DecompilationContext(MethodSpecificContext methodContext, TypeSpecificContext typeContext, ModuleSpecificContext moduleContext, AssemblySpecificContext assemblyContext, ILanguage language)
 {
     base();
     this.set_MethodContext(methodContext);
     this.set_TypeContext(typeContext);
     this.set_ModuleContext(moduleContext);
     this.set_AssemblyContext(assemblyContext);
     this.set_Language(language);
     this.set_IsStopped(false);
     return;
 }
 public DecompilationContext(MethodSpecificContext methodContext, TypeSpecificContext typeContext, ModuleSpecificContext moduleContext, AssemblySpecificContext assemblyContext, ILanguage language)
 {
     this.MethodContext   = methodContext;
     this.TypeContext     = typeContext;
     this.ModuleContext   = moduleContext;
     this.AssemblyContext = assemblyContext;
     this.Language        = language;
     this.IsStopped       = false;
 }
		protected abstract void SetModuleContext(ModuleSpecificContext moduleContext);
 protected override void SetModuleContext(ModuleSpecificContext moduleContext)
 {
     writer.InternalModuleContext = moduleContext;
 }