Ejemplo n.º 1
0
        public async void Paste(int right)
        {
            Copyable paste = await Copyable.DecodeClipboard();

            if (paste != null && Copyable_Insert(paste, right, out Action undo, out Action redo, out Action dispose))
            {
                Program.Project.Undo.Add("Track Pasted", undo, redo, dispose);
            }
        }
Ejemplo n.º 2
0
        public static async void Paste(ISelectParent parent, int right)
        {
            Copyable paste = await Copyable.DecodeClipboard();

            if (paste != null && InsertCopyable(parent, paste, right, "Pasted", out InsertCopyableUndoEntry entry))
            {
                Program.Project.Undo.AddAndExecute(entry);
            }
        }
Ejemplo n.º 3
0
        public static async void Replace(ISelectParent parent, int left, int right)
        {
            Copyable paste = await Copyable.DecodeClipboard();

            if (paste != null && InsertCopyable(parent, paste, right, "", out InsertCopyableUndoEntry insert))
            {
                Program.Project.Undo.AddAndExecute(new ReplaceUndoEntry(
                                                       parent,
                                                       new DeleteUndoEntry(parent, left, right),
                                                       insert
                                                       ));
            }
        }
Ejemplo n.º 4
0
        public async void Replace(int left, int right)
        {
            Copyable paste = await Copyable.DecodeClipboard();

            if (paste != null && Copyable_Insert(paste, right, out Action undo, out Action redo, out Action dispose))
            {
                Region_Delete(left, right, out Action undo2, out Action redo2, out Action dispose2);

                Program.Project.Undo.Add("Track Replaced",
                                         undo2 + undo,
                                         redo + redo2 + (() => Program.Project.Window?.Selection.Select(Program.Project[left + paste.Contents.Count - 1], true)),
                                         dispose2 + dispose
                                         );

                Selection.Select(Program.Project[left + paste.Contents.Count - 1], true);
            }
        }
Ejemplo n.º 5
0
        public async void Replace(int left, int right)
        {
            Copyable paste = await Copyable.DecodeClipboard();

            if (paste != null && Copyable_Insert(paste, right, out Action undo, out Action redo, out Action dispose))
            {
                Region_Delete(left, right, out Action undo2, out Action redo2, out Action dispose2);

                List <int> path = Track.GetPath(_chain);

                Program.Project.Undo.Add("Device Replaced",
                                         undo2 + undo,
                                         redo + redo2 + (() => {
                    Chain chain = Track.TraversePath <Chain>(path);

                    Track.Get(chain).Window?.Selection.Select(chain[left + paste.Contents.Count - 1], true);
                }),
                                         dispose2 + dispose
                                         );

                Track.Get(_chain).Window?.Selection.Select(_chain[left + paste.Contents.Count - 1], true);
            }
        }