示例#1
0
 private void SetEffect(TimelineDragDescriptor descriptor)
 {
     this.DropEffectId = DropEffectId.None;
     this.TargetName   = string.Empty;
     if (descriptor.IsNestingContents)
     {
         if (descriptor.IsCreating)
         {
             this.DropEffectId = DropEffectId.CreateAsParent;
         }
         else if (descriptor.AllowCopy)
         {
             this.DropEffectId = DropEffectId.CopyAsParent;
         }
         else if (descriptor.AllowMove)
         {
             this.DropEffectId = DropEffectId.MoveAsParent;
         }
         this.TargetName = this.GetDisplayName(descriptor.ReplacedChild);
     }
     else if (descriptor.IsReplacingChild)
     {
         this.DropEffectId = !descriptor.AllowCopy ? DropEffectId.Replace : DropEffectId.ReplaceAsCopy;
         this.TargetName   = this.GetDisplayName(descriptor.ReplacedChild);
     }
     else if (descriptor.IsCreating)
     {
         this.DropEffectId = DropEffectId.Create;
         this.TargetName   = this.GetDisplayName(descriptor.TargetParent);
     }
     else if (descriptor.AllowCopy)
     {
         this.DropEffectId = DropEffectId.Copy;
         this.TargetName   = this.GetDisplayName(descriptor.TargetParent);
     }
     else
     {
         if (!descriptor.AllowMove)
         {
             return;
         }
         this.DropEffectId = DropEffectId.Move;
         this.TargetName   = this.GetDisplayName(descriptor.TargetParent);
     }
 }
示例#2
0
        private void SetDataBinding(DataBindingDragDropModel feedback)
        {
            if (feedback == null)
            {
                return;
            }
            this.SourceName = feedback.SourceName;
            this.TargetName = feedback.TargetNodeName;
            string targetPropertyName = feedback.TargetPropertyName;

            if (!string.IsNullOrEmpty(targetPropertyName))
            {
                DragTipModel dragTipModel = this;
                string       str          = dragTipModel.TargetName + "." + targetPropertyName;
                dragTipModel.TargetName = str;
            }
            if ((feedback.DropFlags & DataBindingDragDropFlags.CreateElement) == DataBindingDragDropFlags.CreateElement)
            {
                if (DataBindingModeModel.Instance.Mode == DataBindingMode.Details)
                {
                    this.DropEffectId = DropEffectId.CreateDetails;
                }
                else
                {
                    this.DropEffectId = DropEffectId.CreateElementAndBinding;
                }
            }
            else
            {
                if ((feedback.DropFlags & DataBindingDragDropFlags.SetBinding) != DataBindingDragDropFlags.SetBinding)
                {
                    return;
                }
                this.DropEffectId = DropEffectId.SetBinding;
            }
        }