コード例 #1
0
        public override void onSetTo(Connector connector, Client client)
        {
            APlay.Common.Logging.Logger.LogDesigned(2, "Connection.onSetTo called", "APlayTest.Server.Connection");

            var undoable = new ConnectionUndoable(this);

            this.From = connector;
            _undoService.AddUpdate(undoable, new ConnectionUndoable(this), "Set To-Connector: " + connector.Id, client.Id);
        }
コード例 #2
0
        public override void onAddConnection(Connection connection, Client client)
        {
            APlay.Common.Logging.Logger.LogDesigned(2, "Sheet.onAddConnection called", "AplayTest.Server.Sheet");
            connection.Sheet = this;

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

            var undoableConnection = new ConnectionUndoable(connection);

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

            //Connections.Insert(Connections.Count,connection);
            Connections.Add(connection);

            _undoService.EndTransaction(client.Id);
        }
コード例 #3
0
        public override void onRemoveConnection(Connection connection, Client client)
        {
            APlay.Common.Logging.Logger.LogDesigned(2, "Sheet.onRemoveConnection called", "AplayTest.Server.Sheet");

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

            var undoableConnection = new ConnectionUndoable(connection);

            connection.PrepareForRemove(client.Id);

            var index = Connections.IndexOf(connection);

            Connections.RemoveAt(index);

            _undoService.AddRemove(Id, undoableConnection, index, "Removing connection [" + undoableConnection.Id + "]", client.Id);

            _undoService.EndTransaction(client.Id);
        }