private string GetAMorseFor(string item, IMorseType morser) { if (morser.GetAlphabet().ContainsKey(item)) { return(morser.GetAlphabet()[item]); } else if (morser.GetNumeral().ContainsKey(item)) { return(morser.GetNumeral()[item]); } else { return(item); } }
private string GetFromMorse(string element, IMorseType morser) { if (morser.GetAlphabet().ContainsValue(element)) { return(morser.GetAlphabet().FirstOrDefault(x => x.Value == element).Key); } else if (morser.GetNumeral().ContainsValue(element)) { return(morser.GetNumeral().FirstOrDefault(x => x.Value == element).Key); } else { return(element); } }