public DropboxDestination(IDropboxConfiguration dropboxPluginConfiguration, IDropboxLanguage dropboxLanguage)
        {
            _dropboxPluginConfiguration = dropboxPluginConfiguration;
            _dropboxLanguage            = dropboxLanguage;

            _oAuth2Settings = new OAuth2Settings
            {
                AuthorizationUri = DropboxApiUri.
                                   AppendSegments("1", "oauth2", "authorize").
                                   ExtendQuery(new Dictionary <string, string>
                {
                    { "response_type", "code" },
                    { "client_id", "{ClientId}" },
                    { "redirect_uri", "{RedirectUrl}" },
                    { "state", "{State}" }
                }),
                TokenUrl         = DropboxApiUri.AppendSegments("1", "oauth2", "token"),
                CloudServiceName = "Dropbox",
                ClientId         = dropboxPluginConfiguration.ClientId,
                ClientSecret     = dropboxPluginConfiguration.ClientSecret,
                AuthorizeMode    = AuthorizeModes.LocalhostServer,
                RedirectUrl      = "http://localhost:47336",
                Token            = dropboxPluginConfiguration
            };
            _oAuthHttpBehaviour = OAuth2HttpBehaviourFactory.Create(_oAuth2Settings);
        }
Example #2
0
 public DropboxConfigViewModel(
     IDropboxConfiguration dropboxConfiguration,
     IDropboxLanguage dropboxLanguage,
     FileConfigPartViewModel fileConfigPartViewModel
     )
 {
     DropboxConfiguration    = dropboxConfiguration;
     DropboxLanguage         = dropboxLanguage;
     FileConfigPartViewModel = fileConfigPartViewModel;
 }
Example #3
0
        public DropboxDestination(
            IDropboxConfiguration dropboxPluginConfiguration,
            IDropboxLanguage dropboxLanguage,
            INetworkConfiguration networkConfiguration,
            IResourceProvider resourceProvider,
            ICoreConfiguration coreConfiguration,
            IGreenshotLanguage greenshotLanguage,
            Func <CancellationTokenSource, Owned <PleaseWaitForm> > pleaseWaitFormFactory
            ) : base(coreConfiguration, greenshotLanguage)
        {
            _dropboxPluginConfiguration = dropboxPluginConfiguration;
            _dropboxLanguage            = dropboxLanguage;
            _resourceProvider           = resourceProvider;
            _pleaseWaitFormFactory      = pleaseWaitFormFactory;

            _oAuth2Settings = new OAuth2Settings
            {
                AuthorizationUri = DropboxApiUri.
                                   AppendSegments("1", "oauth2", "authorize").
                                   ExtendQuery(new Dictionary <string, string>
                {
                    { "response_type", "code" },
                    { "client_id", "{ClientId}" },
                    { "redirect_uri", "{RedirectUrl}" },
                    { "state", "{State}" }
                }),
                TokenUrl         = DropboxApiUri.AppendSegments("1", "oauth2", "token"),
                CloudServiceName = "Dropbox",
                ClientId         = dropboxPluginConfiguration.ClientId,
                ClientSecret     = dropboxPluginConfiguration.ClientSecret,
                AuthorizeMode    = AuthorizeModes.LocalhostServer,
                RedirectUrl      = "http://localhost:47336",
                Token            = dropboxPluginConfiguration
            };
            var httpBehaviour = OAuth2HttpBehaviourFactory.Create(_oAuth2Settings);

            _oAuthHttpBehaviour = httpBehaviour;
            // Use the default network settings
            httpBehaviour.HttpSettings = networkConfiguration;
        }