Esempio n. 1
0
        public IHttpActionResult GetImageUrlForDropbox(int id)
        {
            var movie      = this.service.GetById(id);
            var dropboxUrl = new DropboxService().GetRedirectionUrl(movie.ImageUrl, movie.Title + "-wallpaper");

            return(this.Ok(dropboxUrl));
        }
Esempio n. 2
0
        private IStorageService GetService(StorageProvider provider, Guid token)
        {
            var service = default(IStorageService);

            switch (provider)
            {
            case StorageProvider.FTP:
                break;

            case StorageProvider.Dropbox:
                service = new DropboxService(token);
                break;

            case StorageProvider.GoogleDrive:
                break;

            case StorageProvider.SkyDrive:
                break;

            case StorageProvider.OneDrive:
                break;

            default:
                break;
            }
            return(service);
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the ViewModelLocator class.
        /// </summary>
        public ViewModelLocator()
        {
            _about = new AboutViewModel();

            if (ViewModelBase.IsInDesignModeStatic)
            {
                // Create design time services and viewmodels
                _applicationSettingsViewModel = new ApplicationSettingsViewModel(new ApplicationSettings(), null);
                _main  = new MainViewModel(null, null, null);
                _about = new AboutViewModel();
            }
            else
            {
                var settings = new ApplicationSettings();
                _dropBoxService = new DropboxService(settings);

                _applicationSettingsViewModel = new ApplicationSettingsViewModel(settings, _dropBoxService);

                Messenger.Default.Register <ApplicationSettingsChangedMessage>(this, asc => Initialize(asc.Settings));

                _dropBoxCredentials = new DropboxCredentialsViewModel(_dropBoxService);

                Initialize(settings);
            }
        }
Esempio n. 4
0
        public ConfigurationViewModel()
        {
            _dropboxService = GetProvider <DropboxService>();

            var config = _dropboxService.GetConfiguration <ConfigModel>();

            Accounts = new ObservableCollection <AccountModelBase>(config.Accounts);
        }
Esempio n. 5
0
        Uri FormatUri(DropboxService service, Uri baseUri, string format, string path)
        {
            var relUrl = format.Replace("{root}", service.Root).Replace("{path}", path);

            #pragma warning disable 612, 618
            return(new Uri(baseUri, Uri.EscapeDataString(relUrl), true));

            #pragma warning restore 612, 618
        }
		public ApplicationSettingsViewModel(ApplicationSettings settings, DropboxService dropBoxService)
        {
		    _settings = settings;
		    _dropBoxService = dropBoxService;

		    BroadcastSettingsChanged =
		        new RelayCommand(() => Messenger.Default.Send(new ApplicationSettingsChangedMessage(_settings)));
		    DisconnectCommand = new RelayCommand(Disconnect);
            ResetColorsCommand = new RelayCommand(ResetColors);
        }
        public ApplicationSettingsViewModel(ApplicationSettings settings, DropboxService dropBoxService)
        {
            _settings       = settings;
            _dropBoxService = dropBoxService;

            BroadcastSettingsChanged =
                new RelayCommand(() => Messenger.Default.Send(new ApplicationSettingsChangedMessage(_settings)));
            DisconnectCommand  = new RelayCommand(Disconnect);
            ResetColorsCommand = new RelayCommand(ResetColors);
        }
 public PaymentController(
     PaymentRepository repository,
     PaymentTypeRepository paymentTypeRepository,
     IMapper mapper,
     DropboxService dropboxService)
 {
     this._repository       = repository;
     _paymentTypeRepository = paymentTypeRepository;
     _mapper         = mapper;
     _dropboxService = dropboxService;
 }
		protected TaskFileService(DropboxService dropBoxService, ApplicationSettings settings)
		{
			_dropBoxService = dropBoxService;
			Settings = settings;

			_taskList.CollectionChanged += TaskListCollectionChanged;

			Messenger.Default.Register<ApplicationReadyMessage>(this, message => Start());
			Messenger.Default.Register<NeedCredentialsMessage>(this, message =>
				{
					if(LoadingState == TaskLoadingState.Syncing){LoadingState = TaskLoadingState.Ready;}
				});
		}
Esempio n. 10
0
        public void SetUp()
        {
            var bootstrapper = new IntegrationTestBootstrapper();
            var container    = bootstrapper.ConfigureContainer();

            _dropboxService             = new DropboxService();
            _dropboxService.AccessToken = DROPBOX_ACCESSTOKEN;

            _th = container.GetInstance <TestHelper>();
            _th.InitTempFolder(DROPBOX_FOLDER);
            _addedFiles    = new List <string>();
            _dropboxClient = new DropboxClient(DROPBOX_ACCESSTOKEN);
        }
		/// <summary>
		/// Initializes a new instance of the ApplicationSettingsViewModel class.
		/// </summary>
		public DropboxCredentialsViewModel(DropboxService dropBoxService)
		{
			if (IsInDesignMode)
			{
				// Code runs in Blend --> create design time data.
			}
			else
			{
				// Code runs "for real"
				_dropBoxService = dropBoxService;
				StartLoginProcessCommand = new RelayCommand(StartLoginProcess);
				Messenger.Default.Register<DropboxLoginSuccessfulMessage>(this, msg => _dropBoxService.GetAccessToken());
			}
		}
Esempio n. 12
0
        static void Main(string[] args)
        {
            //load up a google drive object
            var gDrive   = new GoogleDriveService();
            var dBox     = new DropboxService();
            var oneDrive = new OneDriveService();

            Console.WriteLine($"Found Google Drive Path: {gDrive.Directory}, Service Installed? {gDrive.IsServiceInstalled()}");
            Console.WriteLine($"Found Dropbox Path: {dBox.Directory}, Service Installed? {dBox.IsServiceInstalled()}");
            Console.WriteLine($"Found OneDrive Path: {oneDrive.Directory}, Service Installed? {oneDrive.IsServiceInstalled()}");

            //pause the console
            Console.ReadKey();
        }
 /// <summary>
 /// Initializes a new instance of the ApplicationSettingsViewModel class.
 /// </summary>
 public DropboxCredentialsViewModel(DropboxService dropBoxService)
 {
     if (IsInDesignMode)
     {
         // Code runs in Blend --> create design time data.
     }
     else
     {
         // Code runs "for real"
         _dropBoxService          = dropBoxService;
         StartLoginProcessCommand = new RelayCommand(StartLoginProcess);
         Messenger.Default.Register <DropboxLoginSuccessfulMessage>(this, msg => _dropBoxService.GetAccessToken(msg));
     }
 }
Esempio n. 14
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            service = new DropboxService();

            myButton        = FindViewById <Button>(Resource.Id.myButton);
            myButton.Click += Button_Click;
            button1         = FindViewById <Button>(Resource.Id.button1);
            button1.Click  += Button1_Click;
            button2         = FindViewById <Button>(Resource.Id.button2);
            button2.Click  += Button2_Click;
        }
Esempio n. 15
0
 public dropboxController()
 {
     _service = new DropboxService();
 }
 public ArchiveTaskFileService(DropboxService dropBoxService, ApplicationSettings settings)
     : base(dropBoxService, settings)
 {
 }
 public PrimaryTaskFileService(DropboxService dropBoxService, ApplicationSettings settings)
     : base(dropBoxService, settings)
 {
 }