Ejemplo n.º 1
0
 public INetworkPipePresenter Create(INetworkPipe pipe, INetworkPipeView view)
 {
     NetworkPipePresenter pres = null;
     if (pipe != null && view != null)
     {
         pres = new NetworkPipePresenter(pipe, view);
     }
     return pres;
 }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
        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)
 {
 }
Ejemplo n.º 8
0
 public NetworkPipePresenter(INetworkPipe pipe, INetworkPipeView view)
 {
     NetworkPipe = pipe;
     NetworkPipeView = view;
 }