Пример #1
0
 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);
                 }
             }
         }
     }
 }
Пример #2
0
 public void AddChange(DocumentNodeMarker marker, DocumentNodeChange change, IList <SubSubscription> delayedUpdates)
 {
     if (this.accumulatedChanges.Count == 0)
     {
         delayedUpdates.Add(this);
     }
     this.accumulatedChanges.Add(marker, change);
 }
Пример #3
0
 public override bool IsTextChange(DocumentNodeChange change)
 {
     if (change.PropertyKey == null || !change.PropertyKey.Equals((object)TextBoxElement.TextProperty))
     {
         return(base.IsTextChange(change));
     }
     return(true);
 }
Пример #4
0
 public override bool IsTextChange(DocumentNodeChange change)
 {
     if (change.PropertyKey != this.targetProperty.LastStep)
     {
         return(base.IsTextChange(change));
     }
     return(true);
 }
Пример #5
0
 public virtual bool IsTextChange(DocumentNodeChange change)
 {
     if (!DesignTimeProperties.IsTextEditingProperty.Equals((object)change.PropertyKey))
     {
         return(this.IsTextPropertyChange(change));
     }
     return(true);
 }
Пример #6
0
 internal void OnModelChanged(DocumentNodeChange change)
 {
     if (this.ModelChanged == null)
     {
         return;
     }
     this.ModelChanged((object)this, (ModelChangedEventArgs) new SceneNodeModelChangedEventArgs(this.viewModel, change));
 }
Пример #7
0
 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);
 }
Пример #8
0
 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);
 }
Пример #9
0
 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);
 }
Пример #10
0
 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);
 }
Пример #11
0
 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
     };
 }
Пример #12
0
        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));
        }
Пример #13
0
        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);
        }
Пример #14
0
 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);
 }
Пример #15
0
        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);
        }
Пример #16
0
 internal virtual bool ShouldRebuildAdorner(DocumentNodeChange change)
 {
     return(false);
 }
Пример #17
0
 protected void Subscription_PathNodeContentChanged(object sender, SceneNode pathNode, object content, DocumentNodeMarker damageMarker, DocumentNodeChange damage)
 {
     this.Rebuild();
 }
Пример #18
0
        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);
        }
Пример #19
0
 private void EventSubscription_ContentChanged(object sender, SceneNode pathNode, EventHandlerModel content, DocumentNodeMarker damageMarker, DocumentNodeChange damage)
 {
     if (content == null)
     {
         return;
     }
     content.Refresh();
 }
Пример #20
0
        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);
        }
Пример #21
0
 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);
 }
Пример #22
0
 public SceneNodeModelChangedEventArgs(SceneViewModel model, DocumentNodeChange change)
 {
     this.model  = model;
     this.change = change;
 }
Пример #23
0
 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);
 }
Пример #24
0
 private void ConditionSubscription_ContentChanged(object sender, SceneNode pathNode, ConditionModel content, DocumentNodeMarker damageMarker, DocumentNodeChange damage)
 {
     content.Update();
     this.OnPropertyChanged("TriggerNode");
 }
Пример #25
0
 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);
     }
 }
Пример #26
0
 private void SetterSubscription_ContentChanged(object sender, SceneNode pathNode, SetterModel content, DocumentNodeMarker damageMarker, DocumentNodeChange damage)
 {
     content.Update();
 }
Пример #27
0
        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);
        }
Пример #28
0
 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)));
 }
Пример #29
0
 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);
 }
Пример #30
0
 private void animationSubscription_PathNodeContentChanged(object sender, SceneNode pathNode, PointKeyFrame content, DocumentNodeMarker damageMarker, DocumentNodeChange damage)
 {
     this.FireKeyframeUpdate();
 }