protected override void Initialize(RequestContext requestContext) { base.Initialize(requestContext); //get user ModelStateWrapper = new ModelStateWrapper(this); Service = CreateService(); }
public void ReleaseInternalState(IModelState savedInternalState) { SavedState saveState = (SavedState)savedInternalState; saveState.time = -1; saveState.timestep = -1; saveState.state = null; }
public void RestoreInternalState(IModelState savedInternalState) { SavedState saveState = (SavedState)savedInternalState; state = saveState.state.Clone(); timeStep = saveState.timestep; t = saveState.time; }
public ServiceBase(IModelState modelState) { ModelState = modelState; Repository = CreateRepository(); if (ModelState != null) { CurrentUserId = Repository.GetUserId(ModelState.Username); } }
public bool ValidateEvent(Event newEvent, IModelState modelState) { if (newEvent.Comments.Trim().Length == 0) { modelState.AddModelError("Comments", "Comments are undefined."); } return(modelState.IsValid); }
public Model(IModelState modelState) { Execution = new ModelExecution() { HandleTimeout = TimeoutHandle, HandleUnhandledException = HandleError }; ModelState = modelState; }
public ServiceBase(TRepo repository, IModelState modelState) { Repository = repository; ModelState = modelState; if (ModelState != null) { CurrentUserId = Repository.GetUserId(ModelState.Username); } }
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 }; }
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(); } }
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 }; }
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 }; }
public ControllerContext(HttpContext httpContext, RouteEntity routeEntity) : base(httpContext, routeEntity) { //RouteData = httpContext.RouteData; ModelState = httpContext.Service.GetService <IModelState>(); }
public WebContentService(IModelState modelState) : base(modelState) { }
public BaseModel(IExrinContainer exrinContainer, IModelState modelState) : base(exrinContainer, modelState) { }
public Proxel getProxelByState(IModelState s) { Proxel proxel; return((proxels.TryGetValue(s, out proxel)) ? proxel : null); }
public Proxel(IModelState s, double p) { State = s; P = p; }
public ModelStateNode(IModelNode transformedNode, IModelState entityModelState) { TransformedNode = transformedNode; EntityModelState = entityModelState; }
public void ReleaseInternalState(IModelState savedInternalState) { throw new NotImplementedException(); }
public static void AddError <TEntity>(this IModelState errors, Expression <Func <TEntity, object> > selector, string errorMessage) { var propertyName = selector.GetInputName(); errors.AddError(propertyName, errorMessage); }
public BookingService(IModelState modelState) : base(modelState) { }