Ejemplo n.º 1
0
        /// <summary>
        /// Adds a new replace rule that replaces with the result of the given callback.
        /// </summary>
        public ReplaceRule AddReplace(string inId, TryReplaceDelegate inReplace)
        {
            CheckLocked();

            ReplaceRule rule = FindOrCreateReplaceRule(inId);

            rule.TryReplaceWith(inReplace);
            return(rule);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Tags will be replaced with the result of the given string.
 /// </summary>
 public ReplaceRule ReplaceWith(ReplaceSourceContextDelegate inSourceContextDelegate)
 {
     m_ConstantText                 = null;
     m_ReplaceCallback              = null;
     m_ReplaceWithContextCallback   = null;
     m_ReplaceSourceContextCallback = inSourceContextDelegate;
     m_TryReplaceCallback           = null;
     return(this);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Tags will be replaced with the given string.
 /// </summary>
 public ReplaceRule ReplaceWith(string inText)
 {
     m_ConstantText                 = inText;
     m_ReplaceCallback              = null;
     m_ReplaceWithContextCallback   = null;
     m_ReplaceSourceContextCallback = null;
     m_TryReplaceCallback           = null;
     return(this);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Closing tags will be replaced with the result of the given string.
 /// </summary>
 public ReplaceRule CloseWith(ReplaceSourceContextDelegate inContextSourceDelegate)
 {
     m_ConstantClosingText                 = null;
     m_ReplaceClosingCallback              = null;
     m_ReplaceWithContextClosingCallback   = null;
     m_ReplaceSourceContextClosingCallback = inContextSourceDelegate;
     m_TryReplaceCallback = null;
     m_HandleClosing      = true;
     return(this);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Closing tags will be replaced with the given string.
 /// </summary>
 public ReplaceRule CloseWith(string inText)
 {
     m_ConstantClosingText                 = inText;
     m_ReplaceClosingCallback              = null;
     m_ReplaceWithContextClosingCallback   = null;
     m_ReplaceSourceContextClosingCallback = null;
     m_TryReplaceCallback = null;
     m_HandleClosing      = true;
     return(this);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Tags will be replaced using the given callback.
 /// </summary>
 public ReplaceRule TryReplaceWith(TryReplaceDelegate inTryReplace)
 {
     m_ConstantText                        = null;
     m_ConstantClosingText                 = null;
     m_ReplaceCallback                     = null;
     m_ReplaceClosingCallback              = null;
     m_ReplaceWithContextCallback          = null;
     m_ReplaceWithContextClosingCallback   = null;
     m_ReplaceSourceContextCallback        = null;
     m_ReplaceSourceContextClosingCallback = null;
     m_TryReplaceCallback                  = inTryReplace;
     m_HandleClosing                       = false;
     return(this);
 }