static SeparatorInfo SeparatorInfoByBeginSeparator(string str) { if (str == null) return null; SeparatorInfo result = Separators.Where( (sepInfo) => str.StartsWith(sepInfo.BeginSeparator) ).FirstOrDefault(); return result; }
public static string Wrap(this PropertyKind propertyKind, string stringToWrap) { SeparatorInfo separatorInfo = propertyKind.SeparatorInfoByPropertyKind(); if (separatorInfo == null) return stringToWrap; string result = separatorInfo.BeginSeparator + stringToWrap + separatorInfo.EndSepartor; return result; }
static SeparatorInfo SeparatorInfoByPropertyKind(this PropertyKind propertyKind) { SeparatorInfo result = Separators.Where((sepInfo) => sepInfo.ThePropertyKind == propertyKind).FirstOrDefault(); return result; }