public override bool CanExecute() { if (Project.UsesVersioning && Item1ID != Guid.Empty && Item2ID != Guid.Empty) { ExolutioVersionedObject item1 = (ExolutioVersionedObject)Project.TranslateComponent(Item1ID); ExolutioVersionedObject item2 = (ExolutioVersionedObject)Project.TranslateComponent(Item2ID); if (item1.Version != item2.Version && item1.GetType() == item2.GetType() && !item1.ExistsInVersion(item2.Version) && !item2.ExistsInVersion(item1.Version)) { return(true); } } return(false); }
public virtual void Verify() { ExolutioVersionedObject verifiedElement = Component; //if (this is ISubelementAditionChange) //{ // verifiedElement = ((ISubelementAditionChange)this).ChangedSubelement; //} //else if (this is ISubelementRemovalChange) //{ // verifiedElement = ((ISubelementRemovalChange)this).ChangedSubelement; //} //else //{ // verifiedElement = Element; //} if (Category.IsAmong(EChangeCategory.Addition, EChangeCategory.Migratory, EChangeCategory.Sedentary)) { Debug.Assert(NewVersion != null); Debug.Assert(verifiedElement.GetInVersion(NewVersion) != null); } if (Category.IsAmong(EChangeCategory.Removal, EChangeCategory.Migratory, EChangeCategory.Sedentary)) { Debug.Assert(OldVersion != null); Debug.Assert(verifiedElement.ExistsInVersion(OldVersion)); } if (Category == EChangeCategory.Addition) { Debug.Assert(NewVersion != null); Debug.Assert(verifiedElement.GetInVersion(OldVersion) == null); } if (Category == EChangeCategory.Removal) { Debug.Assert(OldVersion != null); Debug.Assert(verifiedElement.GetInVersion(NewVersion) == null); } }