private void IncrementalRecalculateBasisNode(int index, DocumentNodeChangeList damage, uint documentChangeStamp) { SceneNodeSubscription <basisT, pathT> .BasisNodeHolder basisNodeHolder = this.basisNodeList.ValueAt(index); DocumentNodeMarker ancestor = this.basisNodeList.MarkerAt(index); if ((int)basisNodeHolder.lastRecalcChangeStamp == (int)documentChangeStamp) { return; } SceneNodeSubscription <basisT, pathT> .BasisNodeInfo basisNodeInfo = this.BasisNodeAt(index); if (damage.Count == 0) { this.RecalculateBasisNode(index); } foreach (int index1 in damage.FindDescendants(ancestor)) { DocumentNodeMarker documentNodeMarker = damage.MarkerAt(index1); if (documentNodeMarker.IsDeleted) { this.RemovePathNodes(basisNodeInfo, documentNodeMarker); basisNodeHolder.PathNodeList.RemoveSelfAndDescendants(documentNodeMarker); } else { foreach (SceneNode sceneNode in this.IncrementalTraverseWithSearchPath(basisNodeHolder.Node, documentNodeMarker)) { this.AddPathNode(basisNodeInfo, sceneNode.DocumentNode.Marker); basisNodeHolder.PathNodeList.Add(sceneNode.DocumentNode.Marker); } } } basisNodeHolder.lastRecalcChangeStamp = documentChangeStamp; }
public void Update(SceneViewModel viewModel, DocumentNodeChangeList damage, uint damageChangeStamp) { this.ValidateBasisNodeStateWithViewModel(viewModel); int count = this.basisNodeList.Count; this.ChainUpdate(viewModel, (DocumentNodeMarkerSortedListBase)null, (IEnumerable <SceneNode>)null, damage, damageChangeStamp); }
public RelatedDocumentInfo(SceneDocument document) { this.document = document; this.damage = new DocumentNodeChangeList(); document.XamlDocument.RegisterChangeList(this.damage); this.UpdateChangeStamp(); }
public static IEnumerable <T> ChangesOfType <T>(DocumentNodeChangeList damage, SceneNode scope) where T : SceneChange { foreach (T obj in SceneChange.Changes(damage, scope, typeof(T))) { yield return(obj); } }
public void UpdateForAddedTypes(DocumentNodeChangeList damage) { foreach (DocumentNodeChange documentNodeChange in damage.DistinctChanges) { if (documentNodeChange.NewChildNode != null) { this.ProcessSubtree(documentNodeChange.NewChildNode); } } }
protected override void Update(DocumentNodeChangeList changes, uint documentChangeStamp) { base.Update(changes, documentChangeStamp); this.conditionSubscription.Update(this.SceneNode.ViewModel, changes, documentChangeStamp); this.setterSubscription.Update(this.SceneNode.ViewModel, changes, documentChangeStamp); if (this.baseTriggerNode is Microsoft.Expression.DesignSurface.ViewModel.TriggerNode) { this.conditions[0].Update(); } this.SortAfterUpdate(); }
public void Update(SceneUpdateTypeFlags updateType, DocumentNodeChangeList damage, uint changeStamp) { if (this.activeStoryboard == null || damage.Count == 0 || ((int)this.lastUpdateChangeStamp == (int)changeStamp || !this.activeStoryboard.IsInDocument)) { return; } this.lastUpdateChangeStamp = changeStamp; bool flag = false; foreach (DocumentNodeChange documentNodeChange in damage.DistinctChanges) { if (this.activeStoryboard.DocumentNode.Marker.Equals((object)documentNodeChange.ParentNode.Marker) || this.activeStoryboard.DocumentNode.Marker.Contains(documentNodeChange.ParentNode.Marker)) { if (documentNodeChange.IsPropertyChange && documentNodeChange.ParentNode.IsInDocument) { DocumentCompositeNode documentCompositeNode = documentNodeChange.ParentNode; while (documentCompositeNode != null && !PlatformTypes.Timeline.IsAssignableFrom((ITypeId)documentCompositeNode.Type)) { documentCompositeNode = documentCompositeNode.Parent; } FromToAnimationSceneNode animationSceneNode = this.viewModel.GetSceneNode((DocumentNode)documentCompositeNode) as FromToAnimationSceneNode; AnimationProxyManager.AnimationProxyData animationProxyData; if (animationSceneNode != null && animationSceneNode.IsOptimized && this.targetPathToProxyData.TryGetValue(new AnimationProxyManager.TargetNamePropertyPair((TimelineSceneNode)animationSceneNode), out animationProxyData)) { animationProxyData.OptimizedAnimationPropertyChanged = true; } } else if (documentNodeChange.Action == DocumentNodeChangeAction.Add && PlatformTypes.Timeline.IsAssignableFrom((ITypeId)documentNodeChange.NewChildNode.Type)) { TimelineSceneNode timeline = this.viewModel.GetSceneNode(documentNodeChange.NewChildNode) as TimelineSceneNode; AnimationProxyManager.AnimationProxyData animationProxyData; if (timeline != null && AnimationProxyManager.IsOptimizedAnimation(timeline) && this.targetPathToProxyData.TryGetValue(new AnimationProxyManager.TargetNamePropertyPair(timeline), out animationProxyData)) { animationProxyData.OptimizedAnimationAdded = true; } } flag = true; } } if (!flag) { return; } if ((updateType & SceneUpdateTypeFlags.UndoRedo) == SceneUpdateTypeFlags.None && (updateType & SceneUpdateTypeFlags.Canceled) == SceneUpdateTypeFlags.None) { this.UpdateProxyTable(AnimationProxyManager.AllowedChange.Any); } else { this.UpdateProxyTable(AnimationProxyManager.AllowedChange.None); } }
public static IEnumerable <SceneChange> Changes(DocumentNodeChangeList damage, SceneNode scope, Type sceneChangeType) { IEnumerable <DocumentNodeChange> values = scope != null?damage.FindDescendantValues(scope.DocumentNode.Marker) : damage.Values; foreach (DocumentNodeChange documentNodeChange in values) { if (documentNodeChange.Annotation != null) { List <SceneChange> sceneChanges = (List <SceneChange>)documentNodeChange.Annotation; foreach (SceneChange sceneChange in sceneChanges) { if (sceneChangeType == (Type)null || sceneChangeType.IsAssignableFrom(sceneChange.GetType())) { yield return(sceneChange); } } } } }
public SceneUpdatePhaseEventArgs(SceneViewModel viewModel, bool sceneSwitched, bool rootNodeChanged) { this.viewModel = viewModel; this.documentChanges = new DocumentNodeChangeList(); if (this.viewModel != null) { this.dirtyViewState = viewModel.DirtyState; this.viewStateChangeStamp = viewModel.ChangeStamp; this.documentChanges.Merge((DocumentNodeMarkerSortedListOf <DocumentNodeChange>)viewModel.Damage, false); this.documentChangeStamp = viewModel.XamlDocument.ChangeStamp; this.viewModel.AnnotateDamage(this.documentChanges); this.dirtyPipelineCalcState = viewModel.DirtyPipelineCalcState; this.pipelineCalcChangeStamp = viewModel.PipelineCalcChangeStamp; } this.sceneSwitched = sceneSwitched; this.rootNodeChanged = rootNodeChanged; if (!this.sceneSwitched && !this.rootNodeChanged) { return; } this.dirtyViewState = SceneViewModel.ViewStateBits.EntireScene; this.dirtyPipelineCalcState = SceneViewModel.PipelineCalcBits.EntireScene; }
protected virtual void Update(DocumentNodeChangeList changes, uint documentChangeStamp) { }
public void ChainUpdate(SceneViewModel viewModel, DocumentNodeMarkerSortedListBase newBasisNodes, IEnumerable <SceneNode> bonusBasisNodes, DocumentNodeChangeList damage, uint damageChangeStamp) { this.ValidateBasisNodeStateWithViewModel(viewModel); if (this.currentViewModel == null) { return; } SearchScope searchScope = (SearchScope)6; SearchScope scope = this.path.Scope; bool flag1 = (scope & searchScope) != scope; bool flag2 = false; if (this.path.NumberOfSteps == 1) { SearchStep searchStep = this.path.Step(0); if (searchStep.Axis == SearchAxis.DocumentDescendant && (searchStep.Predicate.AnalysisScope & (SearchScope)6) == searchStep.Predicate.AnalysisScope) { flag2 = true; } } if (newBasisNodes != null || bonusBasisNodes != null) { DocumentNodeMarkerSortedListOf <SceneNodeSubscription <basisT, pathT> .BasisNodeHolder> newBasisNodeList = new DocumentNodeMarkerSortedListOf <SceneNodeSubscription <basisT, pathT> .BasisNodeHolder>(newBasisNodes.Count); if (newBasisNodes != null) { for (int index = 0; index < newBasisNodes.Count; ++index) { newBasisNodeList.Add(newBasisNodes.MarkerAt(index), (SceneNodeSubscription <basisT, pathT> .BasisNodeHolder)null); } } if (bonusBasisNodes != null) { foreach (SceneNode sceneNode in bonusBasisNodes) { newBasisNodeList.Add(sceneNode.DocumentNode.Marker, (SceneNodeSubscription <basisT, pathT> .BasisNodeHolder)null); } } this.SetBasisNodesWorker(viewModel, newBasisNodeList); } foreach (DocumentNodeMarkerSortedListBase.IntersectionResult intersectionResult in this.pathNodeList.Intersect((DocumentNodeMarkerSortedListBase)damage, DocumentNodeMarkerSortedListBase.Flags.Contains)) { this.OnPathNodeContentChanged(this.pathNodeList.ValueAt(intersectionResult.LeftHandSideIndex), damage.MarkerAt(intersectionResult.RightHandSideIndex), damage.ValueAt(intersectionResult.RightHandSideIndex)); } if (flag1) { this.Recalculate(viewModel); } else { for (int index = this.basisNodeList.Count - 1; index >= 0; --index) { if (this.basisNodeList.MarkerAt(index).IsDeleted) { this.RemoveBasisNode(index); } else if (flag2) { this.IncrementalRecalculateBasisNode(index, damage, damageChangeStamp); } else { this.RecalculateBasisNode(index); } } } }
public void Unregister() { this.document.XamlDocument.UnregisterChangeList(this.damage); this.damage.Clear(); this.damage = (DocumentNodeChangeList)null; }
protected override void Update(DocumentNodeChangeList changes, uint documentChangeStamp) { this.actionSubscription.Update(this.SceneNode.ViewModel, changes, documentChangeStamp); this.Update(); }