Esempio n. 1
0
        public static int Main(string[] args)
        {
            StructureMapSetup.Setup();

            var systemInformationDispatchingService = ObjectFactory.GetInstance <ISystemInformationDispatchingService>();

            return((int)HostFactory.Run(
                       x =>
            {
                x.Service <ISystemInformationDispatchingService>(
                    s =>
                {
                    s.ConstructUsing(name => systemInformationDispatchingService);
                    s.WhenStarted(d => d.Start());
                    s.WhenStopped(d => d.Stop());
                });

                x.RunAsLocalSystem();

                x.SetDisplayName("SystemMonitorAgent");
                x.SetServiceName("SystemMonitorAgent");
                x.SetDescription(
                    "The service collects information such as system performance data and sends them over the configured monitoring service where the information is displayed in real-time. For further details and the source code to this service visit https://github.com/andreaskoch/SignalKo-SystemMonitor");
            }));
        }
        public static void Start()
        {
            IContainer container = StructureMapSetup.Initialize();

            DependencyResolver.SetResolver(new StructureMapDependencyResolver(container));
            GlobalConfiguration.Configuration.DependencyResolver = new StructureMapDependencyResolver(container);
        }
Esempio n. 3
0
        public void Initialize_ResultIsNotNull()
        {
            // Act
            var container = StructureMapSetup.Initialize();

            // Assert
            Assert.IsNotNull(container);
        }
        protected void Application_Start()
        {
            StructureMapSetup.Initialize();

            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
 public void Setup_NoMachineNameParameter_ThrowsNoException()
 {
     // Act
     StructureMapSetup.Setup();
 }