public override bool DragElement(TreeViewItem targetItem, Rect targetItemRect, bool firstItem)
        {
            AudioMixerTreeViewDragging.DragData dragData = DragAndDrop.GetGenericData("AudioMixerDragging") as AudioMixerTreeViewDragging.DragData;
            if (dragData == null)
            {
                DragAndDrop.visualMode = DragAndDropVisualMode.None;
                return(false);
            }
            bool flag = targetItem == null;

            if (flag && this.m_TreeView.GetTotalRect().Contains(Event.current.mousePosition))
            {
                if (this.m_DropData != null)
                {
                    this.m_DropData.dropTargetControlID = 0;
                    this.m_DropData.rowMarkerControlID  = 0;
                }
                if (Event.current.type == EventType.DragPerform)
                {
                    DragAndDrop.AcceptDrag();
                    if (this.m_MixersDroppedOnMixerCallback != null)
                    {
                        this.m_MixersDroppedOnMixerCallback(this.GetAudioMixersFromItems(dragData.m_DraggedItems), null);
                    }
                }
                DragAndDrop.visualMode = DragAndDropVisualMode.Move;
                Event.current.Use();
                return(false);
            }
            return(base.DragElement(targetItem, targetItemRect, firstItem));
        }
        public override DragAndDropVisualMode DoDrag(TreeViewItem parentNode, TreeViewItem targetNode, bool perform, TreeViewDragging.DropPosition dragPos)
        {
            AudioMixerTreeViewDragging.DragData dragData = DragAndDrop.GetGenericData("AudioMixerDragging") as AudioMixerTreeViewDragging.DragData;
            if (dragData == null)
            {
                return(DragAndDropVisualMode.None);
            }
            List <AudioMixerItem> draggedItems   = dragData.m_DraggedItems;
            AudioMixerItem        audioMixerItem = parentNode as AudioMixerItem;

            if (audioMixerItem != null && dragData != null)
            {
                List <AudioMixerGroupController> groupsToBeMoved = (from i in draggedItems
                                                                    select i.mixer.masterGroup).ToList <AudioMixerGroupController>();
                List <AudioMixerGroupController> allAudioGroupsSlow = audioMixerItem.mixer.GetAllAudioGroupsSlow();
                bool flag  = AudioMixerController.WillModificationOfTopologyCauseFeedback(allAudioGroupsSlow, groupsToBeMoved, audioMixerItem.mixer.masterGroup, null);
                bool flag2 = this.ValidDrag(parentNode, draggedItems) && !flag;
                if (perform && flag2 && this.m_MixersDroppedOnMixerCallback != null)
                {
                    this.m_MixersDroppedOnMixerCallback(this.GetAudioMixersFromItems(draggedItems), audioMixerItem.mixer);
                }
                return((!flag2) ? DragAndDropVisualMode.Rejected : DragAndDropVisualMode.Move);
            }
            return(DragAndDropVisualMode.None);
        }
        public override DragAndDropVisualMode DoDrag(TreeViewItem parentNode, TreeViewItem targetNode, bool perform, TreeViewDragging.DropPosition dragPos)
        {
            AudioMixerTreeViewDragging.DragData genericData = DragAndDrop.GetGenericData("AudioMixerDragging") as AudioMixerTreeViewDragging.DragData;
            if (genericData == null)
            {
                return(DragAndDropVisualMode.None);
            }
            List <AudioMixerItem> draggedItems   = genericData.m_DraggedItems;
            AudioMixerItem        audioMixerItem = parentNode as AudioMixerItem;

            if (audioMixerItem == null || genericData == null)
            {
                return(DragAndDropVisualMode.None);
            }
            List <AudioMixerGroupController> list = draggedItems.Select <AudioMixerItem, AudioMixerGroupController>((Func <AudioMixerItem, AudioMixerGroupController>)(i => i.mixer.masterGroup)).ToList <AudioMixerGroupController>();
            bool flag1 = AudioMixerController.WillModificationOfTopologyCauseFeedback(audioMixerItem.mixer.GetAllAudioGroupsSlow(), list, audioMixerItem.mixer.masterGroup, (List <AudioMixerController.ConnectionNode>)null);
            bool flag2 = this.ValidDrag(parentNode, draggedItems) && !flag1;

            if (perform && flag2 && this.m_MixersDroppedOnMixerCallback != null)
            {
                this.m_MixersDroppedOnMixerCallback(this.GetAudioMixersFromItems(draggedItems), audioMixerItem.mixer);
            }
            return(flag2 ? DragAndDropVisualMode.Move : DragAndDropVisualMode.Rejected);
        }