public ExportToProjectVM(IPickDirectory pickDirectory, IDecompilerService decompilerService, IExportTask exportTask, bool canDecompileBaml) { this.pickDirectory = pickDirectory; this.decompilerService = decompilerService; this.exportTask = exportTask; this.canDecompileBaml = canDecompileBaml; unpackResources = true; createResX = true; decompileXaml = canDecompileBaml; createSolution = true; ProjectVersionVM.SelectedItem = ProjectVersion.VS2010; decompiler = decompilerService.AllDecompilers.FirstOrDefault(a => a.ProjectFileExtension != null); isIndeterminate = false; ProjectGuid = new NullableGuidVM(Guid.NewGuid(), a => HasErrorUpdated()); }
public ExportToProjectVM(IPickDirectory pickDirectory, ILanguageManager languageManager, IExportTask exportTask, bool canDecompileBaml) { this.pickDirectory = pickDirectory; this.languageManager = languageManager; this.exportTask = exportTask; this.canDecompileBaml = canDecompileBaml; this.unpackResources = true; this.createResX = true; this.decompileXaml = canDecompileBaml; this.createSolution = true; this.projectVersionVM.SelectedItem = ProjectVersion.VS2010; this.language = languageManager.AllLanguages.FirstOrDefault(a => a.ProjectFileExtension != null); this.isIndeterminate = false; this.projectGuidVM = new NullableGuidVM(Guid.NewGuid(), a => HasErrorUpdated()); }
public ModuleOptionsVM(ModuleDef module, ModuleOptions options, ILanguageManager languageManager) { this.module = module; this.options = new ModuleOptions(); this.origOptions = options; moduleKindVM = new EnumListVM(SaveModule.SaveModuleOptionsVM.moduleKindList, (a, b) => { Characteristics = SaveModule.CharacteristicsHelper.GetCharacteristics(Characteristics, (dnlib.DotNet.ModuleKind)ModuleKind.SelectedItem); }); this.machineVM = new EnumListVM(SaveModule.PEHeadersOptionsVM.machineList, (a, b) => { Characteristics = SaveModule.CharacteristicsHelper.GetCharacteristics(Characteristics, (dnlib.PE.Machine)Machine.SelectedItem); }); mvid = new NullableGuidVM(a => HasErrorUpdated()); encId = new NullableGuidVM(a => HasErrorUpdated()); encBaseId = new NullableGuidVM(a => HasErrorUpdated()); clrVersionVM = new EnumListVM(NetModuleOptionsVM.clrVersionList, (a, b) => OnClrVersionChanged()); clrVersionVM.Items.Add(new EnumVM(Module.ClrVersion.Unknown, dnSpy_AsmEditor_Resources.Unknown)); clrVersionVM.SelectedItem = Module.ClrVersion.Unknown; cor20HeaderRuntimeVersion = new NullableUInt32VM(a => { HasErrorUpdated(); UpdateClrVersion(); }); tablesHeaderVersion = new NullableUInt16VM(a => { HasErrorUpdated(); UpdateClrVersion(); }); nativeEntryPointRva = new UInt32VM(a => HasErrorUpdated()); customAttributesVM = new CustomAttributesVM(module, languageManager); Reinitialize(); }
public ModuleOptionsVM(ModuleDef module, ModuleOptions options, Language language) { this.module = module; this.options = new ModuleOptions(); this.origOptions = options; moduleKindVM = new EnumListVM(SaveModule.SaveModuleOptionsVM.moduleKindList, (a, b) => { Characteristics = SaveModule.CharacteristicsHelper.GetCharacteristics(Characteristics, (dnlib.DotNet.ModuleKind)ModuleKind.SelectedItem); }); this.machineVM = new EnumListVM(SaveModule.PEHeadersOptionsVM.machineList, (a, b) => { Characteristics = SaveModule.CharacteristicsHelper.GetCharacteristics(Characteristics, (dnlib.PE.Machine)Machine.SelectedItem); }); mvid = new NullableGuidVM(a => HasErrorUpdated()); encId = new NullableGuidVM(a => HasErrorUpdated()); encBaseId = new NullableGuidVM(a => HasErrorUpdated()); clrVersionVM = new EnumListVM(NetModuleOptionsVM.clrVersionList, (a, b) => OnClrVersionChanged()); clrVersionVM.Items.Add(new EnumVM(Module.ClrVersion.Unknown, "Unknown")); clrVersionVM.SelectedItem = Module.ClrVersion.Unknown; cor20HeaderRuntimeVersion = new NullableUInt32VM(a => { HasErrorUpdated(); UpdateClrVersion(); }); tablesHeaderVersion = new NullableUInt16VM(a => { HasErrorUpdated(); UpdateClrVersion(); }); nativeEntryPointRva = new UInt32VM(a => HasErrorUpdated()); customAttributesVM = new CustomAttributesVM(module, language); Reinitialize(); }
public ModuleOptionsVM(ModuleDef module, ModuleOptions options, IDecompilerService decompilerService) { this.module = module; this.options = new ModuleOptions(); origOptions = options; ModuleKind = new EnumListVM(SaveModule.SaveModuleOptionsVM.moduleKindList, (a, b) => { Characteristics = SaveModule.CharacteristicsHelper.GetCharacteristics(Characteristics, (dnlib.DotNet.ModuleKind)ModuleKind.SelectedItem); }); Machine = new EnumListVM(SaveModule.PEHeadersOptionsVM.machineList, (a, b) => { Characteristics = SaveModule.CharacteristicsHelper.GetCharacteristics(Characteristics, (dnlib.PE.Machine)Machine.SelectedItem); }); Mvid = new NullableGuidVM(a => HasErrorUpdated()); EncId = new NullableGuidVM(a => HasErrorUpdated()); EncBaseId = new NullableGuidVM(a => HasErrorUpdated()); ClrVersion = new EnumListVM(NetModuleOptionsVM.clrVersionList, (a, b) => OnClrVersionChanged()); ClrVersion.Items.Add(new EnumVM(Module.ClrVersion.Unknown, dnSpy_AsmEditor_Resources.Unknown)); ClrVersion.SelectedItem = Module.ClrVersion.Unknown; Cor20HeaderRuntimeVersion = new NullableUInt32VM(a => { HasErrorUpdated(); UpdateClrVersion(); }); TablesHeaderVersion = new NullableUInt16VM(a => { HasErrorUpdated(); UpdateClrVersion(); }); NativeEntryPointRva = new UInt32VM(a => HasErrorUpdated()); CustomAttributesVM = new CustomAttributesVM(module, decompilerService); Reinitialize(); }