private void UpdateResourcePackContextMenuItem_Click(object sender, EventArgs e) { if (SelectedImageMetadata.Count == 0) { return; } string fileName; using (var op = new OpenFileDialog { Filter = Consts.ExportResourcePackFilter }) { if (op.ShowDialog() != DialogResult.OK) { return; } fileName = op.FileName; } var resourcePack = m_resourcePackManager.LoadFromFile(fileName); var images = SelectedImageMetadata.Select(x => { var imageData = m_firmware.ReadImage(x); var imageSize = imageData.GetSize(); return(new ExportedImage(x.Index, imageSize, imageData)); }).ToList(); using (var createResourcePackWindow = new CreateResourcePackWindow(m_resourcePackManager, m_definitions, m_firmware.Definition.Name, images, resourcePack)) { createResourcePackWindow.ShowDialog(); } }
private void ExportContextMenuItem_Click(object sender, EventArgs e) { if (SelectedImageMetadata.Count == 0) { return; } var images = SelectedImageMetadata.Select(x => { var imageData = m_firmware.ReadImage(x); var imageSize = imageData.GetSize(); return(new ExportedImage(x.Index, imageSize, imageData)); }).ToList(); using (var createResourcePackWindow = new CreateResourcePackWindow(m_resourcePackManager, m_firmware.Definition.Name, images)) { createResourcePackWindow.ShowDialog(); } }
private void UpdateResourcePackContextMenuItem_Click(object sender, EventArgs e) { if (SelectedImageMetadata.Count == 0) return; string fileName; using (var op = new OpenFileDialog { Filter = Consts.ExportResourcePackFilter }) { if (op.ShowDialog() != DialogResult.OK) return; fileName = op.FileName; } var resourcePack = m_resourcePackManager.LoadFromFile(fileName); var images = SelectedImageMetadata.Select(x => { var imageData = m_firmware.ReadImage(x); var imageSize = imageData.GetSize(); return new ExportedImage(x.Index, imageSize, imageData); }).ToList(); using (var createResourcePackWindow = new CreateResourcePackWindow(m_resourcePackManager, m_definitions, m_firmware.Definition.Name, images, resourcePack)) { createResourcePackWindow.ShowDialog(); } }
private void ExportResourcePackContextMenuItem_Click(object sender, EventArgs e) { if (SelectedImageMetadata.Count == 0) return; var images = SelectedImageMetadata.Select(x => { var imageData = m_firmware.ReadImage(x); var imageSize = imageData.GetSize(); return new ExportedImage(x.Index, imageSize, imageData); }).ToList(); using (var createResourcePackWindow = new CreateResourcePackWindow(m_resourcePackManager, m_definitions, m_firmware.Definition.Name, images, null)) { createResourcePackWindow.ShowDialog(); } }