コード例 #1
0
 protected override bool OnQueryCanDrop(TimelineDragDescriptor descriptor)
 {
     descriptor.DisableInBetween();
     if (!this.InsertionPoint.CanInsert((ITypeId)this.SourceData.Type))
     {
         return(false);
     }
     if (descriptor.AllowCopy)
     {
         descriptor.SetCopyInto(this.InsertionPoint);
     }
     else
     {
         descriptor.SetMoveInto(this.InsertionPoint);
     }
     descriptor.TryReplace((object)this.SourceData, SmartInsertionPoint.From(this.InsertionPoint), this.DestinationCollection);
     return(true);
 }
コード例 #2
0
        private bool CanDrop(SceneNode node, TimelineDragDescriptor descriptor)
        {
            SceneElement sceneElement;

            if (!descriptor.AllowCopy && !descriptor.AllowMove || ((sceneElement = node as SceneElement) == null || !this.InsertionPoint.CanInsert((ITypeId)sceneElement.Type)))
            {
                return(false);
            }
            if (descriptor.AllowCopy)
            {
                descriptor.SetCopyInto(this.InsertionPoint);
            }
            else
            {
                if (sceneElement.IsAncestorOf(this.TargetNode))
                {
                    return(false);
                }
                descriptor.SetMoveInto(this.InsertionPoint);
            }
            descriptor.TryReplace((object)sceneElement, SmartInsertionPoint.From(this.InsertionPoint), this.DestinationCollection);
            return(true);
        }
コード例 #3
0
        protected override bool OnQueryCanDrop(TimelineDragDescriptor descriptor)
        {
            descriptor.DisableInBetween();
            if (!this.InsertionPoint.CanInsert((ITypeId)this.SourceData.Type))
            {
                return(false);
            }
            if (descriptor.AllowCopy)
            {
                descriptor.SetCopyInto(this.InsertionPoint);
            }
            else
            {
                descriptor.SetMoveInto(this.InsertionPoint);
            }
            DocumentNodePath valueAsDocumentNode = this.TargetNode.GetLocalValueAsDocumentNode(Base2DElement.EffectProperty);

            if (valueAsDocumentNode != null && valueAsDocumentNode.Node == this.SourceData.DocumentNode)
            {
                return(false);
            }
            descriptor.TryReplace((object)this.SourceData, SmartInsertionPoint.From(this.InsertionPoint), this.DestinationCollection);
            return(true);
        }