/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }