/// <summary>
 /// Instantiates a new process contrext for inversion.
 /// </summary>
 /// <remarks>You can think of this type here as "being Inversion". This is the thing.</remarks>
 /// <param name="underlyingContext">The underlying http context to wrap.</param>
 /// <param name="services">The service container the context will use.</param>
 /// <param name="resources">The resources available to the context.</param>
 public AspNetContext(HttpContext underlyingContext, IServiceContainer services, IResourceAdapter resources)
     : base(services, resources)
 {
     _underlyingContext = underlyingContext;
     _application = this.UnderlyingContext.ApplicationInstance as AspNetApplication;
     _response = new AspNetResponse(this.UnderlyingContext.Response);
     _request = new AspNetRequest(this.UnderlyingContext.Request);
 }
Esempio n. 2
0
 public ResourceModel(IResourceAdapter adapter)
 {
     Id        = adapter.Id;
     StockId   = adapter.StockId;
     Name      = adapter.Name;
     PriceBase = adapter.PriceBase;
     Price     = adapter.Price;
 }
Esempio n. 3
0
        public Resource(IResourceAdapter adapter) : this()
        {
            Id        = adapter.Id;
            Name      = adapter.Name;
            PriceBase = adapter.PriceBase;
            Price     = adapter.Price;

            StockId = adapter.StockId;
        }
Esempio n. 4
0
 /// <summary>
 /// Instantiates a new process contrext for inversion.
 /// </summary>
 /// <remarks>You can think of this type here as "being Inversion". This is the thing.</remarks>
 /// <param name="services">The service container the context will use.</param>
 /// <param name="resources">The resources available to the context.</param>
 public ProcessContext(IServiceContainer services, IResourceAdapter resources)
 {
     _serviceContainer = services;
     _resources        = resources;
     _cache            = MemoryCache.Default;
     _bus          = new Subject <IEvent>();
     _messages     = new DataCollection <string>();
     _errors       = new DataCollection <ErrorMessage>();
     _timers       = new ProcessTimerDictionary();
     _controlState = new DataDictionary <object>();
     _flags        = new DataCollection <string>();
     _steps        = new ViewSteps();
     _params       = new ConcurrentDataDictionary <string>();
 }
 /// <summary>
 /// Instantiates a new process contrext for inversion.
 /// </summary>
 /// <remarks>You can think of this type here as "being Inversion". This is the thing.</remarks>
 /// <param name="services">The service container the context will use.</param>
 /// <param name="resources">The resources available to the context.</param>
 public MockWebContext(IServiceContainer services, IResourceAdapter resources)
     : base(services, resources)
 {
     this.Request = new MockWebRequest(String.Empty);
     this.Response = new MockWebResponse();
 }
Esempio n. 6
0
 public void Update(IResourceAdapter item)
 {
     _db.Entry(new Resource(item)).State = EntityState.Modified;
 }
Esempio n. 7
0
 public void Create(IResourceAdapter item)
 {
     _db.Resources.Add(new Resource(item));
 }
        public GameManager(RenderAdapter renderAdapter, IUtilsAdapter utilsAdapter, IInputAdapter inputAdapter, IResourceAdapter resoruceAdapter)
        {
            _graphics = new GraphicsManager(renderAdapter);
            Utils.SetAdapter(utilsAdapter);
            _input = new InputManger(inputAdapter);
            ResoruceManger.SetAdapter(resoruceAdapter);

            SetUpGameWindow();
            LoadFonts();

            _world = new World(_factory, _settings.BackgroundMusicFileName);
            _ui    = new UserInterfaceManger(_factory, _world);
            Statistics.SetWorld(_world);
            // Must be called After adapters are set
            _collsion = new CollsionManger();
            _sound    = new SoundManger();
        }
Esempio n. 9
0
 /// <summary>
 /// Instantiates a new process contrext for inversion.
 /// </summary>
 /// <remarks>You can think of this type here as "being Inversion". This is the thing.</remarks>
 /// <param name="underlyingContext">The underlying http context to wrap.</param>
 /// <param name="services">The service container the context will use.</param>
 /// <param name="resources">The resources available to the context.</param>
 public OwinProcessContext(IOwinContext underlyingContext, IServiceContainer services, IResourceAdapter resources)
     : base(services, resources)
 {
     _underlyingContext = underlyingContext;
     _application       = null;
     _response          = new OwinResponse(this.UnderlyingContext.Response);
     _request           = new OwinRequest(this.UnderlyingContext.Request);
 }
Esempio n. 10
0
 /// <summary>
 /// Instantiates a new process contrext for inversion.
 /// </summary>
 /// <remarks>You can think of this type here as "being Inversion". This is the thing.</remarks>
 /// <param name="underlyingContext">The underlying http context to wrap.</param>
 /// <param name="services">The service container the context will use.</param>
 /// <param name="resources">The resources available to the context.</param>
 public AspNetContext(HttpContext underlyingContext, IServiceContainer services, IResourceAdapter resources) : base(services, resources)
 {
     _underlyingContext = underlyingContext;
     _application       = this.UnderlyingContext.ApplicationInstance as AspNetApplication;
     _response          = new AspNetResponse(this.UnderlyingContext.Response);
     _request           = new AspNetRequest(this.UnderlyingContext.Request);
 }
Esempio n. 11
0
 public static void SetAdapter(IResourceAdapter adapter)
 {
     Adapter = adapter ?? throw new NullReferenceException();
 }
Esempio n. 12
0
 /// <summary>
 /// Instantiates a new process contrext for inversion.
 /// </summary>
 /// <remarks>You can think of this type here as "being Inversion". This is the thing.</remarks>
 /// <param name="services">The service container the context will use.</param>
 /// <param name="resources">The resources available to the context.</param>
 public MockWebContext(IServiceContainer services, IResourceAdapter resources) : base(services, resources)
 {
     this.Request  = new MockWebRequest(String.Empty);
     this.Response = new MockWebResponse();
 }