示例#1
0
        public static uSyncAction SetAction(SyncAttempt <T> attempt, string filename, bool requirePostProcessing = true)
        {
            var action = new uSyncAction(attempt.Success, attempt.Name, attempt.ItemType, attempt.Change, attempt.Message, attempt.Exception, filename, requirePostProcessing);

            if (attempt.Details != null && attempt.Details.Any())
            {
                action.Details = attempt.Details;
            }
            return(action);
        }
示例#2
0
        /// <summary>
        ///  Import a single item based on a uSyncAction item
        /// </summary>
        /// <remarks>
        ///  Importing a single item based on an action, the action will
        ///  detail what handler to use and the filename of the item to import
        /// </remarks>
        /// <param name="action">Action item, to use as basis for import</param>
        /// <returns>Action detailing change or not</returns>
        public uSyncAction ImportSingleAction(uSyncAction action)
        {
            var handlerConfig = handlerFactory.GetValidHandler(action.HandlerAlias);

            if (handlerConfig != null && handlerConfig.Handler is ISyncExtendedHandler extendedHandler)
            {
                extendedHandler.Import(action.FileName, handlerConfig.Settings, true);
            }

            return(new uSyncAction());
        }