Пример #1
0
        public override void onSetPosition(AplayPoint position__, Client client__)
        {
            if (Math.Abs(PositionX - position__.X) < double.Epsilon && Math.Abs(PositionY - position__.Y) < double.Epsilon)
            {
                return;
            }

            var oldState = new ConnectorUndoable(this);

            PositionX = position__.X;
            PositionY = position__.Y;

            _undoService.AddUpdate(oldState, new ConnectorUndoable(this), "Position of connector changed", client__.Id);
        }
Пример #2
0
        public override void onAddConnector(Connector connector, Client client)
        {
            APlay.Common.Logging.Logger.LogDesigned(2, "Sheet.onAddConnector called", "AplayTest.Server.Sheet");
            connector.Sheet = this;

            _undoService.StartTransaction(client.Id, "Add connector [" + connector.Id + "]");

            var connectorUndoable = new ConnectorUndoable(connector);

            _undoService.AddInsert(Id, connectorUndoable, Connections.Count, "Adding connector [" + connectorUndoable.Id + "]", client.Id);

            Connectors.Add(connector);

            _undoService.EndTransaction(client.Id);
        }
Пример #3
0
        public override void onRemoveConnector(Connector connector, Client client)
        {
            APlay.Common.Logging.Logger.LogDesigned(2, "Sheet.onRemoveConnector called", "AplayTest.Server.Sheet");

            _undoService.StartTransaction(client.Id, "Remove connector [" + connector.Id + "]");

            var connectorUndoable = new ConnectorUndoable(connector);

            connector.PrepareForRemove(client.Id);

            var index = Connectors.IndexOf(connector);

            Connectors.RemoveAt(index);

            _undoService.AddRemove(Id, connectorUndoable, index, "Removing connector [" + connectorUndoable.Id + "]", client.Id);

            _undoService.EndTransaction(client.Id);
        }