コード例 #1
0
 public EditMethodCodeVM(IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, IDecompiler decompiler, MethodDef methodToEdit, IList <MethodSourceStatement> statementsInMethodToEdit)
     : base(openFromGAC, openAssembly, languageCompiler, decompiler, methodToEdit.Module)
 {
     this.methodToEdit          = methodToEdit;
     this.methodSourceStatement = statementsInMethodToEdit.Count == 0 ? (MethodSourceStatement?)null : statementsInMethodToEdit[0];
     StartDecompile();
 }
コード例 #2
0
 EditCodeVMCreator(IOpenFromGAC openFromGAC, IDocumentTreeView documentTreeView, IDecompilerService decompilerService, [ImportMany] IEnumerable <ILanguageCompilerProvider> languageCompilerProviders)
 {
     this.openFromGAC               = openFromGAC;
     this.openAssembly              = new OpenAssembly(documentTreeView.DocumentService);
     this.decompilerService         = decompilerService;
     this.languageCompilerProviders = languageCompilerProviders.OrderBy(a => a.Order).ToArray();
 }
コード例 #3
0
		EditCodeVMCreator(IRawModuleBytesProvider 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();
		}
コード例 #4
0
 EditCodeVMCreator(IImageManager imageManager, IOpenFromGAC openFromGAC, IFileTreeView fileTreeView, ILanguageManager languageManager, [ImportMany] IEnumerable <ILanguageCompilerProvider> languageCompilerProviders)
 {
     this.imageManager              = imageManager;
     this.openFromGAC               = openFromGAC;
     this.openAssembly              = new OpenAssembly(fileTreeView.FileManager);
     this.languageManager           = languageManager;
     this.languageCompilerProviders = languageCompilerProviders.OrderBy(a => a.Order).ToArray();
 }
コード例 #5
0
ファイル: EditCodeVMCreator.cs プロジェクト: zz110/dnSpy
 EditCodeVMCreator(RawModuleBytesProvider rawModuleBytesProvider, IOpenFromGAC openFromGAC, IPickFilename pickFilename, IDocumentTreeView documentTreeView, IDecompilerService decompilerService, [ImportMany] IEnumerable <ILanguageCompilerProvider> languageCompilerProviders)
 {
     this.rawModuleBytesProvider = rawModuleBytesProvider;
     this.openFromGAC            = openFromGAC;
     openAssembly                   = new OpenAssembly(documentTreeView.DocumentService);
     this.pickFilename              = pickFilename;
     this.decompilerService         = decompilerService;
     this.languageCompilerProviders = languageCompilerProviders.OrderBy(a => a.Order).ToArray();
 }
コード例 #6
0
ファイル: EditClassVM.cs プロジェクト: manojdjoshi/dnSpy
		public EditClassVM(IRawModuleBytesProvider rawModuleBytesProvider, IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, IDecompiler decompiler, IMemberDef defToEdit, IList<MethodSourceStatement> statementsInMethodToEdit)
			: base(rawModuleBytesProvider, openFromGAC, openAssembly, languageCompiler, decompiler, defToEdit.Module) {
			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
ファイル: EditCodeVM.cs プロジェクト: dotfornet/dnSPy
 protected EditCodeVM(IRawModuleBytesProvider rawModuleBytesProvider, IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, IDecompiler decompiler, ModuleDef sourceModule)
 {
     Debug.Assert(decompiler.CanDecompile(DecompilationType.TypeMethods));
     this.openFromGAC               = openFromGAC;
     this.openAssembly              = openAssembly;
     this.languageCompiler          = languageCompiler;
     this.decompiler                = decompiler;
     this.sourceModule              = sourceModule;
     this.assemblyReferenceResolver = new AssemblyReferenceResolver(rawModuleBytesProvider, sourceModule.Context.AssemblyResolver, sourceModule, makeEverythingPublic);
 }
コード例 #8
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;
 }
コード例 #9
0
 public EditCodeVM(IImageManager imageManager, IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, ILanguage language, MethodDef methodToEdit)
 {
     Debug.Assert(language.CanDecompile(DecompilationType.TypeMethods));
     this.imageManager              = imageManager;
     this.openFromGAC               = openFromGAC;
     this.openAssembly              = openAssembly;
     this.languageCompiler          = languageCompiler;
     this.language                  = language;
     this.methodToEdit              = methodToEdit;
     this.assemblyReferenceResolver = new AssemblyReferenceResolver(methodToEdit.Module.Context.AssemblyResolver, methodToEdit.Module, makeEverythingPublic);
     StartDecompileAsync(methodToEdit).ContinueWith(t => {
         var ex = t.Exception;
         Debug.Assert(ex == null);
     }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());
 }
コード例 #10
0
        public EditCodeVM(IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, IDecompiler decompiler, MethodDef methodToEdit, IList <MethodSourceStatement> statementsInMethodToEdit)
        {
            Debug.Assert(decompiler.CanDecompile(DecompilationType.TypeMethods));
            this.openFromGAC      = openFromGAC;
            this.openAssembly     = openAssembly;
            this.languageCompiler = languageCompiler;
            this.decompiler       = decompiler;
            this.methodToEdit     = methodToEdit;
            var methodSourceStatement = statementsInMethodToEdit.Count == 0 ? (MethodSourceStatement?)null : statementsInMethodToEdit[0];

            this.assemblyReferenceResolver = new AssemblyReferenceResolver(methodToEdit.Module.Context.AssemblyResolver, methodToEdit.Module, makeEverythingPublic);
            StartDecompileAsync(methodToEdit, methodSourceStatement).ContinueWith(t => {
                var ex = t.Exception;
                Debug.Assert(ex == null);
            }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());
        }
コード例 #11
0
 public EditClassVM(IRawModuleBytesProvider rawModuleBytesProvider, IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, IDecompiler decompiler, IMemberDef defToEdit, IList <MethodSourceStatement> statementsInMethodToEdit)
     : base(rawModuleBytesProvider, openFromGAC, openAssembly, languageCompiler, decompiler, defToEdit.Module)
 {
     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();
 }
コード例 #12
0
ファイル: AddClassVM.cs プロジェクト: DavidZhiXing/dnSpy
 public AddClassVM(IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, IDecompiler decompiler, ModuleDef module)
     : base(openFromGAC, openAssembly, languageCompiler, decompiler, module)
 {
     StartDecompile();
 }
コード例 #13
0
ファイル: AddClassVM.cs プロジェクト: azureidea/dnSpy-1
 public AddClassVM(IRawModuleBytesProvider rawModuleBytesProvider, IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, IDecompiler decompiler, ModuleDef module)
     : base(rawModuleBytesProvider, openFromGAC, openAssembly, languageCompiler, decompiler, module) => StartDecompile();
コード例 #14
0
ファイル: AddClassVM.cs プロジェクト: manojdjoshi/dnSpy
		public AddClassVM(IRawModuleBytesProvider rawModuleBytesProvider, IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, IDecompiler decompiler, ModuleDef module)
			: base(rawModuleBytesProvider, openFromGAC, openAssembly, languageCompiler, decompiler, module) {
			StartDecompile();
		}
コード例 #15
0
ファイル: EditMethodCodeVM.cs プロジェクト: manojdjoshi/dnSpy
		public EditMethodCodeVM(IRawModuleBytesProvider rawModuleBytesProvider, IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, IDecompiler decompiler, MethodDef methodToEdit, IList<MethodSourceStatement> statementsInMethodToEdit)
			: base(rawModuleBytesProvider, openFromGAC, openAssembly, languageCompiler, decompiler, methodToEdit.Module) {
			this.methodToEdit = methodToEdit;
			methodSourceStatement = statementsInMethodToEdit.Count == 0 ? (MethodSourceStatement?)null : statementsInMethodToEdit[0];
			StartDecompile();
		}
コード例 #16
0
 public EditAssemblyVM(RawModuleBytesProvider rawModuleBytesProvider, IOpenFromGAC openFromGAC, IOpenAssembly openAssembly, ILanguageCompiler languageCompiler, IDecompiler decompiler, ModuleDef module)
     : base(rawModuleBytesProvider, openFromGAC, openAssembly, languageCompiler, decompiler, module, null) => StartDecompile();