protected override IEnumerable <IChangeInstruction> GetReplacementInstructions(XmlElement replacementsNode)
        {
            foreach (var replacementNode in replacementsNode.OfType <XmlElement>())
            {
                var bestMatch = GetMatch(replacementNode);

                if (bestMatch != null)
                {
                    var instruction = new TextChangeInstruction("$({0})".FormatWith(replacementNode.Name),
                                                                _history.ReplaceFromHistory(bestMatch.Value));
                    _history.AddInstruction(instruction);
                    yield return(instruction);
                }
            }
        }
예제 #2
0
 public StringReplaceTextFileChanger(TextChangeInstruction instruction)
 {
     _instruction = instruction;
 }
 public void AddInstruction(TextChangeInstruction instruction)
 {
     _history.Add(instruction);
 }