public Connector Create(int id, ExternalChangeSet changeSet, Sheet sheet) { var connector = Create(id, sheet); //Todo: Shouldn't there onyl one change? Check this.. foreach (ExternalChange change in changeSet.Where(c => c.OwnerId == id)) { //Todo: Do we need change direction in this case? Direction should be part of the changeset in future. if (change.ChangeReason == ChangeReason.Update) { var undoable = (ConnectorUndoable)change.Undoable; foreach (var connection in undoable.Connections) { connector.Connections.Add(_connectionFactory.Create(connection, changeSet)); } //foreach (var connectionId in undoable.ConnectionIds) //{ // connector.Connections.Add(_connectionFactory.Create(connectionId, changeSet, sheet)); //} } } return(connector); }
public Task(int id, ExternalChangeSet changeSet, IUndoService undoService) { _undoService = undoService; _undoService.ActiveStateChanged += _undoService_ActiveStateChanged; Id = id; foreach (var change in changeSet.Where(c => c.ItemId == id)) { IsDone = ((UndoObject)change.Undoable).IsDone; Description = ((UndoObject)change.Undoable).Description; } }
public Connection Create(int id, ExternalChangeSet changeSet, Sheet sheet) { var connection = Create(id, sheet); //Todo: Shouldn't there be only one change? Check this.. foreach (ExternalChange change in changeSet.Where(c => c.OwnerId == id)) { if (change.ChangeReason == ChangeReason.Update) { var undoable = (ConnectionUndoable)change.Undoable; //connection.Color = undoable.Color Todo connection.FromPosition = undoable.FromPosition; connection.ToPosition = undoable.ToPosition; } } return(connection); }