CreateProxyOptions() public method

public CreateProxyOptions ( ) : ProxyOptions
return CalDavSynchronizer.Contracts.ProxyOptions
Ejemplo n.º 1
0
 public IWebDavClient CreateWebDavClient()
 {
     return(SynchronizerFactory.CreateWebDavClient(
                _serverSettingsViewModel.UserName,
                _serverSettingsViewModel.UseAccountPassword ? _outlookAccountPasswordProvider.GetPassword(_outlookFolderViewModel.FolderAccountName) : _serverSettingsViewModel.Password,
                _serverSettingsViewModel.CalenderUrl,
                TimeSpan.Parse(ConfigurationManager.AppSettings["calDavConnectTimeout"]),
                _serverSettingsViewModel.ServerAdapterType,
                _networkSettingsViewModel.CloseConnectionAfterEachRequest,
                _networkSettingsViewModel.PreemptiveAuthentication,
                _networkSettingsViewModel.ForceBasicAuthentication,
                _networkSettingsViewModel.CreateProxyOptions()));
 }
 public IWebDavClient CreateWebDavClient(Uri url)
 {
     return(SynchronizerFactory.CreateWebDavClient(
                _serverSettingsViewModel.UserName,
                _serverSettingsViewModel.UseAccountPassword ? _outlookAccountPasswordProvider.GetPassword(_outlookFolderViewModel.FolderAccountName) : _serverSettingsViewModel.Password,
                url.ToString(),
                TimeSpan.Parse(ConfigurationManager.AppSettings["calDavConnectTimeout"]),
                _serverSettingsViewModel.ServerAdapterType,
                _networkSettingsViewModel.CloseConnectionAfterEachRequest,
                _networkSettingsViewModel.PreemptiveAuthentication,
                _networkSettingsViewModel.ForceBasicAuthentication,
                _networkSettingsViewModel.CreateProxyOptions(),
                _generalOptions.AcceptInvalidCharsInServerResponse));
 }
 private IWebDavClient CreateWebDavClient (NetworkSettingsViewModel networkSettings, GeneralOptions generalOptions, string davUrl)
 {
   return SynchronizerFactory.CreateWebDavClient (
       UserName,
       UseAccountPassword ? _outlookAccountPasswordProvider.GetPassword (null) : Password,
       davUrl,
       generalOptions.CalDavConnectTimeout,
       ServerAdapterType.WebDavHttpClientBased,
       networkSettings.CloseConnectionAfterEachRequest,
       networkSettings.PreemptiveAuthentication,
       networkSettings.ForceBasicAuthentication,
       networkSettings.CreateProxyOptions (),
       generalOptions.EnableClientCertificate,
       generalOptions.AcceptInvalidCharsInServerResponse);
 }
 private IWebDavClient CreateWebDavClient (NetworkSettingsViewModel networkSettings, GeneralOptions generalOptions)
 {
   return SynchronizerFactory.CreateWebDavClient (
       EmailAddress,
       SecureStringUtility.ToSecureString (string.Empty),
       CalenderUrl,
       generalOptions.CalDavConnectTimeout,
       ServerAdapterType.WebDavHttpClientBasedWithGoogleOAuth,
       networkSettings.CloseConnectionAfterEachRequest,
       networkSettings.PreemptiveAuthentication,
       networkSettings.ForceBasicAuthentication,
       networkSettings.CreateProxyOptions(),
       false,
       generalOptions.AcceptInvalidCharsInServerResponse);
 }
    public async Task<ServerResources> GetServerResources (NetworkSettingsViewModel networkSettings, GeneralOptions generalOptions)
    {
      var trimmedUrl = CalenderUrl.Trim();
      var url = new Uri (trimmedUrl.EndsWith ("/") ? trimmedUrl : trimmedUrl + "/");

      var webDavClient = CreateWebDavClient (networkSettings, generalOptions);
      var calDavDataAccess = new CalDavDataAccess (url, webDavClient);
      var foundResources = await calDavDataAccess.GetUserResourcesNoThrow (false);

      var foundAddressBooks = new[] { new AddressBookData (new Uri ("googleApi://defaultAddressBook"), "Default AddressBook") };

      var service = await GoogleHttpClientFactory.LoginToGoogleTasksService (EmailAddress, SynchronizerFactory.CreateProxy (networkSettings.CreateProxyOptions()));
      var taskLists = await service.Tasklists.List().ExecuteAsync();
      var taskListsData = taskLists?.Items.Select (i => new TaskListData (i.Id, i.Title)).ToArray() ?? new TaskListData[] { };

      return new ServerResources (foundResources.CalendarResources, foundAddressBooks, taskListsData);
    }