예제 #1
0
 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();
 }
예제 #2
0
 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();
 }
예제 #3
0
 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>();
 }
예제 #4
0
 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;
 }
예제 #5
0
 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>();
 }
예제 #6
0
 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();
 }
예제 #7
0
파일: AddClassVM.cs 프로젝트: zquans/dnSpy
 public AddClassVM(RawModuleBytesProvider rawModuleBytesProvider, IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, IDecompiler decompiler, ModuleDef module)
     : base(rawModuleBytesProvider, openFromGAC, openAssembly, languageCompiler, decompiler, module, null) => StartDecompile();