public INetworkPipePresenter Create(INetworkPipe pipe, INetworkPipeView view) { NetworkPipePresenter pres = null; if (pipe != null && view != null) { pres = new NetworkPipePresenter(pipe, view); } return pres; }
internal void LoadNetworkPipePresenterAndModel(INetworkPipe pipe, INetworkPipeView pipeView, IElementView srcElView, IElementView destElView, int srcPortIndex, int destPortIndex) { Guid srcElId = srcElView.Id; Guid destElId = destElView.Id; // connect the pipe to the elements, at the model (biz) level. IOutputNetworkPort srcPort = GetSourceNetworkPort(srcElId, srcPortIndex); IInputNetworkPort destPort = GetDestinationNetworkPort(destElId, destPortIndex); ConnectPipeModel(pipe, srcPort, destPort); // set the id of the pipeView to the id of the pipe model pipeView.Id = pipe.Id; // create the instance of the presenter with the model and the view INetworkPipePresenter presenter = CreateNetworkPipePresenter(pipe, pipeView); // Add the pipe presenter to the presenter mgr,and the view to the workspace view. // Pipe model has already been added to workspace during unpersisting. if (presenter != null) { View.Add(pipeView, srcElView, destElView, srcPortIndex, destPortIndex); PipePresenters.Add(pipe.Id, presenter); } }
internal void CreateNetworkPipePresenterAndModel(INetworkPipeView pipeView, IElementView srcElView, IElementView destElView, int srcPortIndex, int destPortIndex) { //TODO XXX REMOVE Guid newPipeId = GetNewId(); Guid srcElId = srcElView.Id; Guid destElId = destElView.Id; // create the pipe model INetworkPipe pipe = CreateNetworkPipeModel(newPipeId); // connect the pipe to the elements, at the model (biz) level. First we need to get the elemetns: IOutputNetworkPort srcPort = GetSourceNetworkPort(srcElId, srcPortIndex); IInputNetworkPort destPort = GetDestinationNetworkPort(destElId, destPortIndex); ConnectPipeModel(pipe, srcPort, destPort); // create the instance of the view pipeView.Id = pipe.Id; // create the instance of the presenter with the model and the view INetworkPipePresenter presenter = CreateNetworkPipePresenter(pipe, pipeView); // Add the pipe to the workspace.ElementMgr and the persenter to the presenter mgr. // The pipeView is already in the workspace view. if (presenter != null) { WorkSpace.PipesMgr.Add(pipe); PipePresenters.Add(pipe.Id, presenter); } }
internal INetworkPipePresenter CreateNetworkPipePresenter(INetworkPipe pipe, INetworkPipeView view) { INetworkPipePresenter pesenter = null; if (pipe != null && view != null) { // create the instance of the element presenter with the element and the view using (PipePresenterFactory fac = new PipePresenterFactory()) { pesenter = fac.Create(pipe, view); } } return pesenter; }
public CompleteNetworkConnectionEventArgs(INetworkPipeView pipeView, Guid sourceElementId, Guid destinationElementId, int srcPortIndex, int destPortIndex) { NetworkPipeView = pipeView; base.SourcePortIndex = srcPortIndex; base.DestinationPortIndex = destPortIndex; }
public CompleteNetworkConnectionEventArgs(INetworkPipeView networkPipeView, IElementView sourceElement, IElementView destinationElement, int srcPortIndex, int destPortIndex) : base(sourceElement, destinationElement, srcPortIndex, destPortIndex) { NetworkPipeView = networkPipeView; }
public CompleteNetworkConnectionEventArgs(INetworkPipeView networkPipeView) : this(networkPipeView, null, null, -1, -1) { }
public NetworkPipePresenter(INetworkPipe pipe, INetworkPipeView view) { NetworkPipe = pipe; NetworkPipeView = view; }