Esempio n. 1
0
 public PropertyDictionaryChangeUndoUnit(DocumentCompositeNode node, IProperty propertyKey, SourceContextContainer <DocumentNode> oldValue, SourceContextContainer <DocumentNode> newValue)
 {
     this.node        = node;
     this.propertyKey = propertyKey;
     this.oldValue    = oldValue;
     this.newValue    = newValue;
 }
Esempio n. 2
0
            private void Toggle()
            {
                this.node.ApplyPropertyChange(this.propertyKey, this.oldValue, this.newValue);
                SourceContextContainer <DocumentNode> contextContainer = this.oldValue;

                this.oldValue = this.newValue;
                this.newValue = contextContainer;
            }
Esempio n. 3
0
 public override UndoUnitMergeResult Merge(IUndoUnit otherUnit, out IUndoUnit mergedUnit)
 {
     mergedUnit = (IUndoUnit)null;
     SceneXamlDocument.PropertyDictionaryChangeUndoUnit dictionaryChangeUndoUnit = otherUnit as SceneXamlDocument.PropertyDictionaryChangeUndoUnit;
     if (dictionaryChangeUndoUnit == null || dictionaryChangeUndoUnit.node != this.node || dictionaryChangeUndoUnit.propertyKey != this.propertyKey)
     {
         return(UndoUnitMergeResult.CouldNotMerge);
     }
     if (SourceContextContainer <DocumentNode> .ContentReferenceEquals(dictionaryChangeUndoUnit.oldValue, this.newValue))
     {
         return(UndoUnitMergeResult.MergedIntoNothing);
     }
     mergedUnit = (IUndoUnit) new SceneXamlDocument.PropertyDictionaryChangeUndoUnit(this.node, this.propertyKey, dictionaryChangeUndoUnit.oldValue, this.newValue);
     return(UndoUnitMergeResult.MergedIntoOneUnit);
 }
Esempio n. 4
0
 public override void ApplyPropertyChange(DocumentCompositeNode node, IProperty propertyKey, SourceContextContainer <DocumentNode> oldValue, SourceContextContainer <DocumentNode> newValue)
 {
     if (this.undoService != null)
     {
         this.undoService.Add((IUndoUnit) new SceneXamlDocument.PropertyDictionaryChangeUndoUnit(node, propertyKey, oldValue, newValue));
     }
     else
     {
         base.ApplyPropertyChange(node, propertyKey, oldValue, newValue);
     }
 }