private HandlerConfigPair LoadHandlerConfig(ISyncHandler handler, uSyncHandlerSetSettings setSettings)
 {
     return(new HandlerConfigPair
     {
         Handler = handler,
         Settings = setSettings.GetHandlerSettings(handler.Alias)
     });
 }
        private bool IsValidGroup(string group, ISyncHandler handler)
        {
            // empty means all
            if (string.IsNullOrWhiteSpace(group))
            {
                return(true);
            }

            if (handler is ISyncExtendedHandler extendedHandler)
            {
                return(extendedHandler.Group.InvariantEquals(group));
            }

            return(false);
        }
Exemple #3
0
 public AppsService(
     AuthDbContext authDbContext,
     IDataProtectionProvider dataProtectionProvider,
     SecureRandom secureRandom,
     ConfigurationProvider configurationProvider,
     MemoryPopulator memoryPopulator,
     ISyncHandler syncHandler
     )
 {
     _authDbContext             = authDbContext;
     _ldapSettingsDataProtector = dataProtectionProvider.CreateProtector("LdapSettingsDataProtector");
     _secureRandom          = secureRandom;
     _configurationProvider = configurationProvider;
     _memoryPopulator       = memoryPopulator;
     _syncHandler           = syncHandler;
 }
        private bool IsValidGroup(string group, ISyncHandler handler, HandlerSettings settings)
        {
            // empty means all
            if (string.IsNullOrWhiteSpace(group))
            {
                return(true);
            }

            // group over written in settings.
            if (!string.IsNullOrWhiteSpace(settings.Group))
            {
                return(settings.Group.InvariantEquals(group));
            }

            if (handler is ISyncExtendedHandler extendedHandler)
            {
                return(extendedHandler.Group.InvariantEquals(group));
            }

            return(false);
        }
 /// <summary>
 /// generate a new uSyncExportingItemNotification object
 /// </summary>
 public uSyncExportingItemNotification(TObject item, ISyncHandler syncHandler)
     : base(item, syncHandler)
 {
 }
Exemple #6
0
 /// <summary>
 /// Construct a new cancelable event of type item for a specific handler
 /// </summary>
 public CancelableuSyncItemNotification(TObject item, ISyncHandler handler)
     : base(item, handler)
 {
 }
 /// <summary>
 ///  gets the phyical folder for a handler. ( root + handlerfolder)
 /// </summary>
 private string GetHandlerFolder(string rootFolder, ISyncHandler handler)
 => Path.Combine(rootFolder, handler.DefaultFolder);
Exemple #8
0
 /// <summary>
 ///  generate a new uSyncImportingItemNotification object
 /// </summary>
 public uSyncImportingItemNotification(XElement item, ISyncHandler handler)
     : base(item, handler)
 {
 }
 /// <inheritdoc/>
 public uSyncItemNotification(TObject item, ISyncHandler handler)
     : this(item)
 {
     this.Handler = handler;
 }