public IEnumerable <uSyncAction> Import(uSyncOptions options)
        {
            var hubClient     = new HubClientService(options.ClientId);
            var summaryClient = new SummaryHandler(hubClient);

            return(uSyncService.Import(settings.RootFolder, options.Force, summaryClient.PostSummary, summaryClient.PostUdate));
        }
        public uSyncWarningMessage GetSyncWarnings(string action, uSyncOptions options)
        {
            var handlers = handlerFactory.GetValidHandlers(new SyncHandlerOptions
            {
                Group = options.Group
            });

            var message = new uSyncWarningMessage();

            if (this.settings.ShowVersionCheckWarning && !uSyncService.CheckVersionFile(this.settings.RootFolder))
            {
                message.Type    = "info";
                message.Message = Services.TextService.Localize("usync", "oldformat");
                return(message);
            }

            var createOnly = handlers
                             .Select(x => x.Handler)
                             .Any(h => h.DefaultConfig.GetSetting(uSyncConstants.DefaultSettings.CreateOnly, false));

            if (createOnly)
            {
                message.Type    = "warning";
                message.Message = Services.TextService.Localize("usync", "createWarning");
                return(message);
            }


            return(message);
        }
Beispiel #3
0
        public IEnumerable <uSyncAction> Report(uSyncOptions options)
        {
            var hubClient = new HubClientService(options.ClientId);

            return(uSyncService.Report(settings.RootFolder, new SyncHandlerOptions()
            {
                Group = options.Group
            },
                                       hubClient.Callbacks()));
        }
 public IEnumerable <SyncHandlerView> GetActionHandlers(HandlerActions action, uSyncOptions options)
 => handlerFactory.GetValidHandlers(new SyncHandlerOptions
 {
     Group  = options.Group,
     Action = action
 }).Select(x => new SyncHandlerView
 {
     Enabled = x.Handler.Enabled,
     Alias   = x.Handler.Alias,
     Name    = x.Handler.Name,
     Icon    = x.Handler.Icon,
     Group   = x.Handler.Group
 });