예제 #1
0
        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="operation">The text operation to perform.</param>
        /// <param name="target">The specific text field to change as a breadcrumb path. Each value in the list represents a field to navigate into.</param>
        /// <param name="value">The value to append or prepend.</param>
        /// <param name="delimiter">If the target field already has a value, text to add between the previous and inserted values, if any.</param>
        public AppendOrPrependTextOperation(TextOperationType operation, ICollection <IManagedTokenString> target, IManagedTokenString value, string?delimiter)
            : base(operation, target)
        {
            this.Value     = value;
            this.Delimiter = delimiter ?? string.Empty;

            this.Contextuals.Add(value);
        }
예제 #2
0
        /*********
        ** Protected methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="operation">The text operation to perform.</param>
        /// <param name="target">The specific text field to change as a breadcrumb path. Each value in the list represents a field to navigate into.</param>
        protected BaseTextOperation(TextOperationType operation, ICollection <IManagedTokenString> target)
        {
            this.Operation = operation;
            this.Target    = target.ToArray <ITokenString>();

            this.Contextuals = new AggregateContextual()
                               .Add(target);
        }
        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="operation">The text operation to perform.</param>
        /// <param name="target">The specific text field to change as a breadcrumb path. Each value in the list represents a field to navigate into.</param>
        /// <param name="search">The value to remove from the text.</param>
        /// <param name="delimiter">The text between values in a delimited string.</param>
        /// <param name="replaceMode">Which delimited values should be removed.</param>
        public RemoveDelimitedTextOperation(TextOperationType operation, ICollection <IManagedTokenString> target, IManagedTokenString search, string delimiter, TextOperationReplaceMode replaceMode)
            : base(operation, target)
        {
            this.Search      = search;
            this.Delimiter   = delimiter;
            this.ReplaceMode = replaceMode;

            this.Contextuals.Add(search);
        }
예제 #4
0
        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="operation">The text operation to perform.</param>
        /// <param name="target">The specific text field to change as a breadcrumb path. Each value in the list represents a field to navigate into.</param>
        /// <param name="value">The value to append or prepend.</param>
        /// <param name="delimiter">If the target field already has a value, text to add between the previous and inserted values, if any.</param>
        public TextOperation(TextOperationType operation, IManagedTokenString[] target, IManagedTokenString value, string delimiter)
        {
            this.Operation = operation;
            this.Target    = target.Cast <ITokenString>().ToArray();
            this.Value     = value;
            this.Delimiter = delimiter;

            this.Contextuals = new AggregateContextual()
                               .Add(target)
                               .Add(value);
        }
예제 #5
0
        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="operation">The text operation to perform.</param>
        /// <param name="target">The specific text field to change as a breadcrumb path. Each value in the list represents a field to navigate into.</param>
        /// <param name="value">The value to append or prepend.</param>
        /// <param name="delimiter">If the target field already has a value, text to add between the previous and inserted values, if any.</param>
        public TextOperation(TextOperationType operation, ICollection <IManagedTokenString> target, IManagedTokenString value, string?delimiter)
        {
            this.Operation = operation;
            this.Target    = target.ToArray <ITokenString>();
            this.Value     = value;
            this.Delimiter = delimiter ?? string.Empty;

            this.Contextuals = new AggregateContextual()
                               .Add(target)
                               .Add(value);
        }