public static T AsInverseFor <T>(this T inverseCommand, SimulationChangeCommandBase originalCommand) where T : SimulationChangeCommandBase { CommandExtensions.AsInverseFor(inverseCommand, originalCommand); inverseCommand.WasChanged = originalCommand.WasChanged; inverseCommand.Increment = !originalCommand.Increment; return(inverseCommand); }
protected override IReversibleCommand <IMoBiContext> GetInverseCommand(IMoBiContext context) { var inverseCommand = CommandExtensions.AsInverseFor(new ChangeMoleculeNameAtMoleculeDependentBuilderCommand(OldMoleculeName, NewMoleculeName, _moleculeDependentBuilder, _buildingBlock), this); inverseCommand.Visible = Visible; return(inverseCommand); }
public static T AsInverseFor <T>(this T inverseCommand, IBuildingBlockChangeCommand originalCommand) where T : IBuildingBlockChangeCommand { CommandExtensions.AsInverseFor(inverseCommand, originalCommand); inverseCommand.IncrementVersion = !originalCommand.IncrementVersion; inverseCommand.UpdateInternalFrom(originalCommand); return(inverseCommand); }
protected override IReversibleCommand <IMoBiContext> GetInverseCommand(IMoBiContext context) { return(CommandExtensions.AsInverseFor(new RenameObjectBaseCommand(_objectBase, OldName, _buildingBlock), this)); }
public static BuildingBlockChangeCommandBase <T> AsInverseFor <T>(this BuildingBlockChangeCommandBase <T> inverseCommand, BuildingBlockChangeCommandBase <T> originalCommand) where T : class, IBuildingBlock { CommandExtensions.AsInverseFor(inverseCommand, originalCommand); inverseCommand.ShouldIncrementVersion = !originalCommand.ShouldIncrementVersion; return(inverseCommand); }
protected override IReversibleCommand <IMoBiContext> GetInverseCommand(IMoBiContext context) { return(CommandExtensions.AsInverseFor(new ChangeVariableNameCommand(_changedFormula, OldVariableName, NewVariableName, _buildingBlock), this)); }