Beispiel #1
0
        public static void RegisterType(Type type, WritingDelegate writingMethod, ReadingDelegate readingMethod)
        {
            if (_handlers.ContainsKey(type))
            {
                throw new ArgumentException($"There is already a registration for type {type.FullName}.");
            }

            _handlers.Add(type, new Handler(writingMethod, readingMethod));
        }
Beispiel #2
0
 public Handler(WritingDelegate writingMethod, ReadingDelegate readingMethod)
 {
     this.writingMethod = writingMethod;
     this.readingMethod = readingMethod;
 }