Ejemplo n.º 1
0
        internal static void Manage(Action <FileSystemInfo> modify, bool addDebugSymbols)
        {
            var assemblyFileName = AssemblyManager.Create(null, addDebugSymbols);

            try
            {
                modify(new FileInfo(assemblyFileName));
            }
            finally
            {
                AssemblyManager.RemoveFile(assemblyFileName);
            }
        }
Ejemplo n.º 2
0
        internal static void Manage(Action <AssemblyDefinition> addTo,
                                    Action <AssemblyDefinition> modify, bool addDebugSymbols)
        {
            var assemblyFileName = AssemblyManager.Create(addTo, addDebugSymbols);

            try
            {
                var assembly = AssemblyDefinition.ReadAssembly(assemblyFileName);
                modify(assembly);
                assembly.Write(assemblyFileName);
            }
            finally
            {
                AssemblyManager.RemoveFile(assemblyFileName);
            }
        }