Example #1
0
 public RemoteFileSynchronizer(IGoogleDriveClient googleDriveClient, MultiDriveSyncService service)
 {
     this.googleDriveClient = googleDriveClient ?? throw new ArgumentNullException(nameof(googleDriveClient));
     FolderPathsById        = new Dictionary <string, string>();
     _service = service;
     FolderPathsById[_service.Settings.StorageRootId] = _service.Settings.LocalRootPath;
 }
Example #2
0
 public LocalFileSynchronizer(IGoogleDriveClient googleDriveClient, MultiDriveSyncService service)
 {
     _service = service;
     watcher  = new FileSystemWatcher();
     this.googleDriveClient = googleDriveClient;
     parentIdsByPath        = new Dictionary <string, string>();
     eventDebouncer         = new Debouncer <FileSystemEventArgs>(DebouncedEventHandler);
 }
 public GoogleDriveCloudService(
     IGoogleDriveClient googleDriveClient,
     ISimpleDataStorage simpleDataStorage,
     IClock clock)
 {
     _googleDriveClient = googleDriveClient;
     _simpleDataStorage = simpleDataStorage;
     _clock             = clock;
 }
Example #4
0
        public MultiDriveSyncService(Action <MultiDriveSyncSettings> configure)
        {
            Settings = new MultiDriveSyncSettings();
            configure(Settings);

            BlackList              = new ConcurrentDictionary <string, object>();
            credential             = GetStoredCredential(Settings.StorageAccountId, Settings.ClientInfo);
            googleDriveClient      = new GoogleDriveClient(credential, Settings.ClientInfo.AppName);
            localFileSynchronizer  = new LocalFileSynchronizer(googleDriveClient, this);
            remoteFileSynchronizer = new RemoteFileSynchronizer(googleDriveClient, this);
        }
 public SettingsForm(IStringResources stringResources, ISettingsController settingsController,
                     IGoogleDriveClient googleDriveClient, IFormLogger logger, ILocalizableForm mainForm,
                     ITelegramClientWrapper telegramClientWrapper)
 {
     this.stringResources       = stringResources;
     this.settingsController    = settingsController;
     this.googleDriveClient     = googleDriveClient;
     this.logger                = logger;
     this.mainForm              = mainForm;
     this.telegramClientWrapper = telegramClientWrapper;
     InitializeComponent();
 }
Example #6
0
 public MainForm(IStringResources stringResources, IGoogleDriveClient googleDriveClient,
                 ISettingsController settingsController,
                 IMotionController motionController, IFormLogger logger,
                 ITelegramClientWrapper telegramClientWrapper)
 {
     InitializeComponent();
     Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
     this.googleDriveClient     = googleDriveClient;
     this.settingsController    = settingsController;
     this.motionController      = motionController;
     this.logger                = logger;
     this.telegramClientWrapper = telegramClientWrapper;
     this.stringResources       = stringResources;
     logger.InitForm(this);
 }
 public MotionController(IStringResources stringResources, IFormLogger logger,
                         IGoogleDriveClient googleDriveClient,
                         ISettingsController settingsController,
                         ITelegramClientWrapper telegramClientWrapper)
 {
     this.stringResources       = stringResources;
     this.logger                = logger;
     this.googleDriveClient     = googleDriveClient;
     this.settingsController    = settingsController;
     this.telegramClientWrapper = telegramClientWrapper;
     DevicesList                = new List <string>();
     detector = new MotionDetector(
         new TwoFramesDifferenceDetector(),
         null);
     videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
     for (var i = 0; i < videoDevices.Count; i++)
     {
         DevicesList.Add(videoDevices[i].Name);
     }
     StartGoogleDriveSending();
     IsActive = false;
 }