private void ViewModel_LateSceneUpdate(object target, SceneUpdatePhaseEventArgs args) { bool flag = false; if (args.IsDirtyViewState(SceneViewModel.ViewStateBits.RecordMode)) { this.OnPropertyChanged("IsRecording"); } if (args.IsDirtyViewState(SceneViewModel.ViewStateBits.ActiveTrigger | SceneViewModel.ViewStateBits.ActiveTimeline | SceneViewModel.ViewStateBits.ActiveStateContext)) { this.OnPropertyChanged("CanRecord"); flag = true; } else if (args.DocumentChanges != null && args.DocumentChanges.Count > 0) { foreach (DocumentNodeChange documentNodeChange in args.DocumentChanges.DistinctChanges) { if (documentNodeChange.IsPropertyChange && documentNodeChange.PropertyKey.Name == "Name" || documentNodeChange.ParentNode != null && (documentNodeChange.ParentNode.Type.Name == "Trigger" || documentNodeChange.ParentNode.Type.Name.Contains("Condition"))) { flag = true; break; } } } if (!flag) { return; } this.previousRecordTargetDescription = (RecordTargetDescriptionBase)null; this.OnPropertyChanged("RecordTargetDescription"); }
private void SelectionManager_LateActiveSceneUpdatePhase(object sender, SceneUpdatePhaseEventArgs args) { if (args.IsRadicalChange || args.IsDirtyViewState(SceneViewModel.ViewStateBits.IsEditable)) { this.OnActiveViewChanged(); } if (this.ActiveSceneViewModel == null) { return; } if (args.IsDirtyViewState(SceneViewModel.ViewStateBits.ElementSelection)) { SceneElement primarySelection = this.ActiveSceneViewModel.ElementSelectionSet.PrimarySelection; if (primarySelection != null) { TimelineItem timelineItem = this.TimelineItemManager.FindTimelineItem((SceneNode)primarySelection); if (timelineItem != null) { this.ElementTree.ScrollIntoView((object)timelineItem); } } } if (!args.IsDirtyPipelineCalcState(SceneViewModel.PipelineCalcBits.TimelineSortZOrder)) { return; } this.OnTimelineSortByZOrderChanged(); }
private void ViewModel_EarlySceneUpdatePhase(object sender, SceneUpdatePhaseEventArgs args) { if (this.IsSuspended) { return; } if (args.IsDirtyViewState(SceneViewModel.ViewStateBits.ElementSelection)) { SceneElementSelectionSet elementSelectionSet = this.ActiveSceneViewModel.ElementSelectionSet; BaseFrameworkElement frameworkElement = (BaseFrameworkElement)null; if (elementSelectionSet != null && elementSelectionSet.PrimarySelection != null && TextEditProxyFactory.IsEditableElement(elementSelectionSet.PrimarySelection)) { frameworkElement = elementSelectionSet.PrimarySelection as BaseFrameworkElement; } if (this.TextSource != frameworkElement) { this.PopSelfOrExitEditMode(); return; } } if (this.editProxy == null) { return; } if (args.IsDirtyViewState(SceneViewModel.ViewStateBits.EntireScene)) { foreach (DocumentNodeChange change in args.DocumentChanges.DistinctChanges) { if ((change.ParentNode == this.TextSource.DocumentNode || change.OldChildNode == this.TextSource.DocumentNode) && !this.editProxy.IsTextChange(change)) { this.PopSelfOrExitEditMode(); return; } } } foreach (DocumentNodeChange change in args.DocumentChanges.DistinctChanges) { if ((change.ParentNode == this.TextSource.DocumentNode || change.OldChildNode == this.TextSource.DocumentNode) && this.editProxy.IsTextChange(change)) { this.editProxy.ApplyPropertyChange(change); this.textChangesApplied = true; } } if (!this.editProxy.TextSource.IsViewObjectValid) { return; } this.SetIsTextEditingProperty(this.editProxy.TextSource, true); }
private void InvalidateAdornersOnDocumentChange(SceneUpdatePhaseEventArgs args) { if (args.IsDirtyViewState(SceneViewModel.ViewStateBits.CurrentValues)) { this.ForceAdornerUpdate(); } else { using (IEnumerator <DocumentNodeChange> enumerator = args.DocumentChanges.DistinctChanges.GetEnumerator()) { while (enumerator.MoveNext()) { DocumentNodeChange change = enumerator.Current; this.modelService.OnModelChanged(change); if (SceneView.HandleAnimationChanges(this.viewModel, change, (SceneView.HandleAnimationChange)((sceneElement, propertyReference) => this.InvalidateModelItemAdorner((SceneNode)sceneElement, (IProperty)propertyReference.LastStep, change))) == SceneView.AnimationChangeResult.InvalidateAll) { this.ForceAdornerUpdate(); break; } if (change.ParentNode != null) { this.InvalidateModelItemAdorner(this.viewModel.GetSceneNode((DocumentNode)change.ParentNode), change.PropertyKey, change); } } } } }
private void SelectionManager_LateActiveSceneUpdatePhase(object sender, SceneUpdatePhaseEventArgs args) { if (!this.IsEnabled) { this.UpdatePartsFromMetadata(); this.UpdateBasisNode(); this.UpdateUIStatus(); } else { this.changedObjectTreeElements = false; if (args.IsDirtyViewState(SceneViewModel.ViewStateBits.ActiveEditingContainer)) { this.UpdatePartsFromMetadata(); this.UpdateBasisNode(); } else { if (args.DocumentChanges.Count <= 0) { return; } this.elementSubscription.Update(args.ViewModel, args.DocumentChanges, args.DocumentChangeStamp); } foreach (PartsModel.PartsGroup partsGroup in this.parts.Values) { partsGroup.ResetClearSuppression(); } if (this.changedObjectTreeElements) { this.viewModel.TimelineItemManager.UpdateItems(); } this.UpdateUIStatus(); } }
private void SelectionManager_LateActiveSceneUpdatePhase(object sender, SceneUpdatePhaseEventArgs args) { if (args.IsRadicalChange || args.IsDirtyViewState(SceneViewModel.ViewStateBits.IsEditable | SceneViewModel.ViewStateBits.ElementSelection)) { this.UpdateModel(); } this.eventSubscription.Update(args.ViewModel, args.DocumentChanges, args.DocumentChangeStamp); }
private void SelectionManager_EarlyActiveSceneUpdatePhase(object sender, SceneUpdatePhaseEventArgs args) { if (!args.IsDirtyViewState(SceneViewModel.ViewStateBits.ActiveEditingContainer) && !args.IsDirtyViewState(SceneViewModel.ViewStateBits.IsEditable)) { return; } this.UpdateNoneTrigger(); }
private void OnSelectionManagerLateActiveSceneUpdatePhase(object sender, SceneUpdatePhaseEventArgs args) { if (this.CanExecuteChanged == null || !args.IsDirtyViewState(SceneViewModel.ViewStateBits.IsEditable | SceneViewModel.ViewStateBits.ActiveTrigger | SceneViewModel.ViewStateBits.ActiveTimeline | SceneViewModel.ViewStateBits.ElementSelection | SceneViewModel.ViewStateBits.TextSelection | SceneViewModel.ViewStateBits.KeyFrameSelection | SceneViewModel.ViewStateBits.AnimationSelection | SceneViewModel.ViewStateBits.StoryboardSelection | SceneViewModel.ViewStateBits.CurrentValues | SceneViewModel.ViewStateBits.ChildPropertySelection | SceneViewModel.ViewStateBits.BehaviorSelection)) { return; } this.CanExecuteChanged((object)this, EventArgs.Empty); }
private void SelectionManager_LateActiveSceneUpdatePhase(object sender, SceneUpdatePhaseEventArgs args) { if (!args.IsDirtyViewState(SceneViewModel.ViewStateBits.IsEditable | SceneViewModel.ViewStateBits.ElementSelection | SceneViewModel.ViewStateBits.ActiveSceneInsertionPoint | SceneViewModel.ViewStateBits.LockedInsertionPoint)) { return; } this.RevalidateToolEnabledState(); }
private void ActiveSceneViewModel_EarlySceneUpdatePhase(object sender, SceneUpdatePhaseEventArgs args) { if (!args.IsDirtyViewState(SceneViewModel.ViewStateBits.ElementSelection) || this.action != null || (this.EditingElement == null || this.ActiveDocument == null) || this.EditingElement.IsAttached && this.ActiveSceneViewModel.ElementSelectionSet != null && this.ActiveSceneViewModel.ElementSelectionSet.IsSelected((SceneElement)this.EditingElement)) { return; } this.OnDetach(); this.OnAttach(); }
private void OnViewModelEarlySceneUpdatePhase(object sender, SceneUpdatePhaseEventArgs args) { if (!this.initialized) { this.viewService.Initialize(); this.initialized = true; } if (args.IsDirtyViewState(SceneViewModel.ViewStateBits.ElementSelection)) { this.UpdateSelection(); } this.viewService.OnLayoutUpdated(); }
private void SelectionManager_LateActiveSceneUpdatePhase(object sender, SceneUpdatePhaseEventArgs args) { if (this.ActiveSceneViewModel != null && this.viewModels.Count == 0 || this.ActiveSceneViewModel == null && this.viewModels.Count != 0) { this.RefreshBreadcrumbTrail(); this.OnPropertyChanged("IsExpanded"); } if (args.IsDirtyViewState(SceneViewModel.ViewStateBits.ActiveEditingContainer | SceneViewModel.ViewStateBits.InactiveEditingContainer | SceneViewModel.ViewStateBits.EditContextHistory | SceneViewModel.ViewStateBits.ElementSelection)) { this.RefreshBreadcrumbTrail(); } if (!args.IsDirtyViewState(SceneViewModel.ViewStateBits.ElementSelection)) { return; } foreach (Breadcrumb breadcrumb in (Collection <Breadcrumb>) this.Trail) { if (args.ViewModel == breadcrumb.LocalViewModel) { breadcrumb.RefreshName(); breadcrumb.RefreshIsMenuEnabled(); } } }
protected override void OnEarlySceneUpdatePhase(SceneUpdatePhaseEventArgs e) { base.OnEarlySceneUpdatePhase(e); if (e.IsDirtyViewState(SceneViewModel.ViewStateBits.PropertySelection)) { this.RebuildAdornerSets(); } else { foreach (DocumentNodeChange change in e.DocumentChanges.DistinctChanges) { if (this.ShouldRebuildAdorner(change)) { this.RebuildAdornerSets(); break; } } } }
private void SceneViewModel_LateSceneUpdatePhase(object sender, SceneUpdatePhaseEventArgs args) { if (this.sceneViewModel.DesignerContext == null || this.sceneViewModel.DesignerContext.ActiveView == null) { return; } if (args.IsRadicalChange || this.referenceSub.CurrentViewModel == null || this.annotationSub.CurrentViewModel == null) { this.annotationSub.SetSceneRootNodeAsTheBasisNode(this.sceneViewModel); this.referenceSub.SetSceneRootNodeAsTheBasisNode(this.sceneViewModel); } else { this.annotationSub.Update(this.sceneViewModel, args.DocumentChanges, args.DocumentChangeStamp); this.referenceSub.Update(this.sceneViewModel, args.DocumentChanges, args.DocumentChangeStamp); } if (!args.IsDirtyViewState(SceneViewModel.ViewStateBits.AnnotationSelection) || this.AnnotationLayer == null) { return; } EnumerableExtensions.ForEach <AnnotationVisual>(this.AnnotationVisuals, (Action <AnnotationVisual>)(visual => visual.ViewModel.RefreshProperty("Selected"))); }
private void SelectionManager_LateActiveSceneUpdatePhase(object sender, SceneUpdatePhaseEventArgs args) { this.designerContext.ResourceManager.OnSceneUpdate(args); TextSelectionSet textSelectionSet = this.designerContext.SelectionManager.TextSelectionSet; SceneElementSelectionSet elementSelectionSet = this.designerContext.SelectionManager.ElementSelectionSet; if (args.IsDirtyViewState(SceneViewModel.ViewStateBits.IsEditable | SceneViewModel.ViewStateBits.ActiveTrigger | SceneViewModel.ViewStateBits.ActiveTimeline | SceneViewModel.ViewStateBits.ElementSelection | SceneViewModel.ViewStateBits.TextSelection | SceneViewModel.ViewStateBits.KeyFrameSelection | SceneViewModel.ViewStateBits.AnimationSelection | SceneViewModel.ViewStateBits.StoryboardSelection | SceneViewModel.ViewStateBits.CurrentValues | SceneViewModel.ViewStateBits.ChildPropertySelection | SceneViewModel.ViewStateBits.BehaviorSelection)) { this.FireAllPropertyChangedEvents(args); } else { if (args.DocumentChanges.Count <= 0) { return; } foreach (DocumentNodeChange documentNodeChange in args.DocumentChanges.DistinctChanges) { if (documentNodeChange.ParentNode != null && documentNodeChange.ParentNode.TargetType == typeof(DictionaryEntry)) { this.FireAllPropertyChangedEvents(args); return; } } this.changedPropertyReferences = new List <PropertyReference>(); foreach (SceneChange sceneChange in SceneChange.ChangesOfType <SceneChange>(args.DocumentChanges, args.ViewModel.RootNode)) { if (sceneChange is StyleSceneChange) { this.FireAllPropertyChangedEvents(args); return; } } this.FireSelectivePropertyChangedEvents(args); } }
private void SelectionManager_LateActiveSceneUpdatePhase(object sender, SceneUpdatePhaseEventArgs args) { if (args.IsDirtyViewState(SceneViewModel.ViewStateBits.ActiveEditingContainer) || args.IsDirtyViewState(SceneViewModel.ViewStateBits.IsEditable)) { this.UpdateFromEditingContainerChange(false); } this.triggerSubscription.Update(args.ViewModel, args.DocumentChanges, args.DocumentChangeStamp); foreach (SubSubscription subSubscription in this.delayedUpdates) { subSubscription.ProcessChanges(args.DocumentChangeStamp); } this.delayedUpdates.Clear(); if (args.IsDirtyViewState(SceneViewModel.ViewStateBits.ActiveTrigger | SceneViewModel.ViewStateBits.RecordMode) && this.ActiveSceneViewModel != null) { this.UpdateActiveTrigger(); if (this.SelectedItem == null || this.SelectedItem is NoneTriggerModel) { if (this.locked3DElements.Count != 0) { using (SceneEditTransaction editTransaction = this.ActiveSceneViewModel.CreateEditTransaction("Unlock3DElements", true)) { SceneElementSelectionSet elementSelectionSet = this.ActiveSceneViewModel.ElementSelectionSet; if (elementSelectionSet != null && this.selectionChangesSinceLock <= 2) { foreach (Base3DElement base3Delement in this.locked3DElements) { if (base3Delement.IsAttached) { elementSelectionSet.ExtendSelection((SceneElement)base3Delement); } } } editTransaction.Commit(); } this.locked3DElements.Clear(); } } else if (this.locked3DElements.Count == 0) { this.selectionChangesSinceLock = 0; SceneElementSelectionSet elementSelectionSet = this.ActiveSceneViewModel.ElementSelectionSet; if (elementSelectionSet != null) { using (SceneEditTransaction editTransaction = this.ActiveSceneViewModel.CreateEditTransaction("Lock3DElements", true)) { foreach (SceneElement sceneElement in elementSelectionSet.Selection) { Base3DElement base3Delement = sceneElement as Base3DElement; if (base3Delement != null) { this.locked3DElements.Add(base3Delement); elementSelectionSet.RemoveSelection((SceneElement)base3Delement); } } editTransaction.Commit(); } } } } if (!args.IsDirtyViewState(SceneViewModel.ViewStateBits.ElementSelection)) { return; } ++this.selectionChangesSinceLock; }
private bool SelectionSetChanged(SceneUpdatePhaseEventArgs args) { return(args.IsDirtyViewState(SceneViewModel.ViewStateBits.ElementSelection | SceneViewModel.ViewStateBits.TextSelection | SceneViewModel.ViewStateBits.KeyFrameSelection | SceneViewModel.ViewStateBits.StoryboardSelection | SceneViewModel.ViewStateBits.ChildPropertySelection | SceneViewModel.ViewStateBits.BehaviorSelection)); }