Esempio n. 1
0
        /// <summary>
        /// Gets a mapping with a given value
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public KeyTypeMapping GetMapping(string value)
        {
            KeyTypeMapping result;

            try
            {
                if (this._mappings.ContainsKey(value))
                {
                    result = _mappings[value];
                }
                else
                {
                    result = new KeyTypeMapping(value, value);
                }
            }
            catch (Exception ex)
            {
                throw new KeyTypeMappingFailedException(value, ex);
            }

            return(result);
        }
Esempio n. 2
0
 /// <summary>
 /// Adds a mapping.
 /// </summary>
 /// <param name="mapping"></param>
 public void AddMapping(KeyTypeMapping mapping)
 {
     _mappings.Add(mapping.Value, mapping);
 }