port from perforce
This commit is contained in:
32
intromat/Intromat/Actions/Network/AddConnectionAction.cs
Normal file
32
intromat/Intromat/Actions/Network/AddConnectionAction.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using DynamicData;
|
||||
using Intromat.Interfaces;
|
||||
using Intromat.ViewModels;
|
||||
using NodeNetwork.ViewModels;
|
||||
|
||||
namespace Intromat.Actions.Network
|
||||
{
|
||||
public class AddConnectionAction : IUndoItem
|
||||
{
|
||||
private readonly CodeGenNetworkViewModel _network;
|
||||
private readonly ConnectionViewModel _connection;
|
||||
|
||||
public AddConnectionAction(DocumentViewModel document, CodeGenNetworkViewModel network, ConnectionViewModel connection)
|
||||
{
|
||||
File = document;
|
||||
_network = network;
|
||||
_connection = connection;
|
||||
}
|
||||
|
||||
public void Redo()
|
||||
{
|
||||
_network.Connections.Add(_connection);
|
||||
}
|
||||
|
||||
public void Undo()
|
||||
{
|
||||
_network.Connections.Remove(_connection);
|
||||
}
|
||||
|
||||
public IFile File { get; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user