private string GetToneName(string arrTone, List<Tone2014> it)
{
string ToneName = "";
const string Default = "Default";
if (!String.IsNullOrEmpty(arrTone))
{
// recognize that ToneBase name alpha case mismatches do exist and process it
// take the first if there are multiple matches so error is not thrown
var matchedTone = it.FirstOrDefault(t => t.Name.ToLower() == arrTone.ToLower());
if (ReferenceEquals(matchedTone, null))
return ToneName;
if (matchedTone.GearList.IsNull())
ToneName = Default;
else
{
if (!Tones.Contains(matchedTone))
{
Tones.Add(matchedTone);
}
ToneName = arrTone;
}
}
return ToneName;
}