コード例 #1
0
 protected override void Initialize(RequestContext requestContext)
 {
     base.Initialize(requestContext);
     //get user
     ModelStateWrapper = new ModelStateWrapper(this);
     Service           = CreateService();
 }
コード例 #2
0
        public void ReleaseInternalState(IModelState savedInternalState)
        {
            SavedState saveState = (SavedState)savedInternalState;

            saveState.time     = -1;
            saveState.timestep = -1;
            saveState.state    = null;
        }
コード例 #3
0
        public void RestoreInternalState(IModelState savedInternalState)
        {
            SavedState saveState = (SavedState)savedInternalState;

            state    = saveState.state.Clone();
            timeStep = saveState.timestep;
            t        = saveState.time;
        }
コード例 #4
0
 public ServiceBase(IModelState modelState)
 {
     ModelState = modelState;
     Repository = CreateRepository();
     if (ModelState != null)
     {
         CurrentUserId = Repository.GetUserId(ModelState.Username);
     }
 }
コード例 #5
0
        public bool ValidateEvent(Event newEvent, IModelState modelState)
        {
            if (newEvent.Comments.Trim().Length == 0)
            {
                modelState.AddModelError("Comments", "Comments are undefined.");
            }

            return(modelState.IsValid);
        }
コード例 #6
0
        public Model(IModelState modelState)
        {
            Execution = new ModelExecution()
            {
                HandleTimeout            = TimeoutHandle,
                HandleUnhandledException = HandleError
            };

            ModelState = modelState;
        }
コード例 #7
0
        public ServiceBase(TRepo repository, IModelState modelState)
        {
            Repository = repository;
            ModelState = modelState;

            if (ModelState != null)
            {
                CurrentUserId = Repository.GetUserId(ModelState.Username);
            }
        }
コード例 #8
0
        public Model(IDisplayService displayService, IApplicationInsights applicationInsights, IErrorHandlingService errorHandlingService, IModelState modelState)
        {
            _displayService       = displayService;
            _errorHandlingService = errorHandlingService;
            _applicationInsights  = applicationInsights;

            ModelState = modelState;
            Execution  = new ModelExecution()
            {
                HandleTimeout            = TimeoutHandle,
                HandleUnhandledException = HandleError
            };
        }
コード例 #9
0
        public void SetNextModelState(IModelState modelState)
        {
            switch (modelState.ModelMode)
            {
            case ModelMode.Standard:
                modelState.SetState(ModelMode.DeadEndFilled);
                break;

            case ModelMode.DeadEndFilled:
                modelState.SetState(ModelMode.Standard);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
コード例 #10
0
ファイル: Model.cs プロジェクト: exrin/Exrin
        public Model(IExrinContainer exrinContainer, IModelState modelState)
        {
            if (exrinContainer == null)
                throw new ArgumentNullException(nameof(IExrinContainer));

            _displayService = exrinContainer.DisplayService;
            _errorHandlingService = exrinContainer.ErrorHandlingService;
            _applicationInsights = exrinContainer.ApplicationInsights;

            ModelState = modelState;
            Execution = new ModelExecution()
            {
                HandleTimeout = TimeoutHandle,
                HandleUnhandledException = HandleError
            };
        }
コード例 #11
0
        public Model(IExrinContainer exrinContainer, IModelState modelState)
        {
            if (exrinContainer == null)
            {
                throw new ArgumentNullException(nameof(IExrinContainer));
            }

            _displayService       = exrinContainer.DisplayService;
            _errorHandlingService = exrinContainer.ErrorHandlingService;
            _applicationInsights  = exrinContainer.ApplicationInsights;

            ModelState = modelState;
            Execution  = new ModelExecution()
            {
                HandleTimeout            = TimeoutHandle,
                HandleUnhandledException = HandleError
            };
        }
コード例 #12
0
 public ControllerContext(HttpContext httpContext, RouteEntity routeEntity) : base(httpContext, routeEntity)
 {
     //RouteData = httpContext.RouteData;
     ModelState = httpContext.Service.GetService <IModelState>();
 }
コード例 #13
0
 public WebContentService(IModelState modelState) : base(modelState)
 {
 }
コード例 #14
0
 public BaseModel(IExrinContainer exrinContainer, IModelState modelState)
     : base(exrinContainer, modelState)
 {
 }
コード例 #15
0
        public Proxel getProxelByState(IModelState s)
        {
            Proxel proxel;

            return((proxels.TryGetValue(s, out proxel)) ? proxel : null);
        }
コード例 #16
0
 public Proxel(IModelState s, double p)
 {
     State = s;
     P     = p;
 }
コード例 #17
0
 public ModelStateNode(IModelNode transformedNode, IModelState entityModelState)
 {
     TransformedNode  = transformedNode;
     EntityModelState = entityModelState;
 }
コード例 #18
0
ファイル: ModelInstance.cs プロジェクト: vortechbv/OpenDA
 public void ReleaseInternalState(IModelState savedInternalState)
 {
     throw new NotImplementedException();
 }
コード例 #19
0
        public static void AddError <TEntity>(this IModelState errors, Expression <Func <TEntity, object> > selector, string errorMessage)
        {
            var propertyName = selector.GetInputName();

            errors.AddError(propertyName, errorMessage);
        }
コード例 #20
0
 public BookingService(IModelState modelState)
     : base(modelState)
 {
 }