public ProcessManager(OrthancServiceConfiguration config, ServiceBase serviceBase) { _config = config; _serviceBase = serviceBase; Logger.Info("OrthancPath = {0}", config.OrthancPath); Logger.Info("CommandLineArguments = {0}", config.CommandLineArguments); Logger.Info("WorkingDirectory = {0}", config.WorkingDirectory); }
/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { Logger.Info("Service Starting"); // The path to the configuration file must be passed in if (args.Length < 1) { Logger.Error("Path to configuration file not specified, aborting"); return; } // Load the configuration OrthancServiceConfiguration config; try { Logger.Info("Reading configuration from {0}", args[0]); config = OrthancServiceConfiguration.Read(args[0]); } catch (Exception ex) { Logger.Error("Unexpected exception reading configuration file {0}", ex); return; } // Start up the service if (Environment.UserInteractive) { var pm = new ProcessManager(config, null); pm.Start(); } else { ServiceBase.Run(new Services(config)); } }
public Services(OrthancServiceConfiguration config) { InitializeComponent(); _pm = new ProcessManager(config, this); }