public bool MaintainsPartID {
get { return myMaintainsPartID; }
set {
// only set the value and do other things if the value has changed
bool old = myMaintainsPartID;
if (old != value) {
myMaintainsPartID = value;
// notify about the change
RaiseChanged(ChangedMaintainsPartID, 0, null, 0, old, NullRect, 0, value, NullRect);
// when set to true, and when not undoing/redoing, make sure all parts have unique IDs
if (!this.Initializing) {
if (value)
EnsureUniquePartID();
else
ClearPartIDTable();
}
}
}
}
public override void ChangeValue(GoChangedEventArgs e, bool undo) {
switch (e.SubHint) {
case ChangedMaintainsPartID:
this.MaintainsPartID = (bool)e.GetValue(undo);
return;
default:
base.ChangeValue(e, undo);
return;
}
}