Example #1
0
        private void pasteChunkToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var copiedchunks = CopyController.ChunkList;

            if (copiedchunks != null && copiedchunks.Count > 0)
            {
                foreach (var chunk in copiedchunks)
                {
                    try
                    {
                        var pastedchunk = File.CreateChunk(chunk.Type, chunk.Parent);
                        pastedchunk.data = chunk.data.Copy(new CR2WCopyAction());
                        //TODO: Unknownbytes
                        listView.AddObject(pastedchunk);

                        OnSelectChunk?.Invoke(this, new SelectChunkArgs {
                            Chunk = pastedchunk
                        });
                    }
                    catch (InvalidChunkTypeException ex)
                    {
                        MessageBox.Show(ex.Message, @"Error adding chunk.");
                    }
                }
            }
        }
Example #2
0
        public void PasteChunks()
        {
            var copiedchunks = CopyController.ChunkList;

            if (copiedchunks != null && copiedchunks.Count > 0)
            {
                foreach (var chunk in copiedchunks)
                {
                    try
                    {
                        var pastedchunk = CR2WCopyAction.CopyChunk(chunk, chunk.CR2WOwner);
                        OnSelectChunk?.Invoke(this, new SelectChunkArgs {
                            Chunk = pastedchunk
                        });
                        MainController.Get().ProjectStatus = "Chunk copied";
                        UpdateList();
                    }
                    catch (InvalidChunkTypeException ex)
                    {
                        MessageBox.Show(ex.Message, @"Error adding chunk.");
                    }
                }
            }
        }
Example #3
0
        private void pasteChunkToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var copiedchunks = CopyController.ChunkList;

            if (copiedchunks != null && copiedchunks.Count > 0)
            {
                foreach (var chunk in copiedchunks)
                {
                    try
                    {
                        var pastedchunk = CR2WCopyAction.CopyChunk(chunk, chunk.CR2WOwner);
                        listView.AddObject(pastedchunk);
                        OnSelectChunk?.Invoke(this, new SelectChunkArgs {
                            Chunk = pastedchunk
                        });
                        MainController.Get().ProjectStatus = "Chunk copied";
                    }
                    catch (InvalidChunkTypeException ex)
                    {
                        MessageBox.Show(ex.Message, @"Error adding chunk.");
                    }
                }
            }
        }
 private void editor_OnSelectChunk(object sender, SelectChunkArgs e)
 {
     OnSelectChunk?.Invoke(sender, e);
 }
Example #5
0
 public void FireSelectEvent(CR2WExportWrapper c)
 {
     OnSelectChunk?.Invoke(this, new SelectChunkArgs {
         Chunk = c
     });
 }
Example #6
0
 public void FireSelectEvent(CR2WChunk c)
 {
     OnSelectChunk?.Invoke(this, new SelectChunkArgs {
         Chunk = c
     });
 }