private void AddToFileMap(ManifestChunk chunk) { double size = DataSource.Length; FileMap.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(chunk.Size / size, GridUnitType.Star) }); var border = new Border() { Background = new SolidColorBrush(FileMapColors[FileMap.Children.Count]), Tag = chunk }; Grid.SetColumn(border, FileMap.Children.Count); border.MouseLeftButtonDown += delegate { DisplayInformation(border.Tag as ManifestChunk); }; FileMapBorders.Add(chunk, border); FileMap.Children.Add(border); }
private void DisplayInformation(ManifestChunk chunk) { ByteStartOffsetBox.Text = chunk.Offset.ToString(); ByteEndOffsetBox.Text = chunk.EndOffset.ToString(); ByteSizeBox.Text = chunk.Size.ToString(); AnonByteBox.Text = chunk.Extra.ToString(); NameLabel.Text = chunk.Name; ColorDisplay.Background = FileMapBorders[chunk].Background; OpenChunk = chunk; var path = System.IO.Path.Combine(DestinationBox.Text, chunk.Name); if (File.Exists(path)) { OpenFileButton.IsEnabled = true; HexEditor.FileName = path; } else { OpenFileButton.IsEnabled = false; HexEditor.CloseProvider(); } Title = $"MV - Viewing {chunk.Name}"; }