1 //----------------------------------------------------------------
2 // <copyright company="Microsoft Corporation">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //----------------------------------------------------------------
7 namespace System.Activities.Presentation.Model
9 using System.Globalization;
11 internal class PropertyReferenceChange : ModelChange
13 public ModelItem Owner { get; set; }
15 public string TargetProperty { get; set; }
17 public string OldSourceProperty { get; set; }
19 public string NewSourceProperty { get; set; }
21 public override string Description
25 return string.Format(CultureInfo.InvariantCulture, "{0} - {1}", SR.PropertyReferenceChangeEditingScopeDescription, this.TargetProperty);
29 public override bool Apply()
31 PropertyReferenceUtilities.SetPropertyReference(this.Owner.GetCurrentValue(), this.TargetProperty, this.NewSourceProperty);
32 this.Owner.OnPropertyReferenceChanged(this.TargetProperty);
37 public override Change GetInverse()
39 return new PropertyReferenceChange()
42 TargetProperty = this.TargetProperty,
43 OldSourceProperty = this.NewSourceProperty,
44 NewSourceProperty = this.OldSourceProperty