private void addChunkToolStripMenuItem_Click(object sender, EventArgs e) { var dlg = new frmAddChunk(); var selectedchunk = treeListView.SelectedObjects.Cast <CR2WExportWrapper>().FirstOrDefault(); if (dlg.ShowDialog() == DialogResult.OK) { try { var chunk = File.CreateChunk(dlg.ChunkType); if (selectedchunk != null) { chunk.SetParent(selectedchunk); } UpdateList(); if (OnSelectChunk != null && chunk != null) { OnSelectChunk(this, new SelectChunkArgs { Chunk = chunk }); } } catch (InvalidChunkTypeException ex) { MessageBox.Show(ex.Message, "Error adding chunk."); } } }
private void addChunkToolStripMenuItem_Click(object sender, EventArgs e) { var dlg = new frmAddChunk(); if (dlg.ShowDialog() == DialogResult.OK) { try { var chunk = File.CreateChunk(dlg.ChunkType); UpdateList(); if (OnSelectChunk != null && chunk != null) { OnSelectChunk(this, new SelectChunkArgs { Chunk = chunk }); } } catch (InvalidChunkTypeException ex) { MessageBox.Show(ex.Message, "Error adding chunk."); } } }