예제 #1
0
        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.");
                }
            }
        }
예제 #2
0
        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.");
                }
            }
        }