/// <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); }
/// <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 SystemMonitoringSubsystem([NotNull] IObjectContainer container) : base(container) { if (container == null) { throw new ArgumentNullException(nameof(container)); } // Grab a factory from the container. This can be counter-based or a test factory. var factory = Container.Provide<IMetricProviderFactory>(); // Set up modules _cpuModule = new CpuMonitorModule(container, factory); _memoryModule = new MemoryMonitorModule(container, factory); _diskModule = new DiskMonitorModule(container, factory); // Set up the containing page _page = new AlfredModuleListPage(container, Resources.SystemMonitoringSystem_Name.NonNull(), "Sys"); }
public override void SetUp() { base.SetUp(); var bootstrapper = new AlfredBootstrapper(); _alfred = bootstrapper.Create(); _alfred.Console = new SimpleConsole(); _subsystem = new TestSubsystem(Container); _page = new AlfredModuleListPage(Container, "Test Page", "Test"); }
/// <summary> /// Registers the module to the Alfred instance using a test subsystem and simple page. /// </summary> /// <param name="alfred">The alfred.</param> /// <param name="module">The module.</param> /// <exception cref="System.ArgumentNullException">alfred, module /// </exception> private void RegisterTestModule([NotNull] AlfredApplication alfred, [NotNull] AlfredModule module) { if (alfred == null) { throw new ArgumentNullException(nameof(alfred)); } if (module == null) { throw new ArgumentNullException(nameof(module)); } var subsystem = new TestSubsystem(Container); var page = new AlfredModuleListPage(Container, "Test Page", "Test"); subsystem.AddAutoRegisterPage(page); alfred.Register(subsystem); page.Register(module); }
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); }