/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see .
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using dnSpy.Contracts.Decompiler;
namespace dnSpy.Decompiler.MSBuild {
sealed class ProjectCreatorOptions {
///
/// The logger or null
///
public IMSBuildProjectWriterLogger? Logger { get; set; }
///
/// Gets notified when the progress gets updated
///
public IMSBuildProgressListener? ProgressListener { get; set; }
///
/// All modules that should be decompiled
///
public List ProjectModules { get; }
///
/// Project version
///
public ProjectVersion ProjectVersion { get; set; }
///
/// Number of threads to use or 0 to use as many threads as there are processors.
///
public int NumberOfThreads { get; set; }
///
/// Base directory of all project dirs. This is the directory where the .sln file is saved
/// if it's written.
///
public string Directory { get; }
///
/// Filename relative to . Use null if no solution file should be
/// written.
///
public string? SolutionFilename { get; set; }
///
/// User GAC paths. All files stored in any of these directories are considered GAC files.
///
public List UserGACPaths { get; }
///
/// Cancellation token
///
public CancellationToken CancellationToken { get; }
///
/// Creates a
///
public Func CreateDecompilerOutput { get; set; }
///
/// Constructor
///
/// Base directory
/// Cancellation token
public ProjectCreatorOptions(string directory, CancellationToken cancellationToken) {
Directory = directory ?? throw new ArgumentNullException(nameof(directory));
CancellationToken = cancellationToken;
ProjectModules = new List();
UserGACPaths = new List();
CreateDecompilerOutput = textWriter => new TextWriterDecompilerOutput(textWriter);
}
}
}