public SetTransportDirectionCommand(TransporterExpressionContainer transporterContainer, TransportDirectionId newTransportDirection,
                                     IExecutionContext context)
 {
     _transporterContainer   = transporterContainer;
     _newTransportDirection  = newTransportDirection;
     _transporterContainerId = _transporterContainer.Id;
     _expressionProfile      = context.BuildingBlockContaining(_transporterContainer).DowncastTo <ExpressionProfile>();
     BuildingBlockId         = _expressionProfile.Id;
     _oldTransportDirection  = _transporterContainer.TransportDirection;
     ObjectType  = PKSimConstants.ObjectTypes.Transporter;
     CommandType = PKSimConstants.Command.CommandTypeEdit;
     context.UpdateBuildingBlockPropertiesInCommand(this, _expressionProfile);
 }
 public ICommand SetTransportDirection(TransporterExpressionContainer transporterContainer, TransportDirectionId transportDirection)
 {
     return(new SetTransportDirectionCommand(transporterContainer, transportDirection, _executionContext).Run(_executionContext));
 }
示例#3
0
 public TransportDirection ById(TransportDirectionId transportDirectionId)
 {
     Start();
     return(_transportDirectionCache[transportDirectionId]);
 }
        private void addGlobalExpression(IndividualTransporter transporter, string globalContainerName, TransportDirectionId transportDirection,
                                         params ParameterMetaData[] parameters)
        {
            //Create a global container that we only old transport direction settings
            var transportContainer = AddContainerExpression(transporter, globalContainerName);

            transportContainer.TransportDirection = transportDirection;
            AddGlobalExpression(transporter, parameters);
        }
        private TransporterExpressionContainer addContainerExpression(IContainer parentContainer,
                                                                      IndividualTransporter transporter, TransportDirectionId transportDirection, params ParameterMetaData[] parameters)
        {
            var expressionContainer = AddContainerExpression(parentContainer, transporter.Name, parameters);

            //Required to set this first to ensure that we capture container that are purely parameter containers
            expressionContainer.TransportDirection = transportDirection;

            return(expressionContainer);
        }