static void Main(string[] args) { // Get my dirty XML config string cameraAddress = ConfigurationManager.AppSettings["CameraAddress"]; string cameraUsername = ConfigurationManager.AppSettings["CameraUsername"]; string cameraPassword = ConfigurationManager.AppSettings["CameraPassword"]; string snapshotFolder = ConfigurationManager.AppSettings["SnapshotFolder"]; // FTP Option string ftpAddress = ConfigurationManager.AppSettings["FTPAddress"]; string ftpUsername = ConfigurationManager.AppSettings["FTPUsername"]; string ftpPassword = ConfigurationManager.AppSettings["FTPPassword"]; // Setup camera = new Camera(new Uri(cameraAddress)); if (!string.IsNullOrEmpty(cameraPassword)) { camera.Credentials = new NetworkCredential(cameraUsername, cameraPassword); } saver = new FileImageSaver(snapshotFolder); //saver = new FTPImageSaver(new Uri(ftpAddress), ftpUsername, ftpPassword); retriever = new ImageRetriever(); int seconds; if (args.Length > 0 && int.TryParse(args[0], out seconds)) { Timer timer = new Timer(TimerTick, null, TimeSpan.Zero, TimeSpan.FromSeconds(seconds)); System.Console.ReadLine(); // Chillout and wait for the timer mo'fo } else { TimerTick(null); // Force it once } }
public MainWindowViewModel(IImageSaver imageSaver) { _imageSaver = imageSaver ?? throw new ArgumentNullException(nameof(imageSaver)); WebImageProvider = new WebImageProvider(); HardDriveImageProvider = new HardDriveImageProvider(); }
public UserPostService(IRepositoryWrapper repository, IMapper mapper, IImageSaver imageSaver) { _repository = repository; _mapper = mapper; _imageSaver = imageSaver; }
public TagCloud(ITagDrawer drawer, ITextReader textReader, IWordsAnalyzer wordsAnalyzer, IImageSaver imageSaver) { this.drawer = drawer; this.textReader = textReader; this.wordsAnalyzer = wordsAnalyzer; this.imageSaver = imageSaver; }
static void Main(string[] args) { // Get my dirty XML config string cameraAddress = ConfigurationManager.AppSettings["CameraAddress"]; string cameraUsername = ConfigurationManager.AppSettings["CameraUsername"]; string cameraPassword = ConfigurationManager.AppSettings["CameraPassword"]; string snapshotFolder = ConfigurationManager.AppSettings["SnapshotFolder"]; // FTP Option string ftpAddress = ConfigurationManager.AppSettings["FTPAddress"]; string ftpUsername = ConfigurationManager.AppSettings["FTPUsername"]; string ftpPassword = ConfigurationManager.AppSettings["FTPPassword"]; // Setup camera = new Camera(new Uri(cameraAddress)); if(!string.IsNullOrEmpty(cameraPassword)) camera.Credentials = new NetworkCredential(cameraUsername, cameraPassword); saver = new FileImageSaver(snapshotFolder); //saver = new FTPImageSaver(new Uri(ftpAddress), ftpUsername, ftpPassword); retriever = new ImageRetriever(); int seconds; if (args.Length > 0 && int.TryParse(args[0], out seconds)) { Timer timer = new Timer(TimerTick, null, TimeSpan.Zero, TimeSpan.FromSeconds(seconds)); System.Console.ReadLine(); // Chillout and wait for the timer mo'fo } else { TimerTick(null); // Force it once } }
public ConsoleTagsCloudCreator(ITagsCloudCreator creator, IImageSaver saver, IWordReader reader, IWordProcessor processor) { this.creator = creator; this.saver = saver; this.reader = reader; this.processor = processor; }
public ProfilePhotoSaver(IImageSaver imageSaver, CurrentUserCredentialsGetter userCredentialsGetter, IRepository <int, ProfilePhoto> profileRepo) { _imageSaver = imageSaver; _userCredentialsGetter = userCredentialsGetter; _profileRepo = profileRepo; }
public Gui(CloudCreator cloudCreator, IReader reader, ITextParser parser, TagCloudVisualizer visualizer, IImageSaver saver) { this.cloudCreator = cloudCreator; this.reader = reader; this.saver = saver; this.visualizer = visualizer; this.parser = parser; }
public CloudDrawer(ICloudLayouter cloudLayouter, IColorProvider colorProvider, IImageSaver imageSaver) { this.cloudLayouter = cloudLayouter; ChangeImageSize(300); cloudLayouter.ChangeCenter(new Point(ImageSize / 2, ImageSize / 2)); ImageSaver = imageSaver; ColorProvider = colorProvider; }
public TagCloudHelper(ITextReader textReader, TagCloudTextAnalyzer textAnalyzer, TagCloudDrawer drawer, IImageSaver imageSaver) { this.textReader = textReader; this.textAnalyzer = textAnalyzer; this.drawer = drawer; this.imageSaver = imageSaver; Settings = new TagCloudSettings(); }
public void Init() { _offerRepositoryMock = Substitute.For <IOfferRepository>(); _geoCodeProviderMock = Substitute.For <IGeoCodeProvider>(); _imagePathBuilder = Substitute.For <IImagePathBuilder>(); _imageSaver = Substitute.For <IImageSaver>(); _offerService = new OfferService(_offerRepositoryMock, _geoCodeProviderMock, _imagePathBuilder, _imageSaver); }
public TagCloudMaker(IWordProcessor wordProcessor, ICloudLayouter cloudLayouter, ITagCloudDrawer tagCloudDrawer, IImageSaver imageSaver, DrawingSettings settings) { this.wordProcessor = wordProcessor; this.cloudLayouter = cloudLayouter; this.tagCloudDrawer = tagCloudDrawer; this.imageSaver = imageSaver; this.settings = settings; }
public OfferService(IOfferRepository offerRepository, IGeoCodeProvider geoCodeProvider, IImagePathBuilder imageUrlBuilder, IImageSaver imageSaver) { _offerRepository = offerRepository; _geoCodeProvider = geoCodeProvider; _imageUrlBuilder = imageUrlBuilder; _imageSaver = imageSaver; }
public MainWindow() { InitializeComponent(); this.currentShape = Enums.Shape.Line; this.shapeDrawer = new ShapeDrawer(); this.solidColorBrushes = typeof(Brushes).GetProperties().Select((x) => (x.GetValue(null) as SolidColorBrush)); this.imageSaver = new SaveImageToFile(); this.AddColorsToMenus(); }
public ObjectPhotoService(IImageSaver imageSaver, IRepository <int, OfferedObject> objectsRepo, IRepository <int, ObjectPhoto> photoRepo, IOwnershipAuthorization <int, OfferedObject> authorizer) { _imageSaver = imageSaver; _objectsRepo = objectsRepo; _photoRepo = photoRepo; _authorizer = authorizer; }
public Application(IFileReader reader, IToSizeConverter wordConverter, IWordFilter filter, ICloudLayouter layouter, IVisualisator visualisator, IImageSaver saver) { this.reader = reader; this.wordConverter = wordConverter; this.filter = filter; this.layouter = layouter; this.saver = saver; this.visualisator = visualisator; this.saver = saver; }
/// <summary> /// Constructor for objects of type ImageModel /// </summary> /// <param name="currentImage">The image associated with this model</param> /// <param name="imageEditor">The ImageEditor used to edit the image (Resize, Flip, Rotate)</param> /// <param name="imageSaver">The ImageSaver used to save the image to a specific path/filename</param> public void Initialise(Image currentImage, IImageEditor imageEditor, IImageSaver imageSaver) { // SET the parameters _image = currentImage; _imageEditor = imageEditor; _imageSaver = imageSaver; // Initialize the List: _currentEditFuncs = new List <Func <Image, Image> >(); // Instantiate imageData: }
public TagCloudWindow(CloudCreator cloudCreator, IReader reader, ITextParser parser, TagCloudVisualizer visualizer, IImageSaver saver) { this.cloudCreator = cloudCreator; this.reader = reader; this.saver = saver; this.visualizer = visualizer; this.parser = parser; InitializeComponent(); DataContext = this; this.Show(); }
public void SetSettings(IFileReader reader, ICloudLayouter layouter, IPreprocessor preprocessor, IImageSaver saver, ICloudBuilder builder) { this.reader = reader; this.layouter = layouter; this.preprocessor = preprocessor; this.saver = saver; this.cloudBuilder = builder; }
public ConsoleUi(IReader[] readers, IImageBuilder tagCloudImageCreator, ILayoutAlgorithm layoutAlgorithm, IImageSaver imageSaver, Filter filter, WordConverter wordConverter) { this.filter = filter; this.wordConverter = wordConverter; this.readers = readers; this.tagCloudImageCreator = tagCloudImageCreator; this.imageSaver = imageSaver; this.layoutAlgorithm = layoutAlgorithm; }
public ApplicationCore(ReaderFinder readerFinder, IImageBuilder tagCloudImageBuilder, ILayoutAlgorithm layoutAlgorithm, IImageSaver imageSaver, Filter filter, WordConverter wordConverter) { this.filter = filter; this.wordConverter = wordConverter; this.readerFinder = readerFinder; this.tagCloudImageBuilder = tagCloudImageBuilder; this.imageSaver = imageSaver; this.layoutAlgorithm = layoutAlgorithm; }
public PhotoAdder(IImageSaver imageSaver, CurrentUserCredentialsGetter credentialsGetter, IRepository <int, OfferedObject> objectsRepo, IRepository <int, ObjectPhoto> photoRepo, OwnershipAuthorization <int, OfferedObject> authorizer) { _imageSaver = imageSaver; _credentialsGetter = credentialsGetter; _objectsRepo = objectsRepo; _photoRepo = photoRepo; _authorizer = authorizer; }
public ImageCreator(ITextReader reader, IWordProcessor wordProcessor, IWordFrequenciesToSizesConverter converter, ILayouter layouter, IImageSizeCalculator imageSizeCalculator, IRectanglesTransformer rectanglesTransformer, IVisualizer visualizer, IImageSaver saver) { this.reader = reader; this.wordProcessor = wordProcessor; this.converter = converter; this.layouter = layouter; this.imageSizeCalculator = imageSizeCalculator; this.rectanglesTransformer = rectanglesTransformer; this.visualizer = visualizer; this.saver = saver; }
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(); }
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(); }
public Application( ICloudLayouter layouter, IVisualizer visualizer, IFileReader fileReader, IImageSaver imageSaver, IStatisticsCollector statisticsCollector, IWordFilter wordFilter, ISizeScheme sizeScheme, IWordProcessor wordProcessor) { this.layouter = layouter; this.visualizer = visualizer; this.fileReader = fileReader; this.imageSaver = imageSaver; this.statisticsCollector = statisticsCollector; this.wordFilter = wordFilter; this.sizeScheme = sizeScheme; this.wordProcessor = wordProcessor; }
public WallrApplication(ISetup setup, ILogger logger, IEnumerable <IQuickUseOption> quickUseOptions, IObservableImageQueue imageQueue, IImageRepository imageRepository, IImageSourceConfigurations imageSourceConfigurations, IImageSaver saver, IImageSources imageSources, IWallpaperUpdater wallpaperUpdater, TestingSources testingSources) { _setup = setup; _logger = logger; _quickUseOptions = quickUseOptions; _imageQueue = imageQueue; _imageRepository = imageRepository; _imageSourceConfigurations = imageSourceConfigurations; _saver = saver; _imageSources = imageSources; _wallpaperUpdater = wallpaperUpdater; _testingSources = testingSources; }
public ChatTests() { var mockClientProxy = new Mock <IClientProxy>(); var mockClients = new Mock <IHubClients>(); mockClients.Setup(clients => clients.All).Returns(mockClientProxy.Object); var dialogHubMock = new Mock <IHubContext <DialogHub> >(); dialogHubMock.Setup(x => x.Clients).Returns(() => mockClients.Object); var provider = new ServiceCollection() .AddSingleton <IRepositoryWrapper, RepositoryWrapper>() .AddSingleton <IImageSaver, ImageSaver>() .AddSingleton <IDialogNotifier, DialogNotifier>() .BuildServiceProvider(); _imageSaver = provider.GetService <ImageSaver>(); }
public ImageService(IImageSaver saver, IFileChecker checker) { this._saver = saver; this._checker = checker; }
public PhotoService(IRepositoryWrapper repository, IImageSaver imageSaver) { _repository = repository; _imageSaver = imageSaver; }
public static void SaveImage(this Bitmap bitmap, IImageSaver saver, string filename) { saver.SaveImage(bitmap, filename); }
public EventPostController(IImageSaver imageSaver, IMediator mediator) { _imageSaver = imageSaver; _mediator = mediator; }