diff --git a/FLocal.Common/BBCodes/AbstractLocalLink.cs b/FLocal.Common/BBCodes/AbstractLocalLink.cs index 36420f1..4dee507 100644 --- a/FLocal.Common/BBCodes/AbstractLocalLink.cs +++ b/FLocal.Common/BBCodes/AbstractLocalLink.cs @@ -16,7 +16,7 @@ namespace FLocal.Common.BBCodes { get; } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { var url = this.url; var name = this.Safe(url.title); if(this.Default != null) { diff --git a/FLocal.Common/BBCodes/B.cs b/FLocal.Common/BBCodes/B.cs index 0af8e1f..c161191 100644 --- a/FLocal.Common/BBCodes/B.cs +++ b/FLocal.Common/BBCodes/B.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("b") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { return "" + this.GetInnerHTML(context, formatter) + ""; } diff --git a/FLocal.Common/BBCodes/Code.cs b/FLocal.Common/BBCodes/Code.cs index 43aa8bb..0201128 100644 --- a/FLocal.Common/BBCodes/Code.cs +++ b/FLocal.Common/BBCodes/Code.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("code") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { return "
" + System.Web.HttpUtility.HtmlEncode(this.InnerBBCode) + "

"; } diff --git a/FLocal.Common/BBCodes/ECode.cs b/FLocal.Common/BBCodes/ECode.cs index 0e2bf95..f272f9c 100644 --- a/FLocal.Common/BBCodes/ECode.cs +++ b/FLocal.Common/BBCodes/ECode.cs @@ -11,8 +11,8 @@ namespace FLocal.Common.BBCodes { : base("ecode") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { - return this.GetInnerHTML(context, new BBCodeHtmlFormatter()); + public override string Format(IPostParsingContext context, ITextFormatter formatter) { + return this.GetInnerHTML(context, new BBCodeHtmlFormatter()); } } diff --git a/FLocal.Common/BBCodes/FUrl.cs b/FLocal.Common/BBCodes/FUrl.cs index d96fe59..6404204 100644 --- a/FLocal.Common/BBCodes/FUrl.cs +++ b/FLocal.Common/BBCodes/FUrl.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("furl") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { string rawUrl = this.DefaultOrValue; string title = null; if(rawUrl.ToLower() != this.InnerText.ToLower()) { diff --git a/FLocal.Common/BBCodes/Font.cs b/FLocal.Common/BBCodes/Font.cs index 31336d0..6540a6b 100644 --- a/FLocal.Common/BBCodes/Font.cs +++ b/FLocal.Common/BBCodes/Font.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("font") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { return "" + this.GetInnerHTML(context, formatter) + ""; } diff --git a/FLocal.Common/BBCodes/FontColor.cs b/FLocal.Common/BBCodes/FontColor.cs index 7d11d08..013a69f 100644 --- a/FLocal.Common/BBCodes/FontColor.cs +++ b/FLocal.Common/BBCodes/FontColor.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("color") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { return "" + this.GetInnerHTML(context, formatter) + ""; } diff --git a/FLocal.Common/BBCodes/FontSize.cs b/FLocal.Common/BBCodes/FontSize.cs index 498b023..3a22f77 100644 --- a/FLocal.Common/BBCodes/FontSize.cs +++ b/FLocal.Common/BBCodes/FontSize.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("size") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { return "" + this.GetInnerHTML(context, formatter) + ""; } diff --git a/FLocal.Common/BBCodes/Google.cs b/FLocal.Common/BBCodes/Google.cs index 65fc817..4181145 100644 --- a/FLocal.Common/BBCodes/Google.cs +++ b/FLocal.Common/BBCodes/Google.cs @@ -12,7 +12,7 @@ namespace FLocal.Common.BBCodes { : base("google") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { return "g:" + this.GetInnerHTML(context, formatter) + ""; } diff --git a/FLocal.Common/BBCodes/I.cs b/FLocal.Common/BBCodes/I.cs index 1c3a422..3c01ec3 100644 --- a/FLocal.Common/BBCodes/I.cs +++ b/FLocal.Common/BBCodes/I.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("i") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { return "" + this.GetInnerHTML(context, formatter) + ""; } diff --git a/FLocal.Common/BBCodes/Image.cs b/FLocal.Common/BBCodes/Image.cs index b7ddea5..84afe24 100644 --- a/FLocal.Common/BBCodes/Image.cs +++ b/FLocal.Common/BBCodes/Image.cs @@ -10,7 +10,7 @@ namespace FLocal.Common.BBCodes { public Image() : base("image") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { var urlInfo = UrlProcessor.Process(this.InnerText); if (urlInfo.isLocal && urlInfo.relativeUrl.StartsWith("/user/upload/")) { return "" + urlInfo.relativeUrl + "" + urlInfo.relativeUrl + ""; diff --git a/FLocal.Common/BBCodes/List.cs b/FLocal.Common/BBCodes/List.cs index 33c2dad..3ecec22 100644 --- a/FLocal.Common/BBCodes/List.cs +++ b/FLocal.Common/BBCodes/List.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("list") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { return "
    " + this.GetInnerHTML(context, formatter) + "
"; } diff --git a/FLocal.Common/BBCodes/ListElem.cs b/FLocal.Common/BBCodes/ListElem.cs index f0558a8..2ca38c9 100644 --- a/FLocal.Common/BBCodes/ListElem.cs +++ b/FLocal.Common/BBCodes/ListElem.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("*") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { // return "
  • " + this.GetInnerHTML(formatter) + "
  • "; return "
  • "; } diff --git a/FLocal.Common/BBCodes/Lurk.cs b/FLocal.Common/BBCodes/Lurk.cs index 94014db..0f5ad47 100644 --- a/FLocal.Common/BBCodes/Lurk.cs +++ b/FLocal.Common/BBCodes/Lurk.cs @@ -12,7 +12,7 @@ namespace FLocal.Common.BBCodes { : base("lurk") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { return "l:" + this.GetInnerHTML(context, formatter) + ""; } diff --git a/FLocal.Common/BBCodes/Math.cs b/FLocal.Common/BBCodes/Math.cs index a87ccea..b66ae81 100644 --- a/FLocal.Common/BBCodes/Math.cs +++ b/FLocal.Common/BBCodes/Math.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("math") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { string tex = "$$" + this.InnerBBCode + "$$"; var upload = helpers.TexProcessor.getCompiled(tex); return "/Upload/Item/" + upload.id.ToString() + "/" + this.Safe(tex) + ""; diff --git a/FLocal.Common/BBCodes/Quote.cs b/FLocal.Common/BBCodes/Quote.cs index 4edd138..2ec759b 100644 --- a/FLocal.Common/BBCodes/Quote.cs +++ b/FLocal.Common/BBCodes/Quote.cs @@ -12,7 +12,7 @@ namespace FLocal.Common.BBCodes { : base("quote") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { string inner = this.GetInnerHTML(context, formatter).TrimHtml(); if(inner == "") return ""; string marker = this.Default; diff --git a/FLocal.Common/BBCodes/QuoteSkipper.cs b/FLocal.Common/BBCodes/QuoteSkipper.cs index 9666396..a44cd58 100644 --- a/FLocal.Common/BBCodes/QuoteSkipper.cs +++ b/FLocal.Common/BBCodes/QuoteSkipper.cs @@ -10,7 +10,7 @@ namespace FLocal.Common.BBCodes { public QuoteSkipper() : base("quoteskipper") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { if(this.Name.ToLower() == "q" || this.Name.ToLower() == "quote") { return ""; } else if(this.Name.ToLower() == "code") { diff --git a/FLocal.Common/BBCodes/RuWiki.cs b/FLocal.Common/BBCodes/RuWiki.cs index bbd6ae9..ffa2206 100644 --- a/FLocal.Common/BBCodes/RuWiki.cs +++ b/FLocal.Common/BBCodes/RuWiki.cs @@ -12,7 +12,7 @@ namespace FLocal.Common.BBCodes { : base("ruwiki") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { return "в:" + this.GetInnerHTML(context, formatter) + ""; } diff --git a/FLocal.Common/BBCodes/S.cs b/FLocal.Common/BBCodes/S.cs index 6753de1..229c9cd 100644 --- a/FLocal.Common/BBCodes/S.cs +++ b/FLocal.Common/BBCodes/S.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("s") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { return "" + this.GetInnerHTML(context, formatter) + ""; } diff --git a/FLocal.Common/BBCodes/Spoiler.cs b/FLocal.Common/BBCodes/Spoiler.cs index 67b1afa..ab4850b 100644 --- a/FLocal.Common/BBCodes/Spoiler.cs +++ b/FLocal.Common/BBCodes/Spoiler.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("spoiler") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { string marker = this.Default; if(marker == null) marker = "Spoiler"; return "
    " + marker + "
    " + this.GetInnerHTML(context, formatter).Trim() + "


    "; diff --git a/FLocal.Common/BBCodes/Tex.cs b/FLocal.Common/BBCodes/Tex.cs index 001f229..27f3bed 100644 --- a/FLocal.Common/BBCodes/Tex.cs +++ b/FLocal.Common/BBCodes/Tex.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("tex") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { string tex = this.InnerBBCode; var upload = helpers.TexProcessor.getCompiled(tex); return "/Upload/Item/" + upload.id.ToString() + "/" + this.Safe(tex) + ""; diff --git a/FLocal.Common/BBCodes/U.cs b/FLocal.Common/BBCodes/U.cs index 505f4e9..4fa7058 100644 --- a/FLocal.Common/BBCodes/U.cs +++ b/FLocal.Common/BBCodes/U.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("u") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { return "" + this.GetInnerHTML(context, formatter) + ""; } diff --git a/FLocal.Common/BBCodes/UploadImage.cs b/FLocal.Common/BBCodes/UploadImage.cs index 425ae71..5ee0db3 100644 --- a/FLocal.Common/BBCodes/UploadImage.cs +++ b/FLocal.Common/BBCodes/UploadImage.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("uploadimage") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { var upload = dataobjects.Upload.LoadById(int.Parse(this.InnerText)); var name = upload.filename; return "/Upload/Item/" + upload.id.ToString() + "/" + this.Safe(upload.filename) + ""; diff --git a/FLocal.Common/BBCodes/UploadLink.cs b/FLocal.Common/BBCodes/UploadLink.cs index 81c3125..00fe190 100644 --- a/FLocal.Common/BBCodes/UploadLink.cs +++ b/FLocal.Common/BBCodes/UploadLink.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("uploadlink") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { var upload = dataobjects.Upload.LoadById(int.Parse(this.DefaultOrValue)); var name = this.Safe(upload.filename); if(this.Default != null) { diff --git a/FLocal.Common/BBCodes/Url.cs b/FLocal.Common/BBCodes/Url.cs index 67b2604..45dda97 100644 --- a/FLocal.Common/BBCodes/Url.cs +++ b/FLocal.Common/BBCodes/Url.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("url") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { string rawUrl = this.DefaultOrValue; string title = null; if(rawUrl.ToLower() != this.InnerText.ToLower()) { diff --git a/FLocal.Common/BBCodes/User.cs b/FLocal.Common/BBCodes/User.cs index 7993deb..e34fed7 100644 --- a/FLocal.Common/BBCodes/User.cs +++ b/FLocal.Common/BBCodes/User.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base("user") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { return UserMentionProcessor.ProcessUserMention(context, this.DefaultOrValue); } diff --git a/FLocal.Common/BBCodes/Wiki.cs b/FLocal.Common/BBCodes/Wiki.cs index 22a6a7c..5143c47 100644 --- a/FLocal.Common/BBCodes/Wiki.cs +++ b/FLocal.Common/BBCodes/Wiki.cs @@ -12,7 +12,7 @@ namespace FLocal.Common.BBCodes { : base("wiki") { } - public override string Format(IPostParsingContext context, ITextFormatter formatter) { + public override string Format(IPostParsingContext context, ITextFormatter formatter) { return "w:" + this.GetInnerHTML(context, formatter) + ""; } diff --git a/FLocal.Common/BBCodes/helpers/BBCode.cs b/FLocal.Common/BBCodes/helpers/BBCode.cs index 67fbaf9..4328aae 100644 --- a/FLocal.Common/BBCodes/helpers/BBCode.cs +++ b/FLocal.Common/BBCodes/helpers/BBCode.cs @@ -11,7 +11,7 @@ namespace FLocal.Common.BBCodes { : base(name) { } - protected string GetInnerHTML(IPostParsingContext context, PJonDevelopment.BBCode.ITextFormatter formatter) { + protected string GetInnerHTML(IPostParsingContext context, PJonDevelopment.BBCode.ITextFormatter formatter) { StringBuilder builder = new StringBuilder(); foreach (var node in this.Nodes) { builder.Append(node.Format(context, formatter)); diff --git a/FLocal.Common/UBBParser.cs b/FLocal.Common/UBBParser.cs index f85ce87..66ca457 100644 --- a/FLocal.Common/UBBParser.cs +++ b/FLocal.Common/UBBParser.cs @@ -14,20 +14,20 @@ namespace FLocal.Common { private class BBParserGateway { - private class SimpleFormatter : ITextFormatter { + private class SimpleFormatter : ITextFormatter { public static readonly SimpleFormatter instance = new SimpleFormatter(); private SimpleFormatter() { } - public string Format(string source) { + public string Format(BBCodes.IPostParsingContext context, string source) { return source; } } - private class TextFormatter : ITextFormatter { + private class TextFormatter : ITextFormatter { public static readonly TextFormatter instance = new TextFormatter(); @@ -86,14 +86,14 @@ namespace FLocal.Common { { new Regex("<-", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline), match => "←" }, }; - private ITextFormatter inner; + private ITextFormatter inner; private TextFormatter() { - this.inner = new BBCodeHtmlFormatter(); + this.inner = new BBCodeHtmlFormatter(); } - public string Format(string source) { - string result = this.inner.Format(source).Replace(" ", " "); + public string Format(BBCodes.IPostParsingContext context, string source) { + string result = this.inner.Format(context, source).Replace(" ", " "); result = LINKS_MATCHER.Replace(result, LINKS_REPLACE); foreach(var smile in SMILEYS_DATA) { result = smile.Key.Replace(result, smile.Value); @@ -110,10 +110,10 @@ namespace FLocal.Common { public static readonly BBParserGateway instance = new BBParserGateway(); private BBCodeParser parser; - private ITextFormatter formatter; + private ITextFormatter formatter; private BBCodeParser quotesParser; - private ITextFormatter simpleFormatter; + private ITextFormatter simpleFormatter; private BBParserGateway() { this.parser = new BBCodeParser(); diff --git a/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeDocument.vb b/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeDocument.vb index f66839f..851ad27 100644 --- a/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeDocument.vb +++ b/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeDocument.vb @@ -71,7 +71,7 @@ Public NotInheritable Class BBCodeDocument(Of TContext As Class) ''' ''' The formatted text. Public Function Format(ByVal context As TContext) As String - Return Format(context, New BBCodeHtmlFormatter()) + Return Format(context, New BBCodeHtmlFormatter(Of TContext)()) End Function ''' @@ -79,7 +79,7 @@ Public NotInheritable Class BBCodeDocument(Of TContext As Class) ''' ''' An object that implements the interface. ''' The formatted text. - Public Function Format(ByVal context As TContext, ByVal formatter As ITextFormatter) As String + Public Function Format(ByVal context As TContext, ByVal formatter As ITextFormatter(Of TContext)) As String Dim sb As New Text.StringBuilder() For Each n In Nodes sb.Append(n.Format(context, formatter)) diff --git a/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeElement.vb b/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeElement.vb index e8e2495..a66123d 100644 --- a/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeElement.vb +++ b/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeElement.vb @@ -135,7 +135,7 @@ Public Class BBCodeElement(Of TContext As Class) ''' Transforms this instance of into its desired text representation. ''' An object that implements the interface. ''' The text formatted by the . - Public Overrides Function Format(ByVal context As TContext, ByVal formatter As ITextFormatter) As String + Public Overrides Function Format(ByVal context As TContext, ByVal formatter As ITextFormatter(Of TContext)) As String IsValueFormatted = False Dim sb As New Text.StringBuilder(Me.ReplacementFormat) Dim attribs = __RxAttribute.Matches(Me.ReplacementFormat) @@ -241,7 +241,7 @@ Public Class BBCodeElement(Of TContext As Class) End Set End Property - Private Function GetAttribute(ByVal name As String, ByVal context As TContext, ByVal formatter As ITextFormatter) As String + Private Function GetAttribute(ByVal name As String, ByVal context As TContext, ByVal formatter As ITextFormatter(Of TContext)) As String Dim attribs = name.ToUpperInvariant().Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries) For Each attrib In attribs If (String.CompareOrdinal(attrib, "VALUE") = 0) Then diff --git a/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeHtmlFormatter.vb b/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeHtmlFormatter.vb index cda2d30..ee83ecf 100644 --- a/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeHtmlFormatter.vb +++ b/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeHtmlFormatter.vb @@ -18,20 +18,20 @@ ''' ''' Represnts an HTML generator for the . ''' -Public NotInheritable Class BBCodeHtmlFormatter - Implements ITextFormatter +Public NotInheritable Class BBCodeHtmlFormatter(Of TContext As Class) + Implements ITextFormatter(Of TContext) - ''' - ''' Generates the desired text from the specified source. - ''' - ''' The source to generate the text. - ''' The text generated by the source. - Public Function GenerateText(ByVal source As String) As String Implements ITextFormatter.Format - Dim sb As New Text.StringBuilder(HtmlEncode(source)) - sb.Replace(vbCrLf, vbLf) - sb.Replace(vbCr, String.Empty) - sb.Replace(vbLf, "
    ") - Return sb.ToString() - End Function + ''' + ''' Generates the desired text from the specified source. + ''' + ''' The source to generate the text. + ''' The text generated by the source. + Public Function GenerateText(ByVal context As TContext, ByVal source As String) As String Implements ITextFormatter(Of TContext).Format + Dim sb As New Text.StringBuilder(HtmlEncode(source)) + sb.Replace(vbCrLf, vbLf) + sb.Replace(vbCr, String.Empty) + sb.Replace(vbLf, "
    ") + Return sb.ToString() + End Function End Class diff --git a/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeNode.vb b/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeNode.vb index c32f358..ab41390 100644 --- a/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeNode.vb +++ b/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeNode.vb @@ -57,7 +57,7 @@ Public MustInherit Class BBCodeNode(Of TContext As Class) ''' ''' An object that implements the interface. ''' The text formatted by the . - Public MustOverride Function Format(ByVal context As TContext, ByVal formatter As ITextFormatter) As String + Public MustOverride Function Format(ByVal context As TContext, ByVal formatter As ITextFormatter(Of TContext)) As String ''' ''' When implemented in a derived class, gets or sets the inner BBCode. diff --git a/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeText.vb b/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeText.vb index df1204e..da59ee4 100644 --- a/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeText.vb +++ b/ThirdParty/PJonDevelopment.BBCode/Classes/BBCodeText.vb @@ -37,8 +37,8 @@ Public NotInheritable Class BBCodeText(Of TContext As Class) ''' Transforms this instance of into its desired text representation. ''' An object that implements the interface. ''' The text formatted by the . - Public Overrides Function Format(ByVal context As TContext, ByVal formatter As ITextFormatter) As String - Return formatter.Format(__InnerText) + Public Overrides Function Format(ByVal context As TContext, ByVal formatter As ITextFormatter(Of TContext)) As String + Return formatter.Format(context, __InnerText) End Function ''' Gets or sets the inner BBCode. diff --git a/ThirdParty/PJonDevelopment.BBCode/Interfaces/ITextFormatter.vb b/ThirdParty/PJonDevelopment.BBCode/Interfaces/ITextFormatter.vb index 9ffa907..647799f 100644 --- a/ThirdParty/PJonDevelopment.BBCode/Interfaces/ITextFormatter.vb +++ b/ThirdParty/PJonDevelopment.BBCode/Interfaces/ITextFormatter.vb @@ -18,13 +18,13 @@ ''' ''' Defines a generic text formatter. ''' -Public Interface ITextFormatter +Public Interface ITextFormatter(Of TContext As Class) - ''' - ''' Formats the specified text. - ''' - ''' The text to be formatted. - ''' The formatted text. - Function Format(ByVal source As String) As String + ''' + ''' Formats the specified text. + ''' + ''' The text to be formatted. + ''' The formatted text. + Function Format(ByVal context As TContext, ByVal source As String) As String End Interface