Exemplo n.º 1
0
 public RemoveValidatorCommandHandler(IReadService <DynamicMetadataDefinition> dynamicMetadataDefinitionService, IWriteService <DynamicMetadataDefinition> dynamicMetadataDefinitionWriteService, IEventDispatcher eventDispatcher, IMapper mapper)
 {
     _dynamicMetadataDefinitionService      = dynamicMetadataDefinitionService;
     _dynamicMetadataDefinitionWriteService = dynamicMetadataDefinitionWriteService;
     _eventDispatcher = eventDispatcher;
     _mapper          = mapper;
 }
Exemplo n.º 2
0
        public void Constructor_Throws(ILogger <WriteController> logger, IWriteService writeService, string name)
        {
            Action act = () => { new WriteController(logger, writeService); };

            act.Should().Throw <ArgumentNullException>()
            .Where(x => x.Message.Contains(name));
        }
 public PropertyAddedToMetadataDefinitionEventHandler(IReadService <Movie> movieReadService, IWriteService <Movie> movieWriteService, IReadService <DynamicMetadataDefinition> dynamicMetadataDefinition, IMapper mapper)
 {
     _movieReadService          = movieReadService;
     _movieWriteService         = movieWriteService;
     _dynamicMetadataDefinition = dynamicMetadataDefinition;
     _mapper = mapper;
 }
 public RefreshValidationEventHandler(IReadService <DynamicMetadataDefinition> metadataReadService, IReadService <Movie> movieReadService, IWriteService <Movie> movieWriteService, IValidationFactory validationFactory)
 {
     _metadataReadService = metadataReadService;
     _movieReadService    = movieReadService;
     _movieWriteService   = movieWriteService;
     _validationFactory   = validationFactory;
 }
Exemplo n.º 5
0
        public ReadService(IOptions <AppSettings> AppSettings, IWriteService WriteService)
        {
            appSettings  = AppSettings.Value;
            writeService = WriteService;

            nameChangePath      = appSettings.FileEditPath;
            outputDirectoryPath = appSettings.FileOutputFolder;
        }
Exemplo n.º 6
0
 public ChangePropertyTypeAndDefaultValueCommandHandler(IReadService <DynamicMetadataDefinition> dynamicMetadataDefinitonService, IWriteService <DynamicMetadataDefinition> dynamicMetadataDefinitionWriteService, IInputDataParser inputDataParser, IMapper mapper, IEventDispatcher eventDispatcher)
 {
     _dynamicMetadataDefinitonService       = dynamicMetadataDefinitonService;
     _dynamicMetadataDefinitionWriteService = dynamicMetadataDefinitionWriteService;
     _inputDataParser = inputDataParser;
     _mapper          = mapper;
     _eventDispatcher = eventDispatcher;
 }
Exemplo n.º 7
0
 public AddValidatorCommandHandler(IReadService <DynamicMetadataDefinition> dynamicMetadataDefinitionService, IWriteService <DynamicMetadataDefinition> dynamicMetadataDefinitionWriteService, IEventDispatcher eventDispatcher, IMapper mapper, IValidationFactory validationFactory)
 {
     _dynamicMetadataDefinitionService      = dynamicMetadataDefinitionService;
     _dynamicMetadataDefinitionWriteService = dynamicMetadataDefinitionWriteService;
     _eventDispatcher   = eventDispatcher;
     _mapper            = mapper;
     _validationFactory = validationFactory;
 }
Exemplo n.º 8
0
 public PropertyDefinitionUpdatedEventHandler(IReadService <Movie> movieReadService, IWriteService <Movie> movieWriteService, IReadService <DynamicMetadataDefinition> dynamicMetadataDefinition, IValidationFactory validationFactory, IMapper mapper)
 {
     _movieReadService          = movieReadService;
     _movieWriteService         = movieWriteService;
     _dynamicMetadataDefinition = dynamicMetadataDefinition;
     _validationFactory         = validationFactory;
     _mapper = mapper;
 }
 public UpdateMovieMetadataCommandHandler(IReadService <Movie> movieReadService, IWriteService <Movie> movieWriteService, IMapper mapper, IInputDataParser inputDataParser, IReadService <DynamicMetadataDefinition> dynamicMetadataDefinitionReadService, IValidationFactory validationFactory)
 {
     _movieReadService  = movieReadService;
     _movieWriteService = movieWriteService;
     _mapper            = mapper;
     _inputDataParser   = inputDataParser;
     _dynamicMetadataDefinitionReadService = dynamicMetadataDefinitionReadService;
     _validationFactory = validationFactory;
 }
Exemplo n.º 10
0
        public static void Execute(string command, IWriteService writeSrv)
        {
            switch (GetDiscordCommands(command))
            {
            case EnumDiscordCommand.Pub: Pub(writeSrv); break;

            default: break;
            }
        }
Exemplo n.º 11
0
        private static void Help(IWriteService writeSrv)
        {
            var msg = "Liste des commandes :";

            msg += AddCommandBasedOnEnum(typeof(EnumTextCommand));
            msg += AddCommandBasedOnEnum(typeof(DiscordCommands.EnumDiscordCommand), "Discord");

            writeSrv.WriteInChat(msg);
        }
Exemplo n.º 12
0
        private static void Hydrate(IWriteService writeSrv)
        {
            var rng = new Random();

            var pickedIndex = rng.Next(0, HydrateResults.Count - 1);

            _lastHydrate = DateTime.Now;
            writeSrv.WriteInChat(HydrateResults[pickedIndex]);
        }
Exemplo n.º 13
0
        private static void HydrateTime(IWriteService writeSrv)
        {
            if (_lastHydrate == null)
            {
                writeSrv.WriteInChat("Il n'a jamais bu Kappa");
                return;
            }

            writeSrv.WriteInChat($"Il a bu pour la dernière fois, il y a {GetDiffMinutesLastTimeHydrate().ToString(new CultureInfo("en-US"))} minute(s).");
        }
Exemplo n.º 14
0
        private async Task PopulateMetadataAsync(IWriteService writeService)
        {
            Console.WriteLine("Populating Metadata.");
            var metadataFactories = Enumerable.Range(0, 100)
                                    .Select(i => new MetadataFactory
            {
                Id       = Guid.NewGuid(),
                Name     = "Factory 1",
                Location = new Location
                {
                    Latitude   = -34,
                    Longitude  = 151,
                    Address1   = "4122 Broad Bay Way",
                    Address2   = "Suite 400",
                    City       = "Aurora",
                    State      = "IL",
                    Country    = "US",
                    PostalCode = "60502",
                },
                DateInService = "4/12/2011",
            }).ToList();

            var metadataMachines = Enumerable.Range(0, 100)
                                   .Select(i => new MetadataMachine
            {
                Id                  = Guid.NewGuid(),
                SerialNumber        = "212X4821BYG",
                DateInService       = "7/23/2017",
                LastMaintenanceDate = "7/27/2019 13:42:01Z",
            }).ToList();

            var metadataMaintenanceLookups = Enumerable.Range(0, 100)
                                             .Select(i => new MetadataMaintenanceLookup
            {
                Id                            = Guid.NewGuid(),
                Pressure                      = "<7475",
                MachineTemperature            = "<70",
                MaintenanceAdjustmentRequired = "Tighten Adjustment Harness",
            }).ToList();

            await writeService.CreateFactoriesAsync(metadataFactories);

            Console.WriteLine("Created Factory Metadata.");

            await writeService.CreateMachinesAsync(metadataMachines);

            Console.WriteLine("Created Machine Metadata.");

            await writeService.CreateMaintenanceLookupsAsync(metadataMaintenanceLookups);

            Console.WriteLine("Created Maintenance Lookup Metadata.");
        }
Exemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of <see cref="Uploader"/>
 /// </summary>
 /// <param name="imageDataProvider">Image data provider</param>
 /// <param name="mappingFactory">Mapping factory</param>
 /// <param name="metadataExtractorFactory">Metadata extractor factory</param>
 /// <param name="builderService">Builder service</param>
 /// <param name="publishingService">Publishing service</param>
 /// <param name="imageWriteService">Image write service</param>
 /// <param name="writeService">Write service</param>
 public Uploader(IImageDataProvider imageDataProvider,
                 IMappingFactory mappingFactory,
                 IMetadataExtractorFactory metadataExtractorFactory,
                 IBuilderService builderService,
                 IPublishingService publishingService,
                 IImageWriteService imageWriteService,
                 IWriteService writeService)
 {
     _imageDataProvider        = imageDataProvider;
     _mappingFactory           = mappingFactory;
     _metadataExtractorFactory = metadataExtractorFactory;
     _builderService           = builderService;
     _publishingService        = publishingService;
     _imageWriteService        = imageWriteService;
     _writeService             = writeService;
 }
Exemplo n.º 16
0
        public static void Execute(string command, IWriteService writeSrv)
        {
            switch (GetTextCommands(command))
            {
            case EnumTextCommand.Help: Help(writeSrv); break;

            case EnumTextCommand.Hydrate: Hydrate(writeSrv); break;

            case EnumTextCommand.Toto: Toto(writeSrv); break;

            case EnumTextCommand.Bonjour: Bonjour(writeSrv); break;

            case EnumTextCommand.Rig: Rig(writeSrv); break;

            case EnumTextCommand.Indelivrables: Indelivrables(writeSrv); break;

            case EnumTextCommand.GiveUp: GiveUp(writeSrv); break;

            case EnumTextCommand.TimeHydrate: HydrateTime(writeSrv); break;

            default: break;
            }
        }
Exemplo n.º 17
0
        public async Task InvokeAsync(HttpContext context, IWriteService service)
        {
            context.Request.EnableBuffering();
            if (context.Request != null)
            {
                string path        = context.Request.Path;   // api/students
                string method      = context.Request.Method; // GET, POST
                string queryString = context.Request.QueryString.ToString();
                string bodyStr     = "";

                using (var reader = new StreamReader(context.Request.Body, Encoding.UTF8, true, 1024, true))
                {
                    bodyStr = await reader.ReadToEndAsync();

                    context.Request.Body.Position = 0;
                }
                //zapisać do pliku
                service.Write(new string[] { DateTime.Now.ToString(), path, method, queryString, bodyStr });
            }
            if (_next != null)
            {
                await _next(context);
            }
        }
Exemplo n.º 18
0
 public TableColumnDescriptor(IColumn column, IWriteService writeService)
     : this(column)
 {
     this.writeService = writeService;
 }
Exemplo n.º 19
0
 public TestService(IWriteService writeService)
 {
     _writeService = writeService;
 }
 public CreateMovieCommandHandler(IWriteService <Movie> movieWriteService, IMapper mapper)
 {
     _movieWriteService = movieWriteService;
     _mapper            = mapper;
 }
Exemplo n.º 21
0
 private static void Rig(IWriteService writeSrv)
 {
     writeSrv.WriteInChat("Il a 4 écrans et il ne parle que de ça...");
 }
Exemplo n.º 22
0
 public Logger(IWriteService writeService, IDateProvider dateProvider)
 {
     _service      = writeService;
     _dateProvider = dateProvider;
 }
Exemplo n.º 23
0
 public CreditsController(IReadService <Credit> crs, IWriteService <Credit> cws)
 {
     _creditReadService  = crs;
     _creditWriteService = cws;
 }
Exemplo n.º 24
0
 public Controller()
 {
     _readService  = new ReadService();
     _splitService = new SplitService();
     _writeService = new WriteService();
 }
Exemplo n.º 25
0
 private static void GiveUp(IWriteService writeSrv)
 {
     writeSrv.WriteInChat("https://www.youtube.com/watch?v=dQw4w9WgXcQ LUL");
 }
Exemplo n.º 26
0
 public WriteController(IWriteService writeService)
 {
     this.writeService = writeService;
 }
 private static void Hello(IWriteService service, string hello, string from)
 {
     service.WriteLine($"{hello} {from}!");
 }
Exemplo n.º 28
0
 private static void Toto(IWriteService writeSrv)
 {
     writeSrv.WriteInChat("Votre langage est très évolué.");
 }
Exemplo n.º 29
0
 private static void Bonjour(IWriteService writeSrv)
 {
     writeSrv.WriteInChat("HeyGuys");
 }
Exemplo n.º 30
0
 public Game(IWriteService writeService, IEngineService engineService)
 {
     _writeService  = writeService;
     _engineService = engineService;
 }
Exemplo n.º 31
0
 private static void Indelivrables(IWriteService writeSrv)
 {
     writeSrv.WriteInChat("Allez tous regarder la chaîne YouTube des Indélivrables : https://www.youtube.com/channel/UCl7djHZZcnOt-t05QMYx90g");
 }