public override void AddToDictionary(MessageDictionary dictionary, MethodInfo info) { if (_keys.Length != _charList.Length * _width) throw new Exception("CharacterMapAttribute requires the key list and the character list to be of proportional length"); Enumerable.Range(0, _charList.Length).Do( i => dictionary.AddKeys(_mode, _keys.Skip(i*2).Take(2), BuildMessage(info, _charList[i]))); }
public override void AddToDictionary(MessageDictionary dictionary, MethodInfo info) { var keyList = _parser.Parse(_keyList); if (keyList.Count() != _charList.Length * 2) throw new Exception("CharacterMapAttribute requires the key list and the character list to be of identical length"); Enumerable.Range(0, _charList.Length).Do( i => dictionary.AddKeys(_mode, keyList.Skip(i*2).Take(2), BuildMessage(info, _charList[i]))); }