Esempio n. 1
0
        /// <summary>
        /// Adds and configures hardware support.
        /// </summary>
        public static IHostBuilder ConfigureHardware(this IHostBuilder builder, HardwareOptionsDelegate options)
        {
            var hardware = new Mainboard(options).Connect();

            builder.ConfigureServices((context, services) => services.AddSingleton(typeof(IHardware), hardware));

            return(builder);
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Mainboard"/> class.
        /// </summary>
        /// <param name="configure">The configuration options of <see cref="Mainboard"/> specific features.</param>
        public Mainboard(HardwareOptionsDelegate configure)
        {
            var options = new HardwareOptions();

            configure(options);

            _options = options;
        }