Exemple #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);
        }
Exemple #2
0
 public BasisNodeHolder(SceneNode node, basisT content)
 {
     this.Node                  = node;
     this.Content               = content;
     this.PathNodeList          = new DocumentNodeMarkerSortedList();
     this.lastRecalcChangeStamp = uint.MaxValue;
 }
Exemple #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;
        }
Exemple #4
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;
                }
            }
        }
Exemple #5
0
        public override IDropAction CreateInstance(DragDropContext context)
        {
            this.CheckNullArgument((object)context, "context");
            DocumentNodeMarkerSortedList result = (DocumentNodeMarkerSortedList)null;

            if (DragSourceHelper.FirstDataOfType <DocumentNodeMarkerSortedList>(context.Data, ref result))
            {
                ISceneInsertionPoint insertionPoint = this.GetInsertionPoint((object)result, context);
                if (insertionPoint != null)
                {
                    foreach (DocumentNodeMarker documentNodeMarker in result.Markers)
                    {
                        if (documentNodeMarker.Node != null && documentNodeMarker.Node.Type != null && !insertionPoint.CanInsert((ITypeId)documentNodeMarker.Node.Type))
                        {
                            return((IDropAction)null);
                        }
                    }
                    return((IDropAction) new DropMarkerListAction(result, insertionPoint));
                }
            }
            return((IDropAction)null);
        }
        private void FireSelectivePropertyChangedEvents(SceneUpdatePhaseEventArgs args)
        {
            SceneNode[] selectedNodes = this.designerContext.SelectionManager.SelectedNodes;
            DocumentNodeMarkerSortedList markerSortedList;

            if (selectedNodes == null)
            {
                markerSortedList = new DocumentNodeMarkerSortedList();
            }
            else
            {
                markerSortedList = new DocumentNodeMarkerSortedList(selectedNodes.Length);
                foreach (SceneNode sceneNode in selectedNodes)
                {
                    TextRangeElement          textRangeElement  = sceneNode as TextRangeElement;
                    BehaviorTriggerActionNode triggerActionNode = sceneNode as BehaviorTriggerActionNode;
                    if (textRangeElement != null)
                    {
                        this.FireAllPropertyChangedEvents(args);
                        return;
                    }
                    if (triggerActionNode != null && triggerActionNode.Parent != null)
                    {
                        markerSortedList.Add(triggerActionNode.Parent.DocumentNode.Marker);
                    }
                    markerSortedList.Add(sceneNode.DocumentNode.Marker);
                }
            }
            foreach (DocumentNodeChange documentNodeChange in args.DocumentChanges.DistinctChanges)
            {
                if (SceneView.HandleAnimationChanges(args.ViewModel, documentNodeChange, new SceneView.HandleAnimationChange(this.InvalidatePropertyFromAnimationChange)) == SceneView.AnimationChangeResult.InvalidateAll)
                {
                    this.FireAllPropertyChangedEvents(args);
                    return;
                }
            }
            if (this.designerContext.SelectionManager.SecondarySelectedNodes != null)
            {
                foreach (SceneNode sceneNode in this.designerContext.SelectionManager.SecondarySelectedNodes)
                {
                    if (sceneNode.DocumentNode.Marker != null)
                    {
                        markerSortedList.Add(sceneNode.DocumentNode.Marker);
                    }
                }
            }
            foreach (DocumentNodeMarkerSortedListBase.IntersectionResult intersectionResult in args.DocumentChanges.Intersect((DocumentNodeMarkerSortedListBase)markerSortedList, DocumentNodeMarkerSortedListBase.Flags.ContainedBy))
            {
                Stack <ReferenceStep> input = DocumentNodeMarkerUtilities.PropertyReferencePath(args.DocumentChanges.MarkerAt(intersectionResult.LeftHandSideIndex), markerSortedList.MarkerAt(intersectionResult.RightHandSideIndex));
                if (input.Count > 0)
                {
                    PropertyReference propertyReference1 = new PropertyReference(input);
                    this.AddPropertyReferenceToSortedList(propertyReference1, this.changedPropertyReferences);
                    if (PlatformTypes.Style.IsAssignableFrom(propertyReference1.FirstStep.DeclaringTypeId))
                    {
                        int startIndex;
                        for (startIndex = 0; startIndex < propertyReference1.Count; ++startIndex)
                        {
                            if (PlatformTypes.Setter.IsAssignableFrom(propertyReference1.ReferenceSteps[startIndex].DeclaringTypeId))
                            {
                                ++startIndex;
                                break;
                            }
                        }
                        foreach (SceneChange sceneChange in SceneChange.ChangesOfType <SceneChange>(args.DocumentChanges, args.ViewModel.RootNode))
                        {
                            PropertyReferenceSceneChange referenceSceneChange = sceneChange as PropertyReferenceSceneChange;
                            if (referenceSceneChange != null && referenceSceneChange.PropertyChanged != null)
                            {
                                PropertyReference propertyReference2 = referenceSceneChange.PropertyChanged.Subreference(0);
                                if (startIndex < propertyReference1.Count)
                                {
                                    propertyReference2 = propertyReference2.Append(propertyReference1.Subreference(startIndex));
                                }
                                this.AddPropertyReferenceToSortedList(propertyReference2, this.changedPropertyReferences);
                            }
                        }
                    }
                }
            }
            this.FireSelectivePropertyChangedEventsWorker(args.DirtyViewState);
        }