public EditMethodCodeVM(RawModuleBytesProvider rawModuleBytesProvider, IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, IDecompiler decompiler, MethodDef methodToEdit, IList <MethodSourceStatement> statementsInMethodToEdit) : base(rawModuleBytesProvider, openFromGAC, openAssembly, languageCompiler, decompiler, methodToEdit.Module, methodToEdit.DeclaringType) { this.methodToEdit = methodToEdit; methodSourceStatement = statementsInMethodToEdit.Count == 0 ? (MethodSourceStatement?)null : statementsInMethodToEdit[0]; StartDecompile(); }
EditCodeVMCreator(RawModuleBytesProvider rawModuleBytesProvider, IOpenFromGAC openFromGAC, IDocumentTreeView documentTreeView, IDecompilerService decompilerService, [ImportMany] IEnumerable <ILanguageCompilerProvider> languageCompilerProviders) { this.rawModuleBytesProvider = rawModuleBytesProvider; this.openFromGAC = openFromGAC; openAssembly = new OpenAssembly(documentTreeView.DocumentService); this.decompilerService = decompilerService; this.languageCompilerProviders = languageCompilerProviders.OrderBy(a => a.Order).ToArray(); }
public AssemblyReferenceResolver(RawModuleBytesProvider rawModuleBytesProvider, IAssemblyResolver assemblyResolver, IAssembly tempAssembly, ModuleDef editedModule, TypeDef nonNestedEditedTypeOrNull) { Debug.Assert(nonNestedEditedTypeOrNull == null || nonNestedEditedTypeOrNull.Module == editedModule); Debug.Assert(nonNestedEditedTypeOrNull?.DeclaringType == null); this.rawModuleBytesProvider = rawModuleBytesProvider; this.assemblyResolver = assemblyResolver; this.tempAssembly = tempAssembly; this.editedModule = editedModule; this.nonNestedEditedTypeOrNull = nonNestedEditedTypeOrNull; rawModuleBytesList = new List <RawModuleBytes>(); }
public EditCodeVMOptions(RawModuleBytesProvider rawModuleBytesProvider, IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, IPickFilename pickFilename, ILanguageCompiler languageCompiler, IDecompiler decompiler, ModuleDef sourceModule, ImageReference addDocumentsImage) { RawModuleBytesProvider = rawModuleBytesProvider ?? throw new ArgumentNullException(nameof(rawModuleBytesProvider)); OpenFromGAC = openFromGAC ?? throw new ArgumentNullException(nameof(openFromGAC)); OpenAssembly = openAssembly ?? throw new ArgumentNullException(nameof(openAssembly)); PickFilename = pickFilename ?? throw new ArgumentNullException(nameof(pickFilename)); LanguageCompiler = languageCompiler ?? throw new ArgumentNullException(nameof(languageCompiler)); Decompiler = decompiler ?? throw new ArgumentNullException(nameof(decompiler)); SourceModule = sourceModule ?? throw new ArgumentNullException(nameof(sourceModule)); AddDocumentsImage = addDocumentsImage; }
public AssemblyReferenceResolver(RawModuleBytesProvider rawModuleBytesProvider, IAssemblyResolver assemblyResolver, IAssembly tempAssembly, ModuleDef defaultSourceModule, TypeDef nonNestedEditedTypeOrNull, bool makeEverythingPublic) { Debug.Assert(nonNestedEditedTypeOrNull == null || nonNestedEditedTypeOrNull.Module == defaultSourceModule); Debug.Assert(nonNestedEditedTypeOrNull?.DeclaringType == null); this.rawModuleBytesProvider = rawModuleBytesProvider; this.assemblyResolver = assemblyResolver; this.tempAssembly = tempAssembly; this.defaultSourceModule = defaultSourceModule; this.nonNestedEditedTypeOrNull = nonNestedEditedTypeOrNull; this.makeEverythingPublic = makeEverythingPublic; rawModuleBytesList = new List <RawModuleBytes>(); }
public EditClassVM(RawModuleBytesProvider rawModuleBytesProvider, IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, IDecompiler decompiler, IMemberDef defToEdit, IList <MethodSourceStatement> statementsInMethodToEdit) : base(rawModuleBytesProvider, openFromGAC, openAssembly, languageCompiler, decompiler, defToEdit.Module, defToEdit as TypeDef ?? defToEdit.DeclaringType) { this.defToEdit = defToEdit; nonNestedTypeToEdit = defToEdit as TypeDef ?? defToEdit.DeclaringType; while (nonNestedTypeToEdit.DeclaringType != null) { nonNestedTypeToEdit = nonNestedTypeToEdit.DeclaringType; } methodSourceStatement = statementsInMethodToEdit.Count == 0 ? (MethodSourceStatement?)null : statementsInMethodToEdit[0]; StartDecompile(); }
public AddClassVM(RawModuleBytesProvider rawModuleBytesProvider, IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, IDecompiler decompiler, ModuleDef module) : base(rawModuleBytesProvider, openFromGAC, openAssembly, languageCompiler, decompiler, module, null) => StartDecompile();