コード例 #1
0
ファイル: AudioBusWorker.cs プロジェクト: vildninja/ngj15
        public static bool CanBeDuckedBy(InAudioBus selectedNode, InAudioBus dragging)
        {
            var draggingBus = dragging;

            if (draggingBus == null)
            {
                return(false);
            }
            //Does it already exist in the collection?
            if (selectedNode.DuckedBy.TrueForAny(data => data.DuckedBy == dragging))
            {
                return(false);
            }

            if (draggingBus.IsRoot)
            {
                return(false);
            }

            if (NodeWorker.IsChildOf(selectedNode, draggingBus))
            {
                return(false);
            }

            if (NodeWorker.IsParentOf(selectedNode.GetParent, draggingBus))
            {
                return(false);
            }
            return(true);
        }
コード例 #2
0
        public static bool CanDropObjects(InAudioEventNode audioEvent, Object[] objects)
        {
            if (objects.Length == 0 || audioEvent == null)
            {
                return(false);
            }

            if (audioEvent.Type == EventNodeType.Event)
            {
                bool bankLinkDrop;
                bool audioBusDrop;
                var  audioNodeDrop = CanDropNonEvent(objects, out bankLinkDrop, out audioBusDrop);

                return(audioNodeDrop | bankLinkDrop | audioBusDrop);
            }
            else if (audioEvent.Type == EventNodeType.Folder || audioEvent.Type == EventNodeType.Root)
            {
                var draggingEvent = objects[0] as InAudioEventNode;
                if (draggingEvent != null)
                {
                    if (draggingEvent.Type == EventNodeType.Event)
                    {
                        return(true);
                    }
                    if ((draggingEvent.Type == EventNodeType.Folder && !NodeWorker.IsChildOf(draggingEvent, audioEvent)) ||
                        draggingEvent.Type == EventNodeType.EventGroup)
                    {
                        return(true);
                    }
                }
                else
                {
                    bool bankLinkDrop;
                    bool audioBusDrop;
                    var  audioNodeDrop = CanDropNonEvent(objects, out bankLinkDrop, out audioBusDrop);

                    return(audioNodeDrop | bankLinkDrop | audioBusDrop);
                }
            }
            else if (audioEvent.Type == EventNodeType.EventGroup)
            {
                var draggingEvent = objects[0] as InAudioEventNode;
                if (draggingEvent == null)
                {
                    return(false);
                }
                if (draggingEvent.Type == EventNodeType.Event)
                {
                    return(true);
                }
            }


            return(false);
        }