Esempio n. 1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="AlfredSubsystem" /> class.
        /// </summary>
        /// <exception cref="ArgumentNullException">
        ///     Thrown when one or more required arguments are null.
        /// </exception>
        /// <param name="container"> The container. </param>
        public AlfredCoreSubsystem([NotNull] IObjectContainer container)
            : base(container)
        {
            if (container == null) { throw new ArgumentNullException(nameof(container)); }

            _controlPage = new AlfredModuleListPage(container, ControlPageName, "Core");

            // Instantiate the modules
            _powerModule = new AlfredPowerModule(container);
            _timeModule = new AlfredTimeModule(container);
            _systemsModule = new AlfredSubsystemListModule(container);
            _pagesModule = new AlfredPagesListModule(container);
        }
Esempio n. 2
0
        public void OnStartup()
        {
            var bootstrapper = new AlfredBootstrapper();
            _alfred = bootstrapper.Create();

            _page = new AlfredModuleListPage(Container, "Time", "Time");
            _module = new AlfredTimeModule(Container);
            _page.Register(_module);
            _subsystem = new TestSubsystem(Container);
            _subsystem.AddAutoRegisterPage(_page);

            _alfred.Register(_subsystem);
        }