Example #1
0
 private static void OnBuild(ISystemBuilder builder)
 {
     builder.Use <IObjectManager>(options => options
                                  .With <SchemaManager>()
                                  .HavingKey(DbObjectType.Schema)
                                  .InTransactionScope());
 }
        public static ISystemBuilder UseConfiguration(this ISystemBuilder builder, Action <IConfigurationBuilder> configure)
        {
            var configBuilder = new ConfigurationBuilder();

            configure(configBuilder);
            return(builder.UseConfiguration(configBuilder.Build()));
        }
Example #3
0
 public static ISystemBuilder UseViewsFeature(this ISystemBuilder builder)
 {
     return(builder.UseFeature(feature => feature.Named(SystemFeatureNames.Views)
                               .WithAssemblyVersion()
                               .OnSystemBuild(OnBuild)
                               .OnTableCompositeCreate(OnCompositeCreate)));
 }
Example #4
0
 public static ISystemBuilder UseFileSystem <T>(this ISystemBuilder builder, string key) where T : class, IFileSystem
 {
     return(builder.Use <IFileSystem>(options => options
                                      .With <T>()
                                      .HavingKey(key)
                                      .InSystemScope()));
 }
        private static void OnBuild(ISystemBuilder builder)
        {
            builder
            .Use <IObjectManager>(options => options
                                  .With <RoutineManager>()
                                  .HavingKey(DbObjectType.Routine)
                                  .InTransactionScope())
            .Use <IRoutineResolver>(options => options
                                    .With <SystemFunctionsProvider>()
                                    .InDatabaseScope())
            .Use <IRoutineResolver>(options => options
                                    .With <RoutineManager>()
                                    .InTransactionScope())
            .Use <ITableContainer>(options => options
                                   .With <RoutinesTableContainer>()
                                   .InTransactionScope());

            //builder.Use<ITableCompositeSetupCallback>(options => options
            //	.With<RoutinesInit>()
            //	.InQueryScope());

            //builder.Use<IDatabaseCreateCallback>(options => options
            //	.With<RoutinesInit>()
            //	.InQueryScope());
        }
Example #6
0
 Guid IPort_BuilderAdapter.AcceptSystemBuilder(ISystemBuilder builder, Dictionary <Guid, Guid> signalMappings, Dictionary <Guid, Guid> busMappings)
 {
     return(builder.BuildPort(_entity.EntityId,
                              BuilderMapSignals(_inputSignalSet, signalMappings),
                              BuilderMapSignals(_outputSignalSet, signalMappings),
                              BuilderMapBuses(_busSet, busMappings)));
 }
 private static void OnBuild(ISystemBuilder builder)
 {
     builder.Use<IObjectManager>(options => options
         .With<SchemaManager>()
         .HavingKey(DbObjectType.Schema)
         .InTransactionScope());
 }
 public void OnBuild(ISystemBuilder builder)
 {
     if (BuildHandler != null)
     {
         BuildHandler(builder);
     }
 }
        public static ISystemBuilder UseFeature(this ISystemBuilder builder, Action <FeatureBuilder> feature)
        {
            var featureBuilder = new FeatureBuilder();

            feature(featureBuilder);

            return(builder.UseFeature(featureBuilder.Build()));
        }
Example #10
0
        public static ISystemBuilder UseLocalFileSystem(this ISystemBuilder builder)
        {
#if PCL
            return(builder.UseFileSystem <PortableFileSystem>("local"));
#else
            return(builder.UseFileSystem <LocalFileSystem>("local"));
#endif
        }
 public void BuildSystem(ISystemBuilder systemBuilder, NameValueCollection collection)
 {
     systemBuilder.AddDrive(collection["Drive"])
     .AddMemory(collection["Memory"])
     .AddKeyboard(collection["Keyboard"])
     .AddMouse(collection["Mouse"])
     .AddTouchScreen(collection["TouchScreen"]);
 }
Example #12
0
 public static ISystemBuilder UseStoreDataFactory <T>(this ISystemBuilder builder, string key)
     where T : class, IStoreDataFactory
 {
     return(builder.Use <IStoreDataFactory>(options => options
                                            .With <T>()
                                            .HavingKey(key)
                                            .InDatabaseScope()));
 }
 public static ISystemBuilder UseRoutinesFeature(this ISystemBuilder builder)
 {
     return(builder.UseFeature(feature => feature.Named(SystemFeatureNames.Routines)
                               .WithAssemblyVersion()
                               .OnSystemBuild(OnBuild)
                               .OnDatabaseCreate(OnDatabaseCreate)
                               .OnTableCompositeSetup(OnCompositeSetup)));
 }
        public static ISystemBuilder Use <TService>(this ISystemBuilder builder, Action <IServiceUseConfiguration <TService> > options)
        {
            var provider = new ServiceUseConfigurationProvider <TService>();

            options(provider);

            return(builder.Use(provider.Options));
        }
 public void BuildSystem(ISystemBuilder systemBuilder, NameValueCollection collection)
 {
     systemBuilder.AddHDD(collection["HDD"]);
     systemBuilder.AddRAM(collection["RAM"]);
     systemBuilder.AddMouse(collection["Mouse"]);
     systemBuilder.AddKeyboard(collection["Keyboard"]);
     systemBuilder.AddTouchScreen(collection["TouchScreen"]);
 }
Example #16
0
 public void BuildSystem(ISystemBuilder systemBuilder, IDictionary collection)
 {
     systemBuilder.AddDrive(collection["Drive"].ToString());
     systemBuilder.AddMemory(collection["Memory"].ToString());
     systemBuilder.AddMouse(collection["Mouse"].ToString());
     systemBuilder.AddKeyBoard(collection["KeyBoard"].ToString());
     systemBuilder.AddTouchScreen(collection["TouchScreen"].ToString());
     systemBuilder.AddTouchScreen(collection["Processor"].ToString());
 }
Example #17
0
 private static void OnBuild(ISystemBuilder builder)
 {
     builder.Use <IObjectManager>(options => options
                                  .With <ViewManager>()
                                  .InTransactionScope()
                                  .HavingKey(DbObjectType.View))
     .Use <ITableContainer>(options => options
                            .With <ViewTableContainer>()
                            .InTransactionScope());
 }
 private static void OnBuild(ISystemBuilder builder)
 {
     builder.Use<IObjectManager>(options => options
             .With<ViewManager>()
             .InTransactionScope()
             .HavingKey(DbObjectType.View))
         .Use<ITableContainer>(options => options
             .With<ViewTableContainer>()
             .InTransactionScope());
 }
        public static ISystemBuilder UseFileConfiguration(this ISystemBuilder builder, string filePath, IConfigurationFormatter formatter)
        {
            var config = new Data.Configuration.Configuration();

            using (var source = new FileConfigurationSource(filePath)) {
                formatter.LoadInto(config, source.InputStream);
            }

            return(builder.UseConfiguration(config));
        }
Example #20
0
        internal void AcceptSystemBuilder(ISystemBuilder builder)
        {
            Dictionary <Guid, Guid> signalMappings = new Dictionary <Guid, Guid>();
            Dictionary <Guid, Guid> busMappings    = new Dictionary <Guid, Guid>();

            builder.BeginBuildSystem(_inputs.Count, _outputs.Count, _allBuses.Count);

            // Before
            foreach (Signal s in _allSignals)
            {
                signalMappings.Add(s.InstanceId, s.AcceptSystemBuilderBefore(builder));
            }
            foreach (Bus b in _allBuses)
            {
                busMappings.Add(b.InstanceId, b.AcceptSystemBuilderBefore(builder));
            }
            foreach (Port p in _allPorts)
            {
                p.AcceptSystemBuilder(builder, signalMappings, busMappings);
            }

            // After
            foreach (Signal s in _allSignals)
            {
                s.AcceptSystemBuilderAfter(builder, signalMappings, busMappings);
            }

            // System Interface
            foreach (Signal si in _inputs)
            {
                builder.AppendSystemInputSignal(signalMappings[si.InstanceId]);
            }
            foreach (Signal so in _outputs)
            {
                builder.AppendSystemOutputSignal(signalMappings[so.InstanceId]);
            }

            // Named Signals
            if (_namedBuses != null)
            {
                foreach (KeyValuePair <string, Signal> ns in _namedSignals)
                {
                    builder.AppendSystemNamedSignal(signalMappings[ns.Value.InstanceId], ns.Key);
                }
            }
            if (_namedBuses != null)
            {
                foreach (KeyValuePair <string, Bus> nb in _namedBuses)
                {
                    builder.AppendSystemNamedBus(busMappings[nb.Value.InstanceId], nb.Key);
                }
            }

            builder.EndBuildSystem();
        }
Example #21
0
        public static ISystemBuilder UseSequencesFeature(this ISystemBuilder builder)
        {
            return(builder.UseFeature(feature => feature.Named(SystemFeatureNames.Sequences)
                                      .WithAssemblyVersion()
                                      .OnSystemBuild(OnBuild)
                                      .OnTableCompositeCreate(OnCompositeCreate)));

            //builder.Use<ITableCompositeCreateCallback>(options => options
            //	.With<SequencesInit>()
            //	.InQueryScope());
        }
 public ISystemBuilder GetSystemConfiguration(Employee employee)
 {
     if (employee.JobDescription.ToUpper().Equals("MANAGER"))
     {
         systemBuilder = new LaptopBuilder();
     }
     else
     {
         systemBuilder = new DesktopBuilder();
     }
     return(systemBuilder);
 }
        public static ISystemBuilder UseSystemServices(this ISystemBuilder builder, Assembly assembly)
        {
            return(builder.ConfigureServices(scope => {
                var types = assembly.GetImplementationTypes()
                            .Where(x => typeof(ISystemServicesProvider).GetTypeInfo().IsAssignableFrom(x.GetTypeInfo()));

                foreach (var type in types)
                {
                    scope.Register(typeof(ISystemServicesProvider), type, null);
                }
            }));
        }
Example #24
0
        protected override void RegisterServices(ISystemBuilder builder)
        {
            var mock = new Mock <IIndexFactory>();

            mock.Setup(obj => obj.CreateIndex(It.IsAny <ColumnIndexContext>()))
            .Returns <ColumnIndexContext>(context => {
                var cmock = new Mock <ColumnIndex>(context.Table, context.ColumnOffset);
                return(cmock.Object);
            });
            mock.Setup(obj => obj.HandlesIndexType(It.IsAny <string>()))
            .Returns(true);

            builder.Use(mock.Object);
        }
Example #25
0
 public void OnBuild(ISystemBuilder builder)
 {
     builder.Use <IObjectManager>(options => options
                                  .With <ViewManager>()
                                  .InTransactionScope()
                                  .HavingKey(DbObjectType.View))
     .Use <ITableCompositeCreateCallback>(options => options
                                          .With <ViewsInit>()
                                          .HavingKey("Views")
                                          .InTransactionScope())
     .Use <ITableContainer>(options => options
                            .With <ViewTableContainer>()
                            .InTransactionScope());
 }
Example #26
0
 public void OnBuild(ISystemBuilder builder)
 {
     builder.Use<IObjectManager>(options => options
             .With<ViewManager>()
             .InTransactionScope()
             .HavingKey(DbObjectType.View))
         .Use<ITableCompositeCreateCallback>(options => options
             .With<ViewsInit>()
             .HavingKey("Views")
             .InTransactionScope())
         .Use<ITableContainer>(options => options
             .With<ViewTableContainer>()
             .InTransactionScope());
 }
Example #27
0
        void ISignal_BuilderAdapter.AcceptSystemBuilderAfter(ISystemBuilder builder, Dictionary <Guid, Guid> signalMappings, Dictionary <Guid, Guid> busMappings)
        {
            Guid guid = signalMappings[InstanceId];

            if (Value != null)
            {
                builder.AppendSignalValue(guid, CustomDataPack <IValueStructure> .Pack(Value, signalMappings, busMappings));
            }
            foreach (IProperty property in _properties)
            {
                builder.AppendSignalProperty(guid, CustomDataPack <IProperty> .Pack(property, signalMappings, busMappings));
            }
            foreach (IProperty constraint in _constraints)
            {
                builder.AppendSignalConstraint(guid, CustomDataPack <IProperty> .Pack(constraint, signalMappings, busMappings));
            }
        }
Example #28
0
        internal void AcceptSystemBuilderAfter(ISystemBuilder builder, Dictionary <Guid, Guid> signalMappings, Dictionary <Guid, Guid> busMappings)
        {
            Guid guid = signalMappings[_iid];

            if (_presentStructure != null)
            {
                builder.AppendSignalValue(guid, StructurePack.Pack(_presentStructure, signalMappings, busMappings));
            }
            foreach (Property property in _properties)
            {
                builder.AppendSignalProperty(guid, PropertyPack.Pack(property, signalMappings, busMappings));
            }
            foreach (Property constraint in _constraints)
            {
                builder.AppendSignalConstraint(guid, PropertyPack.Pack(constraint, signalMappings, busMappings));
            }
        }
Example #29
0
        private static void RegisterDefaultServices(ISystemBuilder builder)
        {
            builder.UseDefaultConfiguration()

#if !MICRO
            .UseSecurityFeature()
            .UseDefaultSqlCompiler()
            .UseDefaultStatementCache()
#endif

            .UseDefaultQueryPlanner()

            .UseLocalFileSystem()
            .UseInMemoryStoreSystem()
            .UseSingleFileStoreSystem()
            .UseJournaledStoreSystem()
            .UseScatteringFileDataFactory();
        }
 private static void OnBuild(ISystemBuilder builder)
 {
     builder
         .Use<IObjectManager>(options => options
             .With<TypeManager>()
             .HavingKey(DbObjectType.Type)
             .InTransactionScope())
         .Use<ITableContainer>(options => options
             .With<TypesTableContainer>()
             .InTransactionScope())
         //.Use<ITableCompositeCreateCallback>(options => options
         //	.With<TypesInit>()
         //	.InTransactionScope())
         .Use<ITypeResolver>(options => options
             .With<TypeManager>()
             .InTransactionScope())
         .Use<IRoutineResolver>(options => options
             .With<TypeManager>()
             .InTransactionScope());
 }
 private static void OnBuild(ISystemBuilder builder)
 {
     builder
     .Use <IObjectManager>(options => options
                           .With <TypeManager>()
                           .HavingKey(DbObjectType.Type)
                           .InTransactionScope())
     .Use <ITableContainer>(options => options
                            .With <TypesTableContainer>()
                            .InTransactionScope())
     //.Use<ITableCompositeCreateCallback>(options => options
     //	.With<TypesInit>()
     //	.InTransactionScope())
     .Use <ITypeResolver>(options => options
                          .With <TypeManager>()
                          .InTransactionScope())
     .Use <IRoutineResolver>(options => options
                             .With <TypeManager>()
                             .InTransactionScope());
 }
Example #32
0
        public static ISystemBuilder WithNESComponents(this ISystemBuilder builder)
        {
            var collection = builder.ServiceCollection;

            collection.TryAddSingleton <Registers>();
            collection.TryAddSingleton <NESContext>();
            collection.TryAddSingleton <RicohRP2C02>();
            collection.TryAddSingleton <PPURegisters>();
            collection.TryAddSingleton <IPPUMemoryMap, PPURawMemoryMap>();
            collection.TryAddSingleton <IClock, LockedFramerateClock>();
            collection.TryAddSingleton <PPUInternalRegisters>();
            collection.TryAddSingleton <BackgroundHandler>();
            collection.TryAddSingleton <PaletteHandler>();
            collection.TryAddSingleton <SpriteHandler>();
            collection.TryAddSingleton <ScrollHandler>();
            collection.TryAddSingleton <InputHandler>();
            collection.TryAddSingleton <PixelMuxer>();


            return(builder);
        }
Example #33
0
        public void OnBuild(ISystemBuilder builder)
        {
            builder
                .Use<IUserManager>(options => options
                    .With<UserManager>()
                    .InSessionScope())
                //.Use<IDatabaseCreateCallback>(options => options
                //	.With<UsersInit>()
                //	.InQueryScope())
                .Use<IPrivilegeManager>(options => options
                    .With<PrivilegeManager>()
                    .InSessionScope())
                .Use<ITableCompositeSetupCallback>(options => options
                    .With<PrivilegesInit>()
                    .InQueryScope())
                .Use<IUserIdentifier>(options => options
                    .With<ClearTextUserIdentifier>());

            // TODO: Add the system callbacks

            #if !PCL
            builder.Use<IUserIdentifier, Pkcs12UserIdentifier>();
            #endif
        }
        public void OnBuild(ISystemBuilder builder)
        {
            builder
            .Use <IUserManager>(options => options
                                .With <UserManager>()
                                .InSessionScope())
            //.Use<IDatabaseCreateCallback>(options => options
            //	.With<UsersInit>()
            //	.InQueryScope())
            .Use <IPrivilegeManager>(options => options
                                     .With <PrivilegeManager>()
                                     .InSessionScope())
            .Use <ITableCompositeSetupCallback>(options => options
                                                .With <PrivilegesInit>()
                                                .InQueryScope())
            .Use <IUserIdentifier>(options => options
                                   .With <ClearTextUserIdentifier>());

            // TODO: Add the system callbacks

#if !PCL
            builder.Use <IUserIdentifier, Pkcs12UserIdentifier>();
#endif
        }
 public SystemReader(ISystemBuilder builder)
 {
     _builder = builder;
 }
Example #36
0
        private static void RegisterDefaultServices(ISystemBuilder builder)
        {
            builder.UseDefaultConfiguration()

            #if !MICRO
                .UseSecurityFeature()
                .UseDefaultSqlCompiler()
                .UseDefaultStatementCache()
            #endif

                .UseDefaultQueryPlanner()

                .UseLocalFileSystem()
                .UseInMemoryStoreSystem()
                .UseSingleFileStoreSystem()
                .UseJournaledStoreSystem()
                .UseScatteringFileDataFactory();
        }
        public void AcceptSystemBuilder(ISystemBuilder builder)
        {
            Dictionary<Guid, Guid> signalMappings = new Dictionary<Guid, Guid>();
            Dictionary<Guid, Guid> busMappings = new Dictionary<Guid, Guid>();

            builder.BeginBuildSystem(_inputs.Count, _outputs.Count, _allBuses.Count);

            // Before
            foreach(Signal s in _allSignals)
                signalMappings.Add(s.InstanceId, ((ISignal_BuilderAdapter)s).AcceptSystemBuilderBefore(builder));
            foreach(Bus b in _allBuses)
                busMappings.Add(b.InstanceId, ((IBus_BuilderAdapter)b).AcceptSystemBuilderBefore(builder));
            foreach(Port p in _allPorts)
                ((IPort_BuilderAdapter)p).AcceptSystemBuilder(builder, signalMappings, busMappings);

            // After
            foreach(Signal s in _allSignals)
                ((ISignal_BuilderAdapter)s).AcceptSystemBuilderAfter(builder, signalMappings, busMappings);

            // System Interface
            foreach(Signal si in _inputs)
                builder.AppendSystemInputSignal(signalMappings[si.InstanceId]);
            foreach(Signal so in _outputs)
                builder.AppendSystemOutputSignal(signalMappings[so.InstanceId]);

            // Named Signals
            if(_namedBuses != null)
                foreach(KeyValuePair<string, Signal> ns in _namedSignals)
                    builder.AppendSystemNamedSignal(signalMappings[ns.Value.InstanceId], ns.Key);
            if(_namedBuses != null)
                foreach(KeyValuePair<string, Bus> nb in _namedBuses)
                    builder.AppendSystemNamedBus(busMappings[nb.Value.InstanceId], nb.Key);

            builder.EndBuildSystem();
        }
Example #38
0
 protected virtual void RegisterServices(ISystemBuilder builder)
 {
 }
        private static void OnBuild(ISystemBuilder builder)
        {
            builder
                .Use<IObjectManager>(options => options
                    .With<RoutineManager>()
                    .HavingKey(DbObjectType.Routine)
                    .InTransactionScope())
                .Use<IRoutineResolver>(options => options
                    .With<SystemFunctionsProvider>()
                    .InDatabaseScope())
                .Use<IRoutineResolver>(options => options
                    .With<RoutineManager>()
                    .InTransactionScope())
                .Use<ITableContainer>(options => options
                    .With<RoutinesTableContainer>()
                    .InTransactionScope());

            //builder.Use<ITableCompositeSetupCallback>(options => options
            //	.With<RoutinesInit>()
            //	.InQueryScope());

            //builder.Use<IDatabaseCreateCallback>(options => options
            //	.With<RoutinesInit>()
            //	.InQueryScope());
        }
 public XmlSystemReader(ISystemBuilder builder)
 {
     _builder = builder;
     _fsm = new StateMachine();
 }
Example #41
0
 Guid IBus_BuilderAdapter.AcceptSystemBuilderBefore(ISystemBuilder builder)
 {
     return builder.BuildBus(Label);
 }
Example #42
0
 void IBus_BuilderAdapter.AcceptSystemBuilderAfter(ISystemBuilder builder, Dictionary<Guid, Guid> signalMappings, Dictionary<Guid, Guid> busMappings)
 {
 }
Example #43
0
 Guid IPort_BuilderAdapter.AcceptSystemBuilder(ISystemBuilder builder, Dictionary<Guid, Guid> signalMappings, Dictionary<Guid, Guid> busMappings)
 {
     return builder.BuildPort(_entity.EntityId,
         BuilderMapSignals(_inputSignalSet, signalMappings),
         BuilderMapSignals(_outputSignalSet, signalMappings),
         BuilderMapBuses(_busSet, busMappings));
 }
Example #44
0
 Guid ISignal_BuilderAdapter.AcceptSystemBuilderBefore(ISystemBuilder builder)
 {
     return builder.BuildSignal(Label, _hold, _isSourceSignal);
 }
Example #45
0
 void ISignal_BuilderAdapter.AcceptSystemBuilderAfter(ISystemBuilder builder, Dictionary<Guid, Guid> signalMappings, Dictionary<Guid, Guid> busMappings)
 {
     Guid guid = signalMappings[InstanceId];
     if(Value != null)
         builder.AppendSignalValue(guid, CustomDataPack<IValueStructure>.Pack(Value, signalMappings, busMappings));
     foreach(IProperty property in _properties)
         builder.AppendSignalProperty(guid, CustomDataPack<IProperty>.Pack(property, signalMappings, busMappings));
     foreach(IProperty constraint in _constraints)
         builder.AppendSignalConstraint(guid, CustomDataPack<IProperty>.Pack(constraint, signalMappings, busMappings));
 }
Example #46
0
 protected virtual void RegisterServices(ISystemBuilder builder)
 {
 }
Example #47
0
        protected override void RegisterServices(ISystemBuilder builder)
        {
            var mock = new Mock<IIndexFactory>();
            mock.Setup(obj => obj.CreateIndex(It.IsAny<ColumnIndexContext>()))
                .Returns<ColumnIndexContext>(context => {
                    var cmock = new Mock<ColumnIndex>(context.Table, context.ColumnOffset);
                    return cmock.Object;
                });
            mock.Setup(obj => obj.HandlesIndexType(It.IsAny<string>()))
                .Returns(true);

            builder.Use(mock.Object);
        }