示例#1
0
        public static T Create(VposPaymentSupplier id)
        {
            Func <T> constructor = null;

            if (_dict.TryGetValue(id, out constructor))
            {
                return(constructor());
            }

            throw new ArgumentException("No type registered for this vpos supplier");
        }
示例#2
0
 public static void Register(VposPaymentSupplier id, Func <T> ctor)
 {
     _dict.Add(id, ctor);
 }