Esempio n. 1
0
        public void OnDragBegin(DragBeginEventArgs e)
        {
            if (this.nodePath == null)
            {
                return;
            }
            List <DataSchemaItem> list1 = new List <DataSchemaItem>(Enumerable.OfType <DataSchemaItem>((IEnumerable)this.SelectionContext));

            if (list1.Count <= 0 || list1.Count != this.SelectionContext.Count || !list1.Contains(this))
            {
                return;
            }
            DataSchemaNode            parent         = list1[0].DataSchemaNode.Parent;
            DataSourceNode            dataSourceNode = list1[0].DataSourceNode;
            List <DataSchemaNodePath> list2          = new List <DataSchemaNodePath>();

            list2.Add(list1[0].nodePath.AbsolutePath);
            for (int index = 1; index < list1.Count; ++index)
            {
                if (parent != list1[index].DataSchemaNode.Parent || dataSourceNode != list1[index].DataSourceNode)
                {
                    return;
                }
                list2.Add(list1[index].nodePath.AbsolutePath);
            }
            DataSchemaNodePathCollection nodePathCollection = new DataSchemaNodePathCollection((IEnumerable <DataSchemaNodePath>)list2);

            using (DataBindingDragDropManager.GetDragDropToken())
            {
                int num = (int)DragSourceHelper.DoDragDrop(e.DragSource, (object)nodePathCollection, DragDropEffects.Copy | DragDropEffects.Move);
            }
        }
        public override IDropAction CreateInstance(DragDropContext context)
        {
            this.CheckNullArgument((object)context, "context");
            DataSchemaNodePathCollection result = (DataSchemaNodePathCollection)null;

            if (DragSourceHelper.FirstDataOfType <DataSchemaNodePathCollection>(context.Data, ref result))
            {
                BindingSceneInsertionPoint insertionPoint = context.Target.GetInsertionPoint((object)result, context) as BindingSceneInsertionPoint;
                if (insertionPoint != null && insertionPoint.SceneNode != null)
                {
                    return((IDropAction) new DropBindingAction(result, insertionPoint));
                }
            }
            return((IDropAction)null);
        }
Esempio n. 3
0
        private void SetSource(TimelineDragDescriptor descriptor)
        {
            DocumentNodeMarkerSortedList result1 = (DocumentNodeMarkerSortedList)null;

            if (DragSourceHelper.FirstDataOfType <DocumentNodeMarkerSortedList>(descriptor.SourceObject, ref result1))
            {
                if (result1.Count == 1 && descriptor.TargetItem != null)
                {
                    if (!this.SetSource((object)descriptor.TargetItem.TimelineItemManager.ViewModel.GetSceneNode(result1.MarkerAt(0).Node)))
                    {
                        ;
                    }
                }
                else
                {
                    this.SourceName = string.Format((IFormatProvider)CultureInfo.CurrentCulture, StringTable.DragMultipleItemsFormat, new object[1]
                    {
                        (object)result1.Count
                    });
                    this.SourceType = string.Empty;
                }
            }
            else
            {
                Asset result2 = (Asset)null;
                if (DragSourceHelper.FirstDataOfType <Asset>(descriptor.SourceObject, ref result2) && this.SetSource((object)result2))
                {
                    return;
                }
                DataSchemaNodePathCollection result3 = (DataSchemaNodePathCollection)null;
                if (DragSourceHelper.FirstDataOfType <DataSchemaNodePathCollection>(descriptor.SourceObject, ref result3))
                {
                    this.SetDataBinding(descriptor.UserData as DataBindingDragDropModel);
                }
                else
                {
                    this.SourceName = this.SourceType = string.Empty;
                }
            }
        }