コード例 #1
0
        public void StartService(string[] args)
        {
            if (Properties.Settings.Default.EnablePerformanceCounters)
            {
                PerformanceCounterService.Initialize();
            }

            CreateManagementChannels();
            Initialize();
        }
コード例 #2
0
        public void StopService()
        {
            /*if (emService != null)
             * {
             *  emService.Stop();
             *  emService.Dispose();
             *  emService = null;
             * }
             *
             * if (extStateService != null)
             * {
             *  extStateService.ClearState();
             *  extStateService = null;
             * }*/

            if (managementInterfaceServer != null)
            {
                managementInterfaceServer = null;
            }

            if (tcpManagementDataServer != null)
            {
                tcpManagementDataServer.StopServer();
                tcpManagementDataServer = null;
            }

            if (pipeManagementDataServer != null)
            {
                pipeManagementDataServer.StopServer();
                pipeManagementDataServer = null;
            }

            if (vmMailerService != null)
            {
                vmMailerService = null;
            }

            if (vmService != null)
            {
                vmService = null;
            }

            DeInitialize();

            PerformanceCounterService.ResetCounters();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: humanosc/Work
        static void Main ()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault( false );

            MainForm mainForm = new MainForm(); 
            MainModel mainModel = new MainModel();
            
            IPerformanceCounterService performanceCounterService = new PerformanceCounterService();
            IPerformanceCounterInstanceInfoService performanceCounterInstanceInfoService = new PerformanceCounterInstanceInfoService();
            IProcessMonitorService processMonitorService = new ProcessMonitorService( performanceCounterService, performanceCounterInstanceInfoService, mainModel);
            IGnuPlotGeneratorService gnuPlotGenerator = new GnuPlotGeneratorService( mainModel );
            IMainModelSerializerService mainModelSerializerService = new MainModelSerializerService();
            ILogService logService = new LogService( mainModel );

            AboutViewPresenter aboutPresenter = new AboutViewPresenter(new AboutBox());

            MainViewPresenter mainViewPresenter = new MainViewPresenter(mainForm, mainModel, mainModelSerializerService, processMonitorService, logService, gnuPlotGenerator, aboutPresenter);

            Application.Run( mainForm );
        }