Exemplo n.º 1
0
        public GoogleSlides(IGetValue valueRetrieval, IFileAndFolderPathsCreator fileAndFolderPathsCreator)
        {
            _fileAndFolderPathsCreator = fileAndFolderPathsCreator;
            _folderForSongs            = valueRetrieval.Get(KeyConfig.FolderForSongs);
            _folderForPptx             = valueRetrieval.Get(KeyConfig.FolderForPptx);
            _folderForZip         = valueRetrieval.Get(KeyConfig.FolderForZip);
            _presentationTemplate = valueRetrieval.Get(KeyConfig.PresentationTemplate);

            var clientSecrets = new ClientSecrets()
            {
                ClientId     = valueRetrieval.Get(KeyConfig.GoogleApiClient),
                ClientSecret = valueRetrieval.Get(KeyConfig.GoogleApiSecret)
            };

            var credPath = valueRetrieval.Get(KeyConfig.GoogleApiToken);

            var credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                clientSecrets,
                new[] { DriveService.Scope.Drive, SlidesService.Scope.Presentations },
                "user",
                CancellationToken.None,
                new FileDataStore(credPath, true)).Result;

            _driveService = new DriveService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credential
            });
        }
Exemplo n.º 2
0
 public PresentationController(ISongRepository songRepository,
                               IConvertPresentation pptxToZipConverter, IMerge powerPointMerger,
                               IFileAndFolderPathsCreator fileAndFolderPath, IPresentationRepository presentationRepository,
                               IGetValue valueRetrieval, IGoogleSlides googleSlides)
 {
     _powerPointMerger       = powerPointMerger;
     _songRepository         = songRepository;
     _pptxToZipConverter     = pptxToZipConverter;
     _fileAndFolderPath      = fileAndFolderPath;
     _presentationRepository = presentationRepository;
     _valueRetrieval         = valueRetrieval;
     _googleSlides           = googleSlides;
 }
Exemplo n.º 3
0
 public PptxToZipConverter(IFileAndFolderPathsCreator fileAndFolderPath, IGetValue valueRetrieval)
 {
     _fileAndFolderPath = fileAndFolderPath;
     _baseUri           = new Uri(valueRetrieval.Get(KeyConfig.ZamzarUrl));
     _apiKey            = valueRetrieval.Get(KeyConfig.ZamzarKey);
 }
Exemplo n.º 4
0
 public PowerPointMerger(IFileAndFolderPathsCreator fileAndFolderPath)
 {
     _fileAndFolderPath = fileAndFolderPath;
 }