Example #1
0
 /// <summary>
 /// Put logic handling special characters here (such as ':' in an action or '.' in a tag).
 /// Adds the character to this tag as well as any open child rags recursively, for text replacement.
 /// </summary>
 /// <param name="ch">Character to add.</param>
 /// <param name="escaped">Whether character is escaped (always add to Raw).</param>
 public void AddChar(char ch, bool escaped = false)
 {
     // If this token is closed, add nothing.
     if (IsResolved)
     {
         return;
     }
     // String also needs to be added to parent string for replacement,
     // but only literally (treat as escaped).
     if (Parent != null)
     {
         Parent.AddChar(ch, true);
     }
     if (escaped)
     {
         Raw += ch;
         return;
     }
     AddCharInner(ch);
 }