public IDataPipePresenter Create(IDataPipe pipe, IDataPipeView view) { DataPipePresenter pres = null; if (pipe != null && view != null) { pres = new DataPipePresenter(pipe, view); } return pres; }
public CompleteDataConnectionEventArgs(IDataPipeView dataPipeView, IElementView sourceElement, IElementView destinationElement, int srcPortIndex, int destPortIndex) : base(sourceElement, destinationElement, srcPortIndex, destPortIndex) { DataPipeView = dataPipeView; }
public CompleteDataConnectionEventArgs(IDataPipeView dataPipeView) : this(dataPipeView, null, null, -1, -1) { }
internal void LoadDataPipePresenterAndModel(IDataPipe pipe, IDataPipeView 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. IOutputDataPort srcPort = GetSourceDataPort(srcElId, srcPortIndex); IInputDataPort destPort = GetDestinationDataPort(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 IDataPipePresenter presenter = CreateDataPipePresenter(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 CreateDataPipePresenterAndModel(IDataPipeView 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 IDataPipe pipe = CreateDataPipeModel(newPipeId); // connect the pipe to the elements, at the model (biz) level. First we need to get the elemetns: IOutputDataPort srcPort = GetSourceDataPort(srcElId, srcPortIndex); IInputDataPort destPort = GetDestinationDataPort(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 IDataPipePresenter presenter = CreateDataPipePresenter(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 IDataPipePresenter CreateDataPipePresenter(IDataPipe pipe, IDataPipeView view) { IDataPipePresenter 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 DataPipePresenter(IDataPipe pipe, IDataPipeView view) { DataPipe = pipe; DataPipeView = view; }