CodeKicker.BBCode.SyntaxTree.TagNode.ReplaceAttribute C# (CSharp) Метод

ReplaceAttribute() статический приватный Метод

static private ReplaceAttribute ( string output, BBAttribute attribute, string rawValue, string placeholderStr, string>.Dictionary attrValuesByID ) : string
output string
attribute BBAttribute
rawValue string
placeholderStr string
attrValuesByID string>.Dictionary
Результат string
        static string ReplaceAttribute(string output, BBAttribute attribute, string rawValue, string placeholderStr, Dictionary<string, string> attrValuesByID)
        {
            string effectiveValue;
            if (attribute.ContentTransformer == null)
            {
                effectiveValue = rawValue;
            }
            else
            {
                var ctx = new AttributeRenderingContextImpl(attribute, rawValue, attrValuesByID);
                effectiveValue = attribute.ContentTransformer(ctx);
            }

            if (effectiveValue == null) effectiveValue = "";

            var encodedValue =
                attribute.HtmlEncodingMode == HtmlEncodingMode.HtmlAttributeEncode ? HttpUtility.HtmlAttributeEncode(effectiveValue)
                    : attribute.HtmlEncodingMode == HtmlEncodingMode.HtmlEncode ? HttpUtility.HtmlEncode(effectiveValue)
                          : effectiveValue;
            output = output.Replace(placeholderStr, encodedValue);
            return output;
        }