Files
lightsetup/LightSetupMd5/StringFormatHandleDictionary.cs
2023-05-22 09:29:58 +08:00

32 lines
794 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LightSetupMd5
{
internal class StringFormatHandleDictionary : StringFormatHandle
{
private Dictionary<string, string> targets;
public StringFormatHandleDictionary(Dictionary<string, string> targets)
{
this.targets = targets;
}
public void addPos(StringBuilder sb, string group, string fieldFull, string field, string command)
{
if (!targets.ContainsKey(field))
{
return;
}
string value = targets[field];
if (!string.IsNullOrEmpty(value))
{
sb.Append(value);
}
}
}
}