Esempio n. 1
0
        public override IDropAction CreateInstance(DragDropContext context)
        {
            this.CheckNullArgument((object)context, "context");
            TypeAsset result1 = (TypeAsset)null;

            if (DragSourceHelper.FirstDataOfType <TypeAsset>(context.Data, ref result1) && PlatformTypes.IsEffectType((ITypeId)result1.Type))
            {
                ISceneInsertionPoint insertionPoint = this.GetInsertionPoint((object)result1, context);
                if (insertionPoint != null)
                {
                    return((IDropAction) new DropEffectAssetAction(result1, insertionPoint));
                }
            }
            DocumentNodeMarkerSortedList result2 = (DocumentNodeMarkerSortedList)null;

            if (DragSourceHelper.FirstDataOfType <DocumentNodeMarkerSortedList>(context.Data, ref result2) && result2.Count == 1)
            {
                DocumentNodeMarker marker = result2.MarkerAt(0);
                if (marker != null && marker.Node != null && PlatformTypes.IsEffectType((ITypeId)marker.Node.Type))
                {
                    SceneViewModel viewModel = context.Target.TimelineItemManager.ViewModel;
                    SceneNode      sceneNode = SceneNode.FromMarker <SceneNode>(marker, viewModel);
                    if (sceneNode != null)
                    {
                        ISceneInsertionPoint insertionPoint = this.GetInsertionPoint((object)sceneNode, context);
                        if (insertionPoint != null)
                        {
                            return((IDropAction) new DropEffectSceneNodeAction(sceneNode, insertionPoint));
                        }
                    }
                }
            }
            return((IDropAction)null);
        }
Esempio n. 2
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;
                }
            }
        }
Esempio n. 3
0
        private void RecalculateBasisNode(int index)
        {
            SceneNodeSubscription <basisT, pathT> .BasisNodeHolder basisNodeHolder = this.basisNodeList.ValueAt(index);
            if ((int)this.currentViewModel.XamlDocument.ChangeStamp == (int)basisNodeHolder.lastRecalcChangeStamp)
            {
                return;
            }
            SceneNodeSubscription <basisT, pathT> .BasisNodeInfo basisNodeInfo = this.BasisNodeAt(index);
            DocumentNodeMarkerSortedList markerSortedList = basisNodeHolder.PathNodeList;

            basisNodeHolder.PathNodeList = SceneNode.GetMarkerList <SceneNode>(this.path.Query(basisNodeHolder.Node), true);
            foreach (DocumentNodeMarkerSortedListBase.IntersectionResult intersectionResult in markerSortedList.UnionIdentity((DocumentNodeMarkerSortedListBase)basisNodeHolder.PathNodeList))
            {
                if (intersectionResult.RightHandSideIndex == -1)
                {
                    this.RemovePathNode(basisNodeInfo, this.pathNodeList.FindPosition(markerSortedList.MarkerAt(intersectionResult.LeftHandSideIndex)));
                }
                else if (intersectionResult.LeftHandSideIndex == -1)
                {
                    DocumentNodeMarker newMarker = basisNodeHolder.PathNodeList.MarkerAt(intersectionResult.RightHandSideIndex);
                    this.AddPathNode(basisNodeInfo, newMarker);
                }
            }
            basisNodeHolder.lastRecalcChangeStamp = this.currentViewModel.XamlDocument.ChangeStamp;
        }