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); } } } } }
public void AddChange(DocumentNodeMarker marker, DocumentNodeChange change, IList <SubSubscription> delayedUpdates) { if (this.accumulatedChanges.Count == 0) { delayedUpdates.Add(this); } this.accumulatedChanges.Add(marker, change); }
public override bool IsTextChange(DocumentNodeChange change) { if (change.PropertyKey == null || !change.PropertyKey.Equals((object)TextBoxElement.TextProperty)) { return(base.IsTextChange(change)); } return(true); }
public override bool IsTextChange(DocumentNodeChange change) { if (change.PropertyKey != this.targetProperty.LastStep) { return(base.IsTextChange(change)); } return(true); }
public virtual bool IsTextChange(DocumentNodeChange change) { if (!DesignTimeProperties.IsTextEditingProperty.Equals((object)change.PropertyKey)) { return(this.IsTextPropertyChange(change)); } return(true); }
internal void OnModelChanged(DocumentNodeChange change) { if (this.ModelChanged == null) { return; } this.ModelChanged((object)this, (ModelChangedEventArgs) new SceneNodeModelChangedEventArgs(this.viewModel, change)); }
public override void ApplyPropertyChange(DocumentNodeChange change) { base.ApplyPropertyChange(change); if (!RichTextBoxRangeElement.ShouldClearPropertyOnTextRuns((SceneNode)this.TextSource, new PropertyReference((ReferenceStep)change.PropertyKey))) { return; } this.ClearTextProperty(change.PropertyKey); }
public override bool IsTextChange(DocumentNodeChange change) { Microsoft.Expression.DesignModel.DocumentModel.DocumentNode documentNode = ((DocumentCompositeNode)this.TextSource.DocumentNode).Properties[RichTextBoxElement.BlocksProperty]; if ((change.PropertyKey == null || !change.PropertyKey.Equals((object)RichTextBoxElement.BlocksProperty)) && (documentNode == null || !documentNode.IsAncestorOf((Microsoft.Expression.DesignModel.DocumentModel.DocumentNode)change.ParentNode))) { return(base.IsTextChange(change)); } return(true); }
protected bool IsTextPropertyChange(DocumentNodeChange change) { if (change.PropertyKey == null) { return(false); } if (!change.PropertyKey.Equals((object)this.ResolveProperty(ControlElement.FontFamilyProperty)) && !change.PropertyKey.Equals((object)this.ResolveProperty(ControlElement.FontSizeProperty)) && (!change.PropertyKey.Equals((object)this.ResolveProperty(ControlElement.FontWeightProperty)) && !change.PropertyKey.Equals((object)this.ResolveProperty(ControlElement.FontStyleProperty))) && (!change.PropertyKey.Equals((object)this.ResolveProperty(TextBoxElement.TextDecorationsProperty)) && !change.PropertyKey.Equals((object)this.ResolveProperty(ControlElement.ForegroundProperty)) && (!change.PropertyKey.Equals((object)this.ResolveProperty(ControlElement.BackgroundProperty)) && !change.PropertyKey.Equals((object)this.ResolveProperty(TextBoxElement.TextAlignmentProperty)))) && !change.PropertyKey.Equals((object)this.ResolveProperty(TextBlockElement.TextAlignmentProperty))) { return(change.PropertyKey.Equals((object)this.ResolveProperty(TextBlockElement.LineHeightProperty))); } return(true); }
public override void ApplyPropertyChange(DocumentNodeChange change) { if (change.PropertyKey != null && change.PropertyKey.Equals((object)TextBlockElement.LineHeightProperty)) { double num = (double)this.TextSource.GetComputedValue(TextBlockElement.LineHeightProperty); if (FlowDocument.LineHeightProperty.IsValidValue((object)num)) { this.RichTextBox.Document.LineHeight = num; } } base.ApplyPropertyChange(change); }
public InstanceState(DocumentNodeChange args) { this.stateType = InstanceStateType.PropertyOrChildInvalid; if (!args.IsPropertyChange) { this.childOperation = new InstanceState.ChildOperation(args.ChildIndex, args.Action); return; } this.invalidProperties = new List <IProperty>(1) { args.PropertyKey }; }
public virtual void ApplyPropertyChange(DocumentNodeChange change) { if (!this.IsTextPropertyChange(change)) { return; } DependencyPropertyReferenceStep propertyReferenceStep = change.PropertyKey as DependencyPropertyReferenceStep; if (propertyReferenceStep == null) { return; } this.CopyProperty(this.TextSource.DesignerContext.PlatformConverter.ConvertToWpfPropertyKey((IProperty)propertyReferenceStep)); }
internal override bool ShouldRebuildAdorner(DocumentNodeChange change) { if (change == null || change.NewChildNode == null || change.OldChildNode == null) { return(false); } ITypeId type1 = (ITypeId)change.NewChildNode.Type; ITypeId type2 = (ITypeId)change.OldChildNode.Type; if (!type1.Equals((object)type2) && PlatformTypes.Brush.IsAssignableFrom(type1)) { return(PlatformTypes.Brush.IsAssignableFrom(type2)); } return(false); }
public override bool IsTextChange(DocumentNodeChange change) { if (base.IsTextChange(change)) { return(true); } if (change.PropertyKey != null) { ReferenceStep singleStep = this.ResolveProperty((IPropertyId)change.PropertyKey) as ReferenceStep; if (singleStep != null) { return(RichTextBoxRangeElement.IsTextProperty((SceneNode)this.TextSource, new PropertyReference(singleStep))); } } return(false); }
public override bool IsTextChange(DocumentNodeChange change) { if (base.IsTextChange(change)) { return(true); } DocumentCompositeNode documentCompositeNode1 = (DocumentCompositeNode)this.TextSource.DocumentNode; IPropertyId textChildProperty = ((ITextFlowSceneNode)this.TextSource).TextChildProperty; if (textChildProperty != null) { if (textChildProperty.Equals((object)change.PropertyKey)) { return(true); } DocumentCompositeNode documentCompositeNode2 = documentCompositeNode1.Properties[textChildProperty] as DocumentCompositeNode; if (documentCompositeNode2 != null && documentCompositeNode2.IsAncestorOf((Microsoft.Expression.DesignModel.DocumentModel.DocumentNode)change.ParentNode)) { return(true); } } return(false); }
internal virtual bool ShouldRebuildAdorner(DocumentNodeChange change) { return(false); }
protected void Subscription_PathNodeContentChanged(object sender, SceneNode pathNode, object content, DocumentNodeMarker damageMarker, DocumentNodeChange damage) { this.Rebuild(); }
private void ElementSubscription_ElementContentChanged(object sender, SceneNode pathNode, object savedObject, DocumentNodeMarker damageMarker, DocumentNodeChange damage) { if (!damage.IsPropertyChange || !pathNode.DocumentNode.IsNameProperty((IPropertyId)damage.PropertyKey) || pathNode.DocumentNode != damage.ParentNode) { return; } if (damage.OldChildNodeValue != null) { string key = ((DocumentNodeStringValue)damage.OldChildNodeValue).Value; if (this.parts.ContainsKey(key)) { this.RemovePartStatus(this.parts[key], pathNode); } } if (damage.NewChildNodeValue == null) { return; } string key1 = ((DocumentNodeStringValue)damage.NewChildNodeValue).Value; if (!this.parts.ContainsKey(key1)) { return; } this.AddPartStatus(this.parts[key1], pathNode); }
private void EventSubscription_ContentChanged(object sender, SceneNode pathNode, EventHandlerModel content, DocumentNodeMarker damageMarker, DocumentNodeChange damage) { if (content == null) { return; } content.Refresh(); }
private void References_Changed(object sender, SceneNode pathNode, AnnotationEditor.ReferenceInfo info, DocumentNodeMarker damageMarker, DocumentNodeChange damage) { IEnumerable <string> enumerable = AnnotationUtils.ParseAnnotationReferences(((DocumentPrimitiveNode)pathNode.DocumentNode).GetValue <string>()); info.ReferencedAnnotationIds = Enumerable.ToList <string>(enumerable); info.ReferencedAnnotations = this.ComputeReferencedAnnotations(enumerable); this.InvalidateAdorners(info.ReferenceOwner); }
private void Annotation_Changed(object sender, SceneNode pathNode, AnnotationEditor.AnnotationInfo info, DocumentNodeMarker damageMarker, DocumentNodeChange damage) { this.AnnotationService.OnAnnotationChanged(info.Annotation); if (damage.IsPropertyChange) { if (damage.PropertyKey.Equals((object)AnnotationSceneNode.IdProperty)) { this.RecomputeCachedAnnotationReferences(((DocumentPrimitiveNode)damage.OldChildNode).GetValue <string>(), ((DocumentPrimitiveNode)damage.NewChildNode).GetValue <string>()); } if (info.Visual != null) { info.Visual.ViewModel.RefreshProperty(damage.PropertyKey.Name); } } this.InvalidateAdorners(info.Annotation, false); }
public SceneNodeModelChangedEventArgs(SceneViewModel model, DocumentNodeChange change) { this.model = model; this.change = change; }
private void OnPathNodeContentChanged(SceneNodeSubscription <basisT, pathT> .PathNodeHolder holder, DocumentNodeMarker damageMarker, DocumentNodeChange damage) { ++this.pathNodesChangeStamp; if (this.PathNodeContentChanged == null) { return; } this.PathNodeContentChanged((object)this, holder.Node, holder.Content, damageMarker, damage); }
private void ConditionSubscription_ContentChanged(object sender, SceneNode pathNode, ConditionModel content, DocumentNodeMarker damageMarker, DocumentNodeChange damage) { content.Update(); this.OnPropertyChanged("TriggerNode"); }
private void InvalidateModelItemAdorner(SceneNode node, IProperty propertyKey, DocumentNodeChange change) { if (!node.IsModelItemCreated) { return; } if (change.IsChildChange) { ModelProperty source = node.ModelItem.Source; if (!(source != (ModelProperty)null)) { return; } SceneNodeModelItemCollection modelItemCollection = (SceneNodeModelItemCollection)source.Collection; modelItemCollection.OnCollectionChanged(); modelItemCollection.OnPropertyChanged("Item[]"); } else { node.ModelItem.OnPropertyChanged(propertyKey.Name); } }
private void SetterSubscription_ContentChanged(object sender, SceneNode pathNode, SetterModel content, DocumentNodeMarker damageMarker, DocumentNodeChange damage) { content.Update(); }
private void ResourcesSubscription_PathNodeChanged(object sender, SceneNode pathNode, object item, DocumentNodeMarker damageMarker, DocumentNodeChange damage) { if (!damage.IsPropertyChange) { return; } DictionaryEntryNode dictionaryEntryNode = pathNode as DictionaryEntryNode; if (dictionaryEntryNode == null) { return; } bool flag = DictionaryEntryNode.KeyProperty.Equals((object)damage.PropertyKey); if (!flag && damage.ParentNode != null && (damage.ParentNode == dictionaryEntryNode.Value.DocumentNode && this.ViewModel.ProjectContext.IsCapabilitySet(PlatformCapability.NameSupportedAsKey)) && damage.PropertyKey == damage.ParentNode.NameProperty) { flag = true; } if (!flag) { return; } this.OnKeyChanged(pathNode.DocumentNode); }
internal override bool ShouldRebuildAdorner(DocumentNodeChange change) { return((change.Action == DocumentNodeChangeAction.Add || change.Action == DocumentNodeChangeAction.Remove) && (change.ParentNode != null && change.ParentNode.Type.Equals((object)PlatformTypes.GradientStopCollection)) || change.Action == DocumentNodeChangeAction.Replace && change.ParentNode != null && (change.ParentNode.Type.Equals((object)PlatformTypes.GradientStop) && change.ParentNode.Parent != null) && (change.ParentNode.Parent.Parent != null && change.ParentNode.Parent.Parent.Parent != null && change.ParentNode.Parent.Parent.Parent.Type.Equals((object)PlatformTypes.DictionaryEntry)) || (change.Action == DocumentNodeChangeAction.Replace && change.ParentNode != null && (change.ParentNode.Type.Equals((object)PlatformTypes.DictionaryEntry) && change.NewChildNode != null) && (change.OldChildNode != null && PlatformTypes.Brush.IsAssignableFrom((ITypeId)change.NewChildNode.Type) && PlatformTypes.Brush.IsAssignableFrom((ITypeId)change.OldChildNode.Type)) || (change.Action == DocumentNodeChangeAction.Replace || change.Action == DocumentNodeChangeAction.Add) && change.NewChildNode != null && (change.NewChildNode.Type.Equals((object)PlatformTypes.LinearGradientBrush) || change.NewChildNode.Type.Equals((object)PlatformTypes.RadialGradientBrush))) || (change.Action == DocumentNodeChangeAction.Replace || change.Action == DocumentNodeChangeAction.Add) && (change.NewChildNode != null && change.NewChildNode.Type.Equals((object)PlatformTypes.GradientStopCollection))); }
private void TriggerSubscription_ContentChanged(object sender, SceneNode pathNode, TriggerModel3 content, DocumentNodeMarker damageMarker, DocumentNodeChange damage) { if (content == null) { return; } content.AddChange(damageMarker, damage, (IList <SubSubscription>) this.delayedUpdates); }
private void animationSubscription_PathNodeContentChanged(object sender, SceneNode pathNode, PointKeyFrame content, DocumentNodeMarker damageMarker, DocumentNodeChange damage) { this.FireKeyframeUpdate(); }