private async Task<Uri> DoAutoDiscovery (Uri autoDiscoveryUri, IWebDavClient webDavClient)
    {
      var calDavDataAccess = new CalDavDataAccess (autoDiscoveryUri, webDavClient);

      var foundCalendars = await calDavDataAccess.GetUserCalendars();

      if (foundCalendars.Count > 0)
      {
        using (ListCalendarsForm listCalendarsForm = new ListCalendarsForm (foundCalendars))
        {
          if (listCalendarsForm.ShowDialog() == DialogResult.OK)
          {
            return new Uri (autoDiscoveryUri.GetLeftPart (UriPartial.Authority) + listCalendarsForm.getCalendarUri());
          }
        }
      }
      else
      {
        MessageBox.Show ("No calendars were found via autodiscovery!", c_connectionTestCaption);
      }
      return null;
    }
    private async Task<AutoDiscoveryResult> DoAutoDiscovery (Uri autoDiscoveryUri, IWebDavClient webDavClient, bool useWellKnownUrl)
    {
      IReadOnlyList<Tuple<Uri, string>> foundResources;

      var calDavDataAccess = new CalDavDataAccess (autoDiscoveryUri, webDavClient);
      foundResources = await calDavDataAccess.GetUserCalendars (useWellKnownUrl);

      if (foundResources.Count > 0)
      {
        using (ListCalendarsForm listCalendarsForm = new ListCalendarsForm (foundResources))
        {
          if (listCalendarsForm.ShowDialog() == DialogResult.OK)
            return new AutoDiscoveryResult (new Uri (autoDiscoveryUri.GetLeftPart (UriPartial.Authority) + listCalendarsForm.getCalendarUri()), false);
          else
            return new AutoDiscoveryResult (null, true);
        }
      }
      else
      {
        MessageBox.Show ("No resources were found via autodiscovery!", c_connectionTestCaption);
      }
      return new AutoDiscoveryResult (null, false);
    }