Esempio n. 1
0
        private ChannelHubBase CreateChannelHub(ChannelHubSettings channelHubSettings)
        {
            Type type;

            type = typeof(ChannelHub <>).MakeGenericType(new Type[] { OneDasUtilities.GetTypeFromOneDasDataType(channelHubSettings.DataType) });

            return((ChannelHubBase)Activator.CreateInstance(type, channelHubSettings));
        }
        public DataGatewaySampleGateway(DataGatewaySampleSettings settings) : base(settings)
        {
            Random random;

            random    = new Random();
            _settings = settings;

            _numberGeneratorSet = this.DataPortSet.Where(dataPort => dataPort.DataDirection == DataDirection.Input).ToList().Select(dataPort =>
            {
                Type type;

                type = typeof(DataGatewaySampleNumberGenerator <>).MakeGenericType(OneDasUtilities.GetTypeFromOneDasDataType(dataPort.DataType));

                return((DataGatewaySampleNumberGeneratorBase)Activator.CreateInstance(type, dataPort, random));
            }).ToList();
        }