Example #1
0
        public SaveModuleOptionsVM(IDsDocument document)
        {
            this.document      = document;
            Module             = document.ModuleDef;
            PEHeadersOptions   = new PEHeadersOptionsVM(Module.Machine, GetSubsystem(Module.Kind));
            Cor20HeaderOptions = new Cor20HeaderOptionsVM();
            MetaDataOptions    = new MetaDataOptionsVM();

            PEHeadersOptions.PropertyChanged   += (s, e) => HasErrorUpdated();
            Cor20HeaderOptions.PropertyChanged += (s, e) => HasErrorUpdated();
            MetaDataOptions.PropertyChanged    += (s, e) => HasErrorUpdated();

            ModuleKind = new EnumListVM(moduleKindList, (a, b) => {
                OnPropertyChanged(nameof(Extension));
                PEHeadersOptions.Subsystem.SelectedItem = GetSubsystem((dnlib.DotNet.ModuleKind)ModuleKind.SelectedItem);
                PEHeadersOptions.Characteristics        = CharacteristicsHelper.GetCharacteristics(PEHeadersOptions.Characteristics ?? 0, (dnlib.DotNet.ModuleKind)ModuleKind.SelectedItem);
            });

            Reinitialize();
        }
Example #2
0
		public SaveModuleOptionsVM(LoadedAssembly asm) {
			this.loadedAssembly = asm;
			this.module = asm.ModuleDefinition;
			this.peHeadersOptions = new PEHeadersOptionsVM(module.Machine, GetSubsystem(module.Kind));
			this.cor20HeaderOptions = new Cor20HeaderOptionsVM();
			this.metaDataOptions = new MetaDataOptionsVM();

			this.peHeadersOptions.PropertyChanged += (s, e) => HasErrorUpdated();
			this.cor20HeaderOptions.PropertyChanged += (s, e) => HasErrorUpdated();
			this.metaDataOptions.PropertyChanged += (s, e) => HasErrorUpdated();

			moduleKindVM = new EnumListVM(moduleKindList, (a, b) => {
				OnPropertyChanged("Extension");
				PEHeadersOptions.Subsystem.SelectedItem = GetSubsystem((dnlib.DotNet.ModuleKind)ModuleKind.SelectedItem);
				PEHeadersOptions.Characteristics = CharacteristicsHelper.GetCharacteristics(PEHeadersOptions.Characteristics ?? 0, (dnlib.DotNet.ModuleKind)ModuleKind.SelectedItem);
			});

			Reinitialize();
		}
Example #3
0
		public SaveModuleOptionsVM(IDsDocument document) {
			this.document = document;
			Module = document.ModuleDef;
			PEHeadersOptions = new PEHeadersOptionsVM(Module.Machine, GetSubsystem(Module.Kind));
			Cor20HeaderOptions = new Cor20HeaderOptionsVM();
			MetaDataOptions = new MetaDataOptionsVM();

			PEHeadersOptions.PropertyChanged += (s, e) => HasErrorUpdated();
			Cor20HeaderOptions.PropertyChanged += (s, e) => HasErrorUpdated();
			MetaDataOptions.PropertyChanged += (s, e) => HasErrorUpdated();

			ModuleKind = new EnumListVM(moduleKindList, (a, b) => {
				OnPropertyChanged(nameof(Extension));
				PEHeadersOptions.Subsystem.SelectedItem = GetSubsystem((dnlib.DotNet.ModuleKind)ModuleKind.SelectedItem);
				PEHeadersOptions.Characteristics = CharacteristicsHelper.GetCharacteristics(PEHeadersOptions.Characteristics ?? 0, (dnlib.DotNet.ModuleKind)ModuleKind.SelectedItem);
			});

			Reinitialize();
		}