using System.Collections.Generic; namespace PKHeX.Core { public static class RibbonStrings { private static readonly Dictionary RibbonNames = new Dictionary(); /// /// Resets the Ribbon Dictionary to use the supplied set of Ribbon (Property) Names. /// /// Array of strings that are tab separated with Property Name, \t, and Display Name. public static void ResetDictionary(IEnumerable lines) { foreach (var line in lines) { string[] split = line.Split('\t'); if (split.Length != 2) continue; if (RibbonNames.ContainsKey(split[0])) RibbonNames[split[0]] = split[1]; else RibbonNames.Add(split[0], split[1]); } } /// /// Returns the Ribbon Display Name for the corresponding ribbon property name. /// /// Ribbon property name /// Ribbon display name public static string GetName(string propertyName) { if (RibbonNames.TryGetValue(propertyName, out string value)) return value; return null; } } }