示例#1
0
 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)
 {
 }
示例#4
0
        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);
            }
        }
示例#5
0
        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);
            }
        }
示例#6
0
        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;
        }
示例#7
0
 public DataPipePresenter(IDataPipe pipe, IDataPipeView view)
 {
     DataPipe = pipe;
     DataPipeView = view;
 }