コード例 #1
0
 public GoogleDriveServerSyncProvider(IConfigurationRetriever configurationRetriever, IGoogleDriveService googleDriveService, ILogManager logManager, IHttpClient httpClient)
 {
     _configurationRetriever = configurationRetriever;
     _googleDriveService     = googleDriveService;
     _httpClient             = httpClient;
     _logger = logManager.GetLogger("GoogleDrive");
 }
コード例 #2
0
 public GoogleDriveServerSyncProvider(IConfigurationRetriever configurationRetriever, IGoogleDriveService googleDriveService, ILogManager logManager, IHttpClient httpClient)
 {
     _configurationRetriever = configurationRetriever;
     _googleDriveService = googleDriveService;
     _httpClient = httpClient;
     _logger = logManager.GetLogger("GoogleDrive");
 }
コード例 #3
0
        public GoogleDriveTreeViewModel(string credentialFileName, string applicationName)
        {
            var view = _itemsView = new ListCollectionView(_items);

            view.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
            _gService = new GoogleDriveService(credentialFileName, applicationName);
        }
コード例 #4
0
        private void ActivateGoogleDrive(object obj)
        {
            if (!IsGoogleDriveEnabled)
            {
                if (_googleDriveService == null)
                {
                    _googleDriveService = Container.Resolve <IGoogleDriveService>();
                }

                if (_googleDriveService != null && _googleDriveService.IsInitalized())
                {
                    _googleDriveService.CreateApplicationFolder();

                    _configService.SaveAppSettingsValue(AppSettingConstants.IsGoogleDriveEnabled, "true");

                    IsGoogleDriveEnabled = true;
                }
                else
                {
                    _messenger.Send(new GoogleDriveAccessDeniedMsg());
                    _googleDriveService = null;
                }
            }
            else
            {
                _messenger.Send(new GoogleDriveAlreadyEnabledMsg());
            }
        }
コード例 #5
0
        public MainWindowViewModel(IDatabaseService databaseService, IMessenger messenger, IImageService imageService,
                                   IDataService dataService, IJsonService jsonService, IFtpService ftpService, IConfigService configService)
        {
            _databaseService = databaseService;
            _messenger       = messenger;
            _imageService    = imageService;
            _dataService     = dataService;
            _jsonService     = jsonService;
            _ftpService      = ftpService;
            _configService   = configService;

            //register for messages
            _messenger.Register <ChooseFilesConfirmMsg>(this, OnChooseFilesConfirmMsg);
            _messenger.Register <ImportConfirmMsg>(this, OnImportConfirmMsg);
            _messenger.Register <ExportViewClosedMsg>(this, OnExportviewClosedMsg);
            _messenger.Register <ChooseFilesGoogleDriveConfirmMsg>(this, OnChooseFilesGoogleDriveConfirmMsg);
            _messenger.Register <FileProcessFinishedMsg>(this, OnFileProcessFinishedMsg);

            IsGoogleDriveEnabled =
                Convert.ToBoolean(_configService.GetAppSettingsValue(AppSettingConstants.IsGoogleDriveEnabled));

            _mobileKey = _configService.GetAppSettingsValue(AppSettingConstants.MobileKey);

            if (!string.IsNullOrEmpty(_mobileKey))
            {
                HasMobileKey = true;
            }

            if (IsGoogleDriveEnabled)
            {
                _googleDriveService = Container.Resolve <IGoogleDriveService>();
                _googleDriveService.DownloadCompleted += GoogleDriveService_DownloadCompleted;
            }
        }
コード例 #6
0
 public CommandController(
     EnbsvParserService enbsvParserService,
     GazServiceParserService gazServiceParserService,
     IPartsRepository partsRepository,
     IPartProducerRepository partProducerRepository,
     ICatalogItemRepository catalogItemRepository,
     IPartSupplierRepository partSupplierRepository,
     ISupplierPriceItemRepository supplierPriceItemRepository,
     IModerationService moderationService,
     IHostingEnvironment hostingEnvironment,
     ISchedulerWrapper scheduler,
     IGoogleDriveService googleDriveService)
 {
     this._scheduler                   = scheduler;
     this._googleDriveService          = googleDriveService;
     this._moderationService           = moderationService;
     this._gazServiceParserService     = gazServiceParserService;
     this._enbsvParserService          = enbsvParserService;
     this._partSupplierRepository      = partSupplierRepository;
     this._partsRepository             = partsRepository;
     this._partProducerRepository      = partProducerRepository;
     this._hostingEnvironment          = hostingEnvironment;
     this._catalogItemRepository       = catalogItemRepository;
     this._supplierPriceItemRepository = supplierPriceItemRepository;
 }
コード例 #7
0
 public RoutesController(IIOServiceContext context, IHttpContextAccessor httpContextAccessor, IGoogleDriveService googleDriveService, IVtexAPIService vtexAPIService, IDriveImportRepository driveImportRepository)
 {
     this._context               = context ?? throw new ArgumentNullException(nameof(context));
     this._httpContextAccessor   = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor));
     this._googleDriveService    = googleDriveService ?? throw new ArgumentNullException(nameof(googleDriveService));
     this._vtexAPIService        = vtexAPIService ?? throw new ArgumentNullException(nameof(vtexAPIService));
     this._driveImportRepository = driveImportRepository ?? throw new ArgumentNullException(nameof(driveImportRepository));
 }
コード例 #8
0
        public Mutation(IGoogleDriveService googleDriveService, IDriveImportRepository driveImportRepository, IVtexAPIService vtexAPIService)
        {
            Name = "Mutation";

            Field <StringGraphType>(
                "importImages",
                resolve: context =>
            {
                return(vtexAPIService.DriveImport());
            });

            Field <BooleanGraphType>(
                "revokeToken",
                arguments: new QueryArguments(
                    new QueryArgument <StringGraphType> {
                Name = "accountName", Description = "Account Name"
            }
                    ),
                resolve: context =>
            {
                bool revoked = googleDriveService.RevokeGoogleAuthorizationToken().Result;
                if (revoked)
                {
                    string accountName = context.GetArgument <string>("accountName");
                    driveImportRepository.SaveFolderIds(null, accountName);
                }

                return(revoked);
            });

            Field <StringGraphType>(
                "googleAuthorize",
                resolve: context =>
            {
                return(googleDriveService.GetGoogleAuthorizationUrl());
            });

            Field <StringGraphType>(
                "createSheet",
                resolve: context =>
            {
                return(googleDriveService.CreateSheet());
            });

            Field <StringGraphType>(
                "processSheet",
                resolve: context =>
            {
                return(vtexAPIService.SheetImport());
            });

            Field <StringGraphType>(
                "addImages",
                resolve: context =>
            {
                return(googleDriveService.ClearAndAddImages());
            });
        }
コード例 #9
0
 public CandidatoService(
     ICandidatoRepository candidatoRepository,
     IApiResponseMessage apiResponseMessage,
     IGoogleDriveService googleDriveService)
 {
     _candidatoRepository = candidatoRepository;
     _utilitarios         = apiResponseMessage;
     _googleDriveService  = googleDriveService;
 }
コード例 #10
0
 public GameController(GameTestingReportCompiler testReportCompiler, IConfigurationService configService, IGoogleDriveService driveService, IGameRetrieverService drawStore, IPlayerDatabaseController playerController, IStatisticsService statisticsService)
 {
     _configService          = configService;
     _driveService           = driveService;
     _gameStore              = drawStore;
     _playerController       = playerController;
     _statisticsService      = statisticsService;
     _gameTestReportCompiler = testReportCompiler;
 }
コード例 #11
0
        public NewFolderViewModel(IMainModel mainModel, INavigationService navigationService, IGoogleDriveService googleDriveService, ISystemTrayService systemTrayService, IMessageBoxService messageBoxService)
        {
            _mainModel = mainModel;
            _navigationService = navigationService;
            _googleDriveService = googleDriveService;
            _systemTrayService = systemTrayService;
            _messageBoxService = messageBoxService;

            CreateNewFolderCommand = new RelayCommand(CreateNewFolder, () => !IsBusy);
        }
コード例 #12
0
ファイル: Main.cs プロジェクト: AmberCode/RentalTracker
        public Main()
        {
            InitializeComponent();
            Load += Main_Load;

            _propertyService    = new PropertyService();
            _tenantService      = new TenantService();
            _googleDriveService = new GoogleDriveService();
            _nameErrorProvider  = new ErrorProvider();
        }
コード例 #13
0
        public DiscordBotCommunicator(IReporter reporter, IGoogleDriveService gdriveService, IAccountController accountController, IPlayerDatabaseController playerDatabaseController,
                                      IGameExecutor gameExecutor, IConfigurationService configurationService)
        {
            _reporter                 = reporter;
            _accountController        = accountController;
            _playerDatabaseController = playerDatabaseController;
            _gameExecutor             = gameExecutor;
            _configService            = configurationService;

            _reporter.Initialise();
        }
コード例 #14
0
 public ListaService(
     IListaRepository listaRepository,
     IApiResponseMessage utilitarios,
     IGoogleDriveService googleDriveService,
     ICandidatoService candidatoService,
     ICandidatoRepository candidatoRepository
     )
 {
     _listaRepository     = listaRepository;
     _googleDriveService  = googleDriveService;
     apiResponseMessage   = utilitarios;
     _candidatoService    = candidatoService;
     _candidatoRepository = candidatoRepository;
 }
コード例 #15
0
        public RenameFileViewModel(IMainModel mainModel, INavigationService navigationService, IGoogleDriveService googleDriveService, ISystemTrayService systemTrayService, IMessageBoxService messageBoxService)
        {
            _mainModel = mainModel;
            _navigationService = navigationService;
            _googleDriveService = googleDriveService;
            _systemTrayService = systemTrayService;
            _messageBoxService = messageBoxService;

            RenameFileCommand = new RelayCommand(RenameFile, () => !IsBusy);

            PageLoadedCommand = new RelayCommand(() =>
            {
                FileName = _mainModel.SelectedFile.Title;
            });
        }
コード例 #16
0
 public UsuarioCBService(
     IListaRepository listaRepository,
     IApiResponseMessage utilitarios,
     IGoogleDriveService googleDriveService,
     ICandidatoService candidatoService,
     ICandidatoRepository candidatoRepository,
     IClienteRepository clientesRepository,
     IUsuarioCoreBRepository usuarioCBRepository
     )
 {
     _listaRepository     = listaRepository;
     _googleDriveService  = googleDriveService;
     apiResponseMessage   = utilitarios;
     _candidatoService    = candidatoService;
     _candidatoRepository = candidatoRepository;
     _clienteRepository   = clientesRepository;
     _usuarioCBRepository = usuarioCBRepository;
 }
コード例 #17
0
 public CuentaService(
     IListaRepository listaRepository,
     IApiResponseMessage apiResponseMessage,
     IGoogleDriveService googleDriveService,
     ICandidatoService candidatoService,
     ICandidatoRepository candidatoRepository,
     IClienteRepository clientesRepository,
     ICuentasRepository cuentasRespository
     )
 {
     _listaRepository     = listaRepository;
     _googleDriveService  = googleDriveService;
     _apiResponseMessage  = apiResponseMessage;
     _candidatoService    = candidatoService;
     _candidatoRepository = candidatoRepository;
     _clienteRepository   = clientesRepository;
     _cuentasRespository  = cuentasRespository;
 }
コード例 #18
0
 public MovimientoService(
     IListaRepository listaRepository,
     IApiResponseMessage utilitarios,
     IGoogleDriveService googleDriveService,
     ICandidatoService candidatoService,
     ICandidatoRepository candidatoRepository,
     IClienteRepository clientesRepository,
     IMovimientoRepository movimientoRepository,
     ICuentasRepository cuentasRepository,
     IApiResponseMessage apiResponseMessage
     )
 {
     _listaRepository      = listaRepository;
     _googleDriveService   = googleDriveService;
     apiResponseMessage    = utilitarios;
     _candidatoService     = candidatoService;
     _candidatoRepository  = candidatoRepository;
     _clienteRepository    = clientesRepository;
     _movimientoRepository = movimientoRepository;
     _cuentasRepository    = cuentasRepository;
     _apiResponseMessage   = apiResponseMessage;
 }
コード例 #19
0
 public SyncOrchestrator(ISourceFileProvider sourceFileProvider, IGoogleDriveService googleDriveService, ILog log)
 {
     _log = log;
     _googleDriveService = googleDriveService;
     _sourceFileProvider = sourceFileProvider;
 }
コード例 #20
0
        public ExplorerViewModel(IMainModel mainModel, IGoogleDriveService googleDriveService, INavigationService navigationService, IMessageBoxService messageBoxService, ISystemTrayService systemTrayService, IPhotoChooserService photoChooserService)
        {
            _mainModel = mainModel;
            _googleDriveService = googleDriveService;
            _navigationService = navigationService;
            _messageBoxService = messageBoxService;
            _systemTrayService = systemTrayService;
            _photoChooserService = photoChooserService;

            Files = new ObservableCollection<GoogleFileViewModel>();
            PictureFiles = new ObservableCollection<GoogleFileViewModel>();

            OpenFileCommand = new RelayCommand<GoogleFileViewModel>(file =>
            {
                if (IsSelectionEnabled)
                {
                    return;
                }

                OpenFile(file);
            });

            ChangeStaredStatusCommand = new RelayCommand<GoogleFileViewModel>(file =>
            {
                if (IsSelectionEnabled)
                {
                    return;
                }

                ChangeStaredStatus(file);
            });

            AddFileCommand = new RelayCommand(UploadFile);

            EnableSelectionCommand = new RelayCommand(() =>
            {
                if (IsBusy)
                {
                    return;
                }

                IsSelectionEnabled = true;
            });

            RefreshFilesCommand = new RelayCommand(RefreshFiles);

            DeleteFilesCommand = new RelayCommand<IList>(files =>
            {
                _messageBoxService.Show("You are about to delete the selected files. Do you wish to proceed?", "Delete files?", new[] { "delete", "cancel" }, button =>
                {
                    if (button != 0)
                        return;

                    var filesArray = files
                        .Cast<GoogleFileViewModel>()
                        .ToArray();

                    IsSelectionEnabled = false;

                    DeleteFiles(filesArray);
                });
            });

            CreateNewFolderCommand = new RelayCommand(CreateNewFolder);

            RenameFileCommand = new RelayCommand<GoogleFileViewModel>(RenameFile);

            DeleteFileCommand = new RelayCommand<GoogleFileViewModel>(file =>
            {
                _messageBoxService.Show(string.Format("You are about to delete '{0}'. Do you wish to proceed?", file.Title), "Delete file?", new[] { "delete", "cancel" }, button =>
                {
                    if (button != 0)
                        return;

                    DeleteFile(file);
                });
            });

            ShowAboutCommand = new RelayCommand(() =>
            {
                _navigationService.NavigateTo("/View/AboutPage.xaml");
            });

            PageLoadedCommand = new RelayCommand(ExecuteInitialLoad);

            BackKeyPressCommand = new RelayCommand<CancelEventArgs>(e =>
            {
                GoogleDriveFile item;

                if (PivotSelectedIndex == 1)
                {
                    PivotSelectedIndex = 0;

                    e.Cancel = true;
                }
                else if (IsSelectionEnabled)
                {
                    IsSelectionEnabled = false;

                    e.Cancel = true;
                }
                else if (_mainModel.TryPop(out item))
                {
                    AbortCurrentCall();

                    RaisePropertyChanged(() => CurrentPath);

                    RefreshFiles();

                    e.Cancel = true;
                }
                else
                {
                    AbortCurrentCall(true);

                    Files.Clear();
                    PictureFiles.Clear();
                }
            });

            MessengerInstance.Register<RefreshFilesMessage>(this, message =>
            {
                DispatcherHelper.RunAsync(RefreshFiles);
            });
        }
コード例 #21
0
 public FileManager(IGoogleDriveService googleDriveService)
 {
     GoogleDriveService = googleDriveService;
 }
コード例 #22
0
 public Uploader(IGoogleDriveService googleDriveService)
 {
     GoogleDriveService = googleDriveService;
 }
コード例 #23
0
 public void Initialize(IGoogleDriveService gService)
 {
     _gService              = gService;
     _gService.FileCreated += HandleGoogleDriveFileCreated;
 }
コード例 #24
0
 public MemoryOptionsController(IMemoryOptionService service, IGoogleDriveService driveService)
 {
     _service      = service;
     _driveService = driveService;
 }
コード例 #25
0
 public GoogleDriveRestfulService2(IConfigurationRetriever configurationRetriever, IGoogleAuthService googleAuthService, IGoogleDriveService googleDriveService)
 {
     _configurationRetriever = configurationRetriever;
     _googleAuthService      = googleAuthService;
     _googleDriveService     = googleDriveService;
 }
コード例 #26
0
 public void Initialize(IGoogleDriveService gService)
 {
     _gService = gService;
 }
コード例 #27
0
 public ImpDrive(IGoogleDriveService googleDriveOperation)
 {
     _googleDriveOperation = googleDriveOperation;
 }
コード例 #28
0
ファイル: Uploader.cs プロジェクト: Usurer/GDriveBackupClient
 public Uploader(IGoogleDriveService googleDriveService)
 {
     GoogleDriveService = googleDriveService;
 }
コード例 #29
0
 public MotherboardsController(IMotherboardService service, IGoogleDriveService driveService)
 {
     _service      = service;
     _driveService = driveService;
 }
コード例 #30
0
 public ProposalService(OfferMakerDbContext db, IGoogleDriveService googleDriveService)
 {
     this.db = db;
     this.googleDriveService = googleDriveService;
 }
コード例 #31
0
ファイル: Reader.cs プロジェクト: Usurer/GDriveBackupClient
 public Reader(IGoogleDriveService googleDriveService)
 {
     GoogleDriveService = googleDriveService;
 }
コード例 #32
0
        public ViewFileViewModel(IMainModel mainModel, IGoogleDriveService googleDriveService, IMessageBoxService messageBoxService, ISystemTrayService systemTrayService, IMediaLibraryService mediaLibraryService)
        {
            _mainModel = mainModel;
            _googleDriveService = googleDriveService;
            _messageBoxService = messageBoxService;
            _systemTrayService = systemTrayService;
            _mediaLibraryService = mediaLibraryService;

            DownloadFileCommand = new RelayCommand(DownloadFile, () => !IsBusy && CanDownload);

            BackKeyPressCommand = new RelayCommand<CancelEventArgs>(e =>
            {
                AbortCurrentCall(false);
            });
        }
コード例 #33
0
 public GoogleDriveRestfulService2(IConfigurationRetriever configurationRetriever, IGoogleAuthService googleAuthService, IGoogleDriveService googleDriveService)
 {
     _configurationRetriever = configurationRetriever;
     _googleAuthService = googleAuthService;
     _googleDriveService = googleDriveService;
 }
コード例 #34
0
        public Query(IGoogleDriveService googleDriveService, IDriveImportRepository driveImportRepository)
        {
            Name = "Query";

            FieldAsync <BooleanGraphType>(
                "haveToken",
                resolve: async context =>
            {
                Token token = await googleDriveService.GetGoogleToken();
                return(token != null && !string.IsNullOrEmpty(token.RefreshToken));
            }
                );

            /// query Reviews($searchTerm: String, $from: Int, $to: Int, $orderBy: String, $status: Boolean)
            FieldAsync <StringGraphType>(
                "getOwnerEmail",
                arguments: new QueryArguments(
                    new QueryArgument <StringGraphType> {
                Name = "accountName", Description = "Account Name"
            }
                    ),
                resolve: async context =>
            {
                string email       = string.Empty;
                string accountName = context.GetArgument <string>("accountName");
                Token token        = await googleDriveService.GetGoogleToken();
                if (token != null)
                {
                    string newFolderId  = string.Empty;
                    FolderIds folderIds = await driveImportRepository.LoadFolderIds(accountName);
                    if (folderIds != null)
                    {
                        newFolderId = folderIds.NewFolderId;
                    }
                    else
                    {
                        newFolderId = await googleDriveService.FindNewFolderId(accountName);
                    }

                    ListFilesResponse listFilesResponse = await googleDriveService.ListFiles();
                    if (listFilesResponse != null)
                    {
                        var owners = listFilesResponse.Files.Where(f => f.Id.Equals(newFolderId)).Select(o => o.Owners.Distinct()).FirstOrDefault();
                        if (owners != null)
                        {
                            email = owners.Select(o => o.EmailAddress).FirstOrDefault();
                        }
                        else
                        {
                            newFolderId = await googleDriveService.FindNewFolderId(accountName);
                            owners      = listFilesResponse.Files.Where(f => f.Id.Equals(newFolderId)).Select(o => o.Owners.Distinct()).FirstOrDefault();
                            if (owners != null)
                            {
                                email = owners.Select(o => o.EmailAddress).FirstOrDefault();
                            }
                        }
                    }
                }

                return(email);
            }
                );

            FieldAsync <StringGraphType>(
                "sheetLink",
                resolve: async context =>
            {
                return(await googleDriveService.GetSheetLink());
            }
                );
        }
コード例 #35
0
 public Reader(IGoogleDriveService googleDriveService)
 {
     GoogleDriveService = googleDriveService;
 }
コード例 #36
0
 public ImagesController(IJustMeetDbContext data, IGoogleDriveService drive)
 {
     this.data = data;
     this.drive = drive;
 }
コード例 #37
0
 public GpusController(IGpuService service, IGoogleDriveService driveService)
 {
     _service      = service;
     _driveService = driveService;
 }
コード例 #38
0
 public GoogleDriveController(IGoogleDriveService service, ILog log)
 {
     _service = service;
     _log     = log;
 }
コード例 #39
0
 public DrawStore(IGoogleDriveService driveService)
 {
     _service = driveService;
 }
コード例 #40
0
 public FileManager(IGoogleDriveService googleDriveService)
 {
     GoogleDriveService = googleDriveService;
 }