コード例 #1
0
 public WatermarkService(IAzureImageUploadComponent azureImageUpload, IImageValidator imageValidator, IWebHostEnvironment environment, ILogger <WatermarkService> logger)
 {
     CreateFoldersIfNeeded();
     _azureImageUpload = azureImageUpload;
     _logger           = logger;
     _imageValidator   = imageValidator;
     _environment      = environment;
 }
コード例 #2
0
        public ImageValidatorTest()
        {
            configuration = new ConfigurationBuilder()
                            .AddInMemoryCollection(configurationSettings)
                            .Build();

            imageValidator = new ImageValidator(configuration);
        }
コード例 #3
0
ファイル: FileManager.cs プロジェクト: ImanRezaeipour/clinic
 /// <summary>
 ///
 /// </summary>
 /// <param name="imageValidation"></param>
 /// <param name="imageBuilder"></param>
 /// <param name="attachmentManager"></param>
 /// <param name="videoManager"></param>
 /// <param name="videoValidator"></param>
 public FileManager(IImageValidator imageValidation, IImageBuilder imageBuilder, IAttachmentManager attachmentManager, IVideoManager videoManager, IVideoValidator videoValidator, IConfigurationManager configurationManager)
 {
     _imageValidation      = imageValidation;
     _imageBuilder         = imageBuilder;
     _attachmentManager    = attachmentManager;
     _videoManager         = videoManager;
     _videoValidator       = videoValidator;
     _configurationManager = configurationManager;
 }
コード例 #4
0
ファイル: ImageService.cs プロジェクト: hienmx95/crm-be
 public ImageService(
     IUOW UOW,
     ILogging Logging,
     ICurrentContext CurrentContext,
     IImageValidator ImageValidator
     )
 {
     this.UOW            = UOW;
     this.Logging        = Logging;
     this.CurrentContext = CurrentContext;
     this.ImageValidator = ImageValidator;
 }
コード例 #5
0
 public ImageService(DataContext dataContext, IFileStorage fileStorage, IImageValidator validator, ImageResizeService resizeService, FreeLimitsChecker freeLimits)
 {
     Ensure.NotNull(dataContext, "dataContext");
     Ensure.NotNull(fileStorage, "fileStorage");
     Ensure.NotNull(validator, "validator");
     Ensure.NotNull(resizeService, "resizeService");
     Ensure.NotNull(freeLimits, "freeLimits");
     this.dataContext   = dataContext;
     this.fileStorage   = fileStorage;
     this.validator     = validator;
     this.resizeService = resizeService;
     this.freeLimits    = freeLimits;
 }
コード例 #6
0
        public MotionSensorStartup(MotionSensorSetup setup)
        {
            //setup the extractor
            imageExtractor = new ImageExtractor(setup.camera);
            imageExtractor.framerateBroadcast += new ImageExtractor.FramerateBroadcastEvent(FramerateBroadcastEventHandler);
            imageExtractor.asyncrohous = true;

            //set up the save file object
            imageSaver = new ImageSaver(setup.imageSaveLocation, "movement", setup.camera.cameraId);
            imageSaver.saveToFileServer = true; //setup.saveImagesToFileServer;
            imageSaver.saveToDatabase = setup.saveImagesToDatabase;
            imageSaver.ParentDirectory = setup.imageSaveLocation;
            captureId = imageSaver.captureId;

            //set up the database object
            if(setup.saveImagesToDatabase)
            {
                database = new CaptureDb(ConfigurationManager.ConnectionStrings["LOCALDB"].ConnectionString);
                database.CreateCaptureSession(captureId, imageSaver.SaveDirectory);
                detectionId = database.CreateDetectionSession(captureId);
                imageSaver.detectionId = detectionId;
            }

            //setup the motion sensor
            motionSensor = new MotionSensor_2a();
            motionSensor.settings = new MotionSensorSettings();
            motionSensor.settings.LoadDefaults();

            motionSensor.motionDetected += new MotionSensor_2.MotionDetected(imageSaver.ImageCreatedAsync);

            //create the validator 
            imageValidator = new ImageValidator();
            imageValidator.ListenForImages(imageExtractor);
            imageValidator.imageValidated += new ImageValidator.ImageValidatedEvent(motionSensor.ImageCreatedAsync);//subscribe to events from the validator

            //setup the alarms
            alarms = new List<IAlarm>();
            if (setup.emailAlarm != null)
            {
                alarms.Add(setup.emailAlarm as EmailAlarm);
                imageSaver.imageCreated += new ImageSaver.ImageSavedEvent(setup.emailAlarm.ImageExtracted);
            }

            imageExtractor.Run();

        }
コード例 #7
0
        public MotionSensorStartup(MotionSensorSetup setup)
        {
            //setup the extractor
            imageExtractor = new ImageExtractor(setup.camera);
            imageExtractor.framerateBroadcast += new ImageExtractor.FramerateBroadcastEvent(FramerateBroadcastEventHandler);
            imageExtractor.asyncrohous         = true;

            //set up the save file object
            imageSaver = new ImageSaver(setup.imageSaveLocation, "movement", setup.camera.cameraId);
            imageSaver.saveToFileServer = true; //setup.saveImagesToFileServer;
            imageSaver.saveToDatabase   = setup.saveImagesToDatabase;
            imageSaver.ParentDirectory  = setup.imageSaveLocation;
            captureId = imageSaver.captureId;

            //set up the database object
            if (setup.saveImagesToDatabase)
            {
                database = new CaptureDb(ConfigurationManager.ConnectionStrings["LOCALDB"].ConnectionString);
                database.CreateCaptureSession(captureId, imageSaver.SaveDirectory);
                detectionId            = database.CreateDetectionSession(captureId);
                imageSaver.detectionId = detectionId;
            }

            //setup the motion sensor
            motionSensor          = new MotionSensor_2a();
            motionSensor.settings = new MotionSensorSettings();
            motionSensor.settings.LoadDefaults();

            motionSensor.motionDetected += new MotionSensor_2.MotionDetected(imageSaver.ImageCreatedAsync);

            //create the validator
            imageValidator = new ImageValidator();
            imageValidator.ListenForImages(imageExtractor);
            imageValidator.imageValidated += new ImageValidator.ImageValidatedEvent(motionSensor.ImageCreatedAsync);//subscribe to events from the validator

            //setup the alarms
            alarms = new List <IAlarm>();
            if (setup.emailAlarm != null)
            {
                alarms.Add(setup.emailAlarm as EmailAlarm);
                imageSaver.imageCreated += new ImageSaver.ImageSavedEvent(setup.emailAlarm.ImageExtracted);
            }

            imageExtractor.Run();
        }
コード例 #8
0
 public ImageValidatorTests(){
     _IImageValidator = new ImageValidator();
 }
コード例 #9
0
 public UploadImage(IProductRepository repository, IImageValidator validator)
 {
     _repository = repository;
     _validator  = validator;
 }
コード例 #10
0
 public ImageWorkerService(IImageValidator imageValidator)
 {
     _imageValidator = imageValidator;
 }