CalDavSynchronizer.ProfileExportProcessor.PrepareForExport C# (CSharp) Method

PrepareForExport() public method

public PrepareForExport ( CalDavSynchronizer.Contracts.Options profiles, Action logger ) : void
profiles CalDavSynchronizer.Contracts.Options
logger Action
return void
    public void PrepareForExport(Options[] profiles, Action<string> logger)
    {
      logger("Processing profiles.");

      foreach (var profile in profiles)
      {
        logger($"'{profile.Name}'");
        try
        {
          using (var outlookFolderWrapper = GenericComObjectWrapper.Create((Folder) _session.GetFolderFromID(profile.OutlookFolderEntryId, profile.OutlookFolderStoreId)))
          {
            profile.OutlookFolderEntryId = outlookFolderWrapper.Inner.Name;
          }
        }
        catch (System.Exception)
        {
          logger ($"WARNING profile '{profile.Name}', references an outlook folder that doesn't exist.");
          profile.OutlookFolderEntryId = "<ERROR>";
        }
        profile.OutlookFolderStoreId = null;
      }

      logger ("Processing profiles done.");
    }