public PEFileModel(string fileName, PEFile peFile) : base(new ObservableCollection <object>()) { this.m_FileName = fileName; this.peFile = peFile; this.m_DosHeader = new DosHeaderModel(peFile.DosHeader); this.Items.Add(this.DosHeader); UpdateDosStubFromlfanew(); this.m_PEHeader = new PEHeaderModel(peFile.PEHeader, m_DosHeader); this.Items.Add(this.PEHeader); this.m_OptionalHeader = new OptionalHeaderModel(peFile.OptionalHeader, m_PEHeader); this.Items.Add(this.OptionalHeader); this.m_SectionHeaders = new SectionHeaderListModel(peFile, this.PEHeader, this.OptionalHeader); this.Items.Add(this.SectionHeaders); UpdateSectionContentParts(); this.DosHeader.PropertyChanged += DosHeader_PropertyChanged; ((INotifyCollectionChanged)this.SectionHeaders.Items).CollectionChanged += SectionHeaders_Items_CollectionChanged; }
public SectionHeaderListModel(PEFile peFile, PEHeaderModel peHeader, OptionalHeaderModel optionalHeader) : base("Section headers") { this.peFile = peFile; this.m_Items = new ReadOnlyObservableCollection <SectionHeaderModel>(itemsCore); BindAddressToOptionalHeader(optionalHeader); BindToPEHeader(peHeader); }
public SectionHeaderListModel(PEFile peFile, PEHeaderModel peHeader, OptionalHeaderModel optionalHeader) : base("Section headers") { this.peFile = peFile; this.m_Items = new ReadOnlyObservableCollection<SectionHeaderModel>(itemsCore); BindAddressToOptionalHeader(optionalHeader); BindToPEHeader(peHeader); }
private void BindAddressToOptionalHeader(OptionalHeaderModel optionalHeader) { this.Address = optionalHeader.Address + optionalHeader.Length; optionalHeader.PropertyChanged += (sender, e) => { if (e.PropertyName == "Address" || e.PropertyName == "Length") { this.Address = optionalHeader.Address + optionalHeader.Length; } }; }