Example #1
0
        /// <summary>
        /// Updates test data inside a storage.
        ///   Overwrite existing entries
        /// </summary>
        /// <param name="sourceClient">
        /// The source client.
        /// </param>
        /// <param name="targetClient">
        /// The target client.
        /// </param>
        /// <param name="baseliClient">
        /// The baseline client.
        /// </param>
        /// <param name="sourceStorePath">
        /// The source storage path.
        /// </param>
        /// <param name="targetStorePath">
        /// The target storage path.
        /// </param>
        /// <param name="baselineStorePath">
        /// The baseline storage path.
        /// </param>
        /// <param name="commandParameter">
        /// The command parameter.
        /// </param>
        /// <returns>
        /// True if the response from the <see cref="SyncComponent.UiProvider"/> is "continue"
        /// </returns>
        public bool ExecuteCommand(
            IClientBase sourceClient,
            IClientBase targetClient,
            IClientBase baseliClient,
            string sourceStorePath,
            string targetStorePath,
            string baselineStorePath,
            string commandParameter)
        {
            if (targetClient == null)
            {
                throw new InvalidOperationException("item.targetClient is null");
            }

            if (sourceClient == null)
            {
                throw new InvalidOperationException("item.sourceClient is null");
            }

            // delete existing elements
            targetClient.DeleteElements(targetClient.GetAll(targetStorePath), targetStorePath);

            var contacts = Contacts.GetStandardContactList(true);

            contacts.AddRange(Contacts.VariableContactList);

            targetClient.AddRange(contacts.ToStdElements(), targetStorePath);

            return(true);
        }
Example #2
0
        /// <summary>
        /// This command deletes files specified by one or more path pattern separated by a line break.
        ///   Deletes files from a folder using a search pattern. Use "*" as a place holder for any
        ///   number of any chars; use "?" as a placeholder for a single char.
        /// </summary>
        /// <param name="sourceClient">The source client - will delete "all elements" if this parameter is NULL.</param>
        /// <param name="targetClient">The target client - must not be null.</param>
        /// <param name="baseliClient">The baseline client - can be null, because there is no interaction with the baseline in this command.</param>
        /// <param name="sourceStorePath">The source storage path - the elements found in this path will be deleted.</param>
        /// <param name="targetStorePath">The target storage path - the deletion will take place in this path.</param>
        /// <param name="baselineStorePath">The baseline storage path - can be null, because there is no interaction with the baseline in this command.</param>
        /// <param name="commandParameter">The command parameter - can be null, because there is no parameter for this command.</param>
        /// <returns>True if the response from the <see cref="SyncComponent.UiProvider"/> is "continue".</returns>
        public bool ExecuteCommand(
            IClientBase sourceClient,
            IClientBase targetClient,
            IClientBase baseliClient,
            string sourceStorePath,
            string targetStorePath,
            string baselineStorePath,
            string commandParameter)
        {
            Bouncer.ForCheckData(() => targetClient).Assert(new IsNotNullRule <IClientBase>());

            targetClient.DeleteElements(
                sourceClient != null
                ? sourceClient.GetAll(sourceStorePath)
                : null,
                targetStorePath);

            this.LogProcessingEvent("elements deleted from storage path {0}", targetStorePath);
            return(true);
        }