Пример #1
0
 /// <summary>
 /// Add another text preprocessings.
 /// </summary>
 /// <param name="textProcessing">Another text preprocessing.</param>
 public virtual void AddTextProcessing(ITextProcessing textProcessing)
 {
     if (textProcessing == null)
     {
         return;
     }
     TextProcessings.Add(textProcessing);
 }
        public void AddTextProcessing_when_add_null_processing(ITextProcessing textProcessing)
        {
            var inputText          = "Test input text.";
            var baseTextProcessing = new BaseTextProcessing();

            baseTextProcessing.AddTextProcessing(textProcessing);
            var actualText = baseTextProcessing.Process(inputText);

            Assert.AreEqual(inputText, actualText);
        }
        protected void UpdateOptionsView(ITextProcessing processing)
        {
            vboxOptions.Clear();
            foreach (var option in processing.Options)
            {
                var chkOption = new CheckBox(option.Key);
                chkOption.Active   = processing.Options [option.Key];
                chkOption.Clicked += (sender, e) => {
                    processing.Options [option.Key] = ((CheckBox)sender).Active;
                };

                vboxOptions.PackStart(chkOption, false, true);
            }
        }
Пример #4
0
        public string Serialize(ITextProcessing textProcessing)
        {
            var serializer = new SerializerBuilder()
                             .WithNamingConvention(HyphenatedNamingConvention.Instance)
                             //.EnsureRoundtrip ()
                             .WithTagMapping("tag:yaml.org,2002:if-option", typeof(IfOptionCommand))
                             .WithTagMapping("tag:yaml.org,2002:regex-replace", typeof(RegexReplaceCommand))
                             .WithTagMapping("tag:yaml.org,2002:regex-to-lower", typeof(RegexToLowerCommand))
                             .WithTagMapping("tag:yaml.org,2002:replace-entities-with-chars", typeof(ReplaceEntitiesWithCharsCommand))
                             .WithTagMapping("tag:yaml.org,2002:replace", typeof(ReplaceCommand))
                             .WithTagMapping("tag:yaml.org,2002:trim", typeof(TrimCommand))
                             .WithTagMapping("tag:yaml.org,2002:append", typeof(AppendCommand))
                             .WithTagMapping("tag:yaml.org,2002:prepend", typeof(PrependCommand))
                             .WithTagMapping("tag:yaml.org,2002:exit", typeof(ExitCommand))
                             .Build();

            return(serializer.Serialize(textProcessing));
        }
 public ReceiptManager(ITextProcessing textProcessing, DataContext dataContext)
 {
     _textProcessing = textProcessing;
     _dataContext    = dataContext;
 }
 public Converter(ITextProcessing textProcessing, IUpdater updater)
 {
     _textProcessing = textProcessing;
     _updater        = updater;
 }