public static void AddConverter(WorkItemValueConverter converter)
        {
            if (converter == null)
            {
                throw new ArgumentNullException("converter", "converter is null.");
            }

            if (_converterDictionary.ContainsKey(converter.RelatedType))
            {
                throw new InvalidOperationException("related type for converter already registered");
            }

            _converterDictionary.Add(converter.RelatedType, converter);
        }
Esempio n. 2
0
        public static void AddConverter(WorkItemValueConverter converter)
        {
            if (converter == null)
            {
                throw new ArgumentNullException(nameof(converter), "converter is null.");
            }

            if (_converterDictionary.ContainsKey(converter.RelatedType))
            {
                throw new InvalidOperationException("related type for converter already registered");
            }

            _converterDictionary.Add(converter.RelatedType, converter);
        }