|
|
|
@ -293,7 +293,7 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -293,7 +293,7 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
IEnumerable<Tuple<string, string>> WriteCodeFilesInProject(ModuleDefinition module, CancellationToken cancellationToken) |
|
|
|
|
{ |
|
|
|
|
var files = module.Types.Where(IncludeTypeWhenDecompilingProject).GroupBy( |
|
|
|
|
delegate(TypeDefinition type) { |
|
|
|
|
delegate (TypeDefinition type) { |
|
|
|
|
string file = CleanUpFileName(type.Name) + ".cs"; |
|
|
|
|
if (string.IsNullOrEmpty(type.Namespace)) { |
|
|
|
|
return file; |
|
|
|
@ -301,7 +301,7 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -301,7 +301,7 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
string dir = CleanUpFileName(type.Namespace); |
|
|
|
|
if (directories.Add(dir)) |
|
|
|
|
Directory.CreateDirectory(Path.Combine(targetDirectory, dir)); |
|
|
|
|
return Path.Combine(targetDirectory, dir, file); |
|
|
|
|
return Path.Combine(dir, file); |
|
|
|
|
} |
|
|
|
|
}, StringComparer.OrdinalIgnoreCase).ToList(); |
|
|
|
|
DecompilerTypeSystem ts = new DecompilerTypeSystem(module); |
|
|
|
@ -311,7 +311,7 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -311,7 +311,7 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
MaxDegreeOfParallelism = this.MaxDegreeOfParallelism, |
|
|
|
|
CancellationToken = cancellationToken |
|
|
|
|
}, |
|
|
|
|
delegate(IGrouping<string, TypeDefinition> file) { |
|
|
|
|
delegate (IGrouping<string, TypeDefinition> file) { |
|
|
|
|
using (StreamWriter w = new StreamWriter(Path.Combine(targetDirectory, file.Key))) { |
|
|
|
|
CSharpDecompiler decompiler = CreateDecompiler(ts); |
|
|
|
|
decompiler.CancellationToken = cancellationToken; |
|
|
|
|