Example #1
0
 public InstructionComponent(RegisterComponent registers, StackComponent stack, MemoryComponent memory)
 {
     Interpreter        = new(registers, stack, memory, this);
     Active             = true;
     this.memory        = memory;
     InstructionPointer = memory.ExecutionStartAddress;
 }
Example #2
0
        public static void Initialise()
        {
            IUnityContainer   container = new UnityContainer();
            RegisterComponent register  = new RegisterComponent(container);

            ServiceLocator.SetLocatorProvider(() => new UnityServiceLocator(container));

            ComponentLoader.LoadContainer(register,
                                          Assembly.GetExecutingAssembly(),
                                          Assembly.GetAssembly(typeof(IGraphStorageService)));
        }
Example #3
0
        public static void Initialise()
        {
            IUnityContainer   container = new UnityContainer();
            RegisterComponent register  = new RegisterComponent(container);

            ServiceLocator.SetLocatorProvider(() => new UnityServiceLocator(container));

            ComponentLoader.LoadContainer(register,
                                          Assembly.GetExecutingAssembly(),
                                          Assembly.GetAssembly(typeof(ModelDependencyResolver)),
                                          Assembly.GetAssembly(typeof(DomainDependencyResolver)));
        }
Example #4
0
 public void SetUp(RegisterComponent registerComponent)
 {
     registerComponent.RegisterType <RoleService, RoleServiceImp>();
     registerComponent.RegisterType <UserService, UserServiceImpl>();
     registerComponent.RegisterType <BatchService, BatchServiceImpl>();
     registerComponent.RegisterType <VehicleService, VehicleServiceImpl>();
     registerComponent.RegisterType <ZoneService, ZoneServiceImp>();
     registerComponent.RegisterType <HistoryService, HistoryServiceImp>();
     registerComponent.RegisterType <InspectionService, InspectionServiceImpl>();
     registerComponent.RegisterType <TransportService, TransportServiceImpl>();
     registerComponent.RegisterType <FlowService, FlowServiceImp>();
 }
Example #5
0
 public void SetUp(RegisterComponent registerComponent)
 {
     registerComponent.RegisterType <RoleDAO, RoleDAOImp>();
     registerComponent.RegisterType <BatchDAO, BatchDAOImp>();
     registerComponent.RegisterType <UserDAO, UserDAOImp>();
     registerComponent.RegisterType <VehicleDAO, VehicleDAOImpl>();
     registerComponent.RegisterType <ZoneDAO, ZoneDAOImp>();
     registerComponent.RegisterType <HistoryDAO, HistoryDAOImp>();
     registerComponent.RegisterType <InspectionDAO, InspectionDAOImp>();
     registerComponent.RegisterType <TransportDAO, TransportDAOImp>();
     registerComponent.RegisterType <FlowDAO, FlowDAOImp>();
 }
        public static void LoadContainer(IUnityContainer container, string path, string pattern)
        {
            var dirCat = new DirectoryCatalog(path, pattern);
            var importDef = BuildImportDefinition();
            Container.UnityContainer = container;
            try
            {
                using (var aggregateCatalog = new AggregateCatalog())
                {
                    aggregateCatalog.Catalogs.Add(dirCat);

                    using (var componsitionContainer = new CompositionContainer(aggregateCatalog))
                    {
                        IEnumerable<Export> exports = componsitionContainer.GetExports(importDef);

                        IEnumerable<IComponent> modules =
                            exports.Select(export => export.Value as IComponent).Where(m => m != null);

                        var registerComponent = new RegisterComponent(container);
                        foreach (IComponent module in modules)
                        {
                            module.SetUp(registerComponent);
                        }
                    }
                }
            }
            catch (ReflectionTypeLoadException typeLoadException)
            {
                var builder = new StringBuilder();
                foreach (Exception loaderException in typeLoadException.LoaderExceptions)
                {
                    builder.AppendFormat("{0}\n", loaderException.Message);
                }

                throw new TypeLoadException(builder.ToString(), typeLoadException);
            }
        }
Example #7
0
 public InstanceType(RegisterComponent componentRegistrator)
 {
     _componentRegistrator = componentRegistrator;
 }
Example #8
0
 public InstanceType(RegisterComponent componentRegistrator)
 {
     _componentRegistrator = componentRegistrator;
 }