public static CloverDevice Get(CloverDeviceConfiguration configuration)
        {
            string cloverDevicetypeName = configuration.getCloverDeviceTypeName();

            return (CloverDevice)
                Activator.CreateInstance(Type.GetType(cloverDevicetypeName), configuration);
        }
示例#2
0
        public static CloverDevice Get(CloverDeviceConfiguration configuration)
        {
            string cloverDevicetypeName = configuration.getCloverDeviceTypeName();

            return((CloverDevice)
                   Activator.CreateInstance(Type.GetType(cloverDevicetypeName), configuration));
        }
        public static CloverDevice Get(CloverDeviceConfiguration configuration)
        {
            string name       = configuration.getCloverDeviceTypeName();
            Type   deviceType = Type.GetType(name);

            if (deviceType == null)
            {
                throw new ArgumentException($"Cannot locate type \"{name}\" specified in Configuration.");
            }

            return((CloverDevice)Activator.CreateInstance(deviceType, configuration));
        }