Beispiel #1
0
        private void Trg_Drop(object sender, DragEventArgs e)
        {
            e.Handled = true;
            if (fromDropTo == DropTo.None)
            {
                EndDrag();
                return;
            }

            if (IBProjectElement.MultiSelectingList.Count == 0)
            {
                string[] formats = e.Data.GetFormats();
                if (formats.Length == 0) return;

                IBProjectElement from = e.Data.GetData(formats[0]) as IBProjectElement;
                if (from == null) return;

                if (trgElement == null || from == trgElement) return;

                RUMoveProjectElement hist = DoMove(from);
                RedoUndoManager.Current.Record(hist);
            }
            else
            {
                RUMoveMultiProjectElements hists = new RUMoveMultiProjectElements();

                if(fromDropTo == DropTo.Bottom)
                {
                    foreach (IBProjectElement from in IBProjectElement.MultiSelectingList.Reverse())
                    {
                        hists.RecordToThis(DoMove(from));
                    }
                }
                else
                {
                    foreach (IBProjectElement from in IBProjectElement.MultiSelectingList)
                    {
                        hists.RecordToThis(DoMove(from));
                    }
                }

                RedoUndoManager.Current.Record(hists);
            }

            EndDrag();
        }
Beispiel #2
0
 public void RecordToThis(RUMoveProjectElement hist)
 {
     currentHistory.Add(hist);
 }