Fix errors and warnings

This commit is contained in:
Michael Vesely 2021-12-17 11:21:14 +01:00
parent 5bcd101beb
commit 0b34a4ccee
6 changed files with 13 additions and 24 deletions

View File

@ -57,7 +57,7 @@ namespace Mustache {
try { try {
return Convert.ToDouble(condition) > Convert.ToDouble(targetValue); return Convert.ToDouble(condition) > Convert.ToDouble(targetValue);
} catch (Exception exception) { } catch (Exception /* ex */) {
return false; return false;
} }

View File

@ -57,13 +57,9 @@ namespace Mustache {
try { try {
return Convert.ToDouble(condition) >= Convert.ToDouble(targetValue); return Convert.ToDouble(condition) >= Convert.ToDouble(targetValue);
} catch (Exception exception) { } catch (Exception /* ex */) {
return false; return false;
} }
return false;
} }
/// <summary> /// <summary>

View File

@ -59,7 +59,7 @@ namespace Mustache {
try { try {
return Convert.ToDouble(condition) < Convert.ToDouble(targetValue); return Convert.ToDouble(condition) < Convert.ToDouble(targetValue);
} }
catch (Exception exception) { catch (Exception /* ex */) {
return false; return false;
} }

View File

@ -57,11 +57,10 @@ namespace Mustache {
try { try {
return Convert.ToDouble(condition) <= Convert.ToDouble(targetValue); return Convert.ToDouble(condition) <= Convert.ToDouble(targetValue);
} catch (Exception exception) { } catch (Exception /* ex */) {
return false; return false;
} }
return false;
} }
/// <summary> /// <summary>

View File

@ -1,11 +1,8 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text;
using System.Web;
namespace Mustache { namespace Mustache
{
class UrlDecodeTagDefinition: ContentTagDefinition { class UrlDecodeTagDefinition: ContentTagDefinition {
public UrlDecodeTagDefinition() public UrlDecodeTagDefinition()
: base("urldecode") { : base("urldecode") {
@ -25,7 +22,7 @@ namespace Mustache {
} }
public override string ConsolidateWriter(TextWriter writer, Dictionary<string, object> arguments) { public override string ConsolidateWriter(TextWriter writer, Dictionary<string, object> arguments) {
return HttpUtility.UrlDecode(writer.ToString()); return System.Net.WebUtility.UrlDecode(writer.ToString());
} }
} }
} }

View File

@ -1,11 +1,8 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text;
using System.Web;
namespace Mustache { namespace Mustache
{
public class UrlEncodeTagDefinition : ContentTagDefinition { public class UrlEncodeTagDefinition : ContentTagDefinition {
public UrlEncodeTagDefinition() public UrlEncodeTagDefinition()
@ -19,14 +16,14 @@ namespace Mustache {
WriterNeedsConsidated = true, WriterNeedsConsidated = true,
}; };
yield return context; yield return context;
} }
public override IEnumerable<TagParameter> GetChildContextParameters() { public override IEnumerable<TagParameter> GetChildContextParameters() {
return new TagParameter[] { new TagParameter("collection") }; return new TagParameter[] { new TagParameter("collection") };
} }
public override string ConsolidateWriter(TextWriter writer, Dictionary<string, object> arguments) { public override string ConsolidateWriter(TextWriter writer, Dictionary<string, object> arguments) {
return HttpUtility.UrlEncode(writer.ToString()); return System.Net.WebUtility.UrlEncode(writer.ToString());
} }
} }
} }