Exemplo n.º 1
0
 public TestStartupModuleFactory(
     IApplicationRendering application,
     IGpioConnectionDriverFactory gpioConnectionDriverFactory,
     string namePath         = "name.val",
     string pin26FeaturePath = "pin26-feature.val",
     string greetingsPath    = "greetings.csv",
     string lastGreetingPath = "last-greeting.val",
     ITextViewRendererReporter textViewRendererReporter = null,
     IInputManagerReporter inputManagerReporter         = null)
     : base(application, gpioConnectionDriverFactory, namePath, pin26FeaturePath, greetingsPath, lastGreetingPath, textViewRendererReporter, inputManagerReporter)
 {
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SystemBoundaries.StartupModuleFactory" /> class.
        /// </summary>
        /// <param name="application">The application.</param>
        /// <param name="gpioConnectionDriverFactory">The gpio connection driver factory.</param>
        /// <param name="namePath">The name path.</param>
        /// <param name="pin26FeaturePath">The pin26 feature path.</param>
        /// <param name="greetingsPath">The greetings path.</param>
        /// <param name="lastGreetingPath">The last greeting path.</param>
        /// <param name="textViewRendererReporter">The text view renderer reporter.</param>
        /// <param name="inputManagerReporter">The input manager reporter.</param>
        /// <param name="disposableReporter">The disposable reporter.</param>
        /// <param name="timeIntervalSynchronizerReporter">The time interval synchronizer reporter.</param>
        public StartupModuleFactory(
            IApplicationRendering application,
            IGpioConnectionDriverFactory gpioConnectionDriverFactory,
            string namePath         = "name.val",
            string pin26FeaturePath = "pin26-feature.val",
            string greetingsPath    = "greetings.csv",
            string lastGreetingPath = "last-greeting.val",
            ITextViewRendererReporter?textViewRendererReporter = null,
            IInputManagerReporter?inputManagerReporter         = null,
            IDisposableReporter?disposableReporter             = null,
            ITimeIntervalSynchronizerReporter?timeIntervalSynchronizerReporter = null)
        {
            this.application = application;
            this.gpioConnectionDriverFactory = gpioConnectionDriverFactory;
            this.namePath                         = namePath;
            this.pin26FeaturePath                 = pin26FeaturePath;
            this.greetingsPath                    = greetingsPath;
            this.lastGreetingPath                 = lastGreetingPath;
            this.textViewRendererReporter         = textViewRendererReporter;
            this.inputManagerReporter             = inputManagerReporter;
            this.timeIntervalSynchronizerReporter = timeIntervalSynchronizerReporter;
            this.startupModule                    = new AsyncLazy <IStartupModule, StartupModuleData>(
                async() =>
            {
                var lifecycleConfiguration = await this.GetLifecycleConfigurationAsync().ConfigureAwait(false);
                var greetingProvider       = this.CreateGreetingProvider();

                var displayFactory = this.CreateDisplayFactory();
                var display        = displayFactory.Create(
                    this.gpioConnectionDriverFactory,
                    lifecycleConfiguration.Pin26Feature == Pin26Feature.Backlight);

                this.application.InputManagerReporter             = this.inputManagerReporter;
                this.application.TextViewRendererReporter         = this.textViewRendererReporter;
                this.application.TimeIntervalSynchronizerReporter = this.timeIntervalSynchronizerReporter;

                var textViewNavigator = this.application.StartRendering(display, TimeSpan.FromMilliseconds(200));
                var disposer          = new Disposer(disposableReporter, displayFactory);
                return(new StartupModuleData(display, textViewNavigator, lifecycleConfiguration, greetingProvider, disposer));
            });
        }