Exemple #1
0
 bool IsSupportedLanguage(ILanguage language)
 {
     if (language == null)
     {
         return(false);
     }
     if (!language.CanDecompile(DecompilationType.TypeMethods))
     {
         return(false);
     }
     return(languageCompilerProviders.Any(a => a.Language == language.GenericGuid));
 }
Exemple #2
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());
 }