Ejemplo n.º 1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            var commandLine = new CommandLine(args);

            if (commandLine.RunAsService)
            {
                var ServicesToRun = new ServiceBase[] { new ShredHostService() };
                ServiceBase.Run(ServicesToRun);
            }
            else if (!String.IsNullOrEmpty(commandLine.PreviousExeConfigurationFilename))
            {
                var groups = SettingsGroupDescriptor.ListInstalledLocalSettingsGroups();
                groups.Add(new SettingsGroupDescriptor(typeof(ShredSettingsMigrator).Assembly.GetType("ClearCanvas.Server.ShredHost.ShredHostServiceSettings")));
                foreach (var group in groups)
                {
                    SettingsMigrator.MigrateSharedSettings(group, commandLine.PreviousExeConfigurationFilename);
                }

                ShredSettingsMigrator.MigrateAll(commandLine.PreviousExeConfigurationFilename);
            }
            else
            {
                ShredHostService.InternalStart();
                Console.WriteLine("Press <Enter> to terminate the ShredHost.");
                Console.WriteLine();
                Console.ReadLine();
                ShredHostService.InternalStop();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            var commandLine = new CommandLine(args);

            if (commandLine.RunAsService)
            {
                ServiceBase[] servicesToRun = new ServiceBase[] { new ShredHostService() };
                ServiceBase.Run(servicesToRun);
            }
            else if (!String.IsNullOrEmpty(commandLine.PreviousExeConfigurationFilename))
            {
                var groups = SettingsGroupDescriptor.ListInstalledLocalSettingsGroups();
                foreach (var group in groups)
                {
                    SettingsMigrator.MigrateSharedSettings(group, commandLine.PreviousExeConfigurationFilename);
                }

                ShredSettingsMigrator.MigrateAll(commandLine.PreviousExeConfigurationFilename);
            }
            else
            {
                Thread.CurrentThread.Name = "Main thread";
                if (!ManifestVerification.Valid)
                {
                    Console.WriteLine("The manifest detected an invalid installation.");
                }
                ShredHostService.InternalStart();
                Console.WriteLine("Press <Enter> to terminate the ShredHost.");
                Console.WriteLine();
                Console.ReadLine();
                ShredHostService.InternalStop();
            }
        }
Ejemplo n.º 3
0
        public void RunApplication(string[] args)
        {
            CommandLine commandLine = new CommandLine(args);

            foreach (SettingsGroupDescriptor group in SettingsGroupDescriptor.ListInstalledLocalSettingsGroups())
            {
                Type type     = Type.GetType(group.AssemblyQualifiedTypeName, true);
                var  settings = ApplicationSettingsHelper.GetSettingsClassInstance(type);
                ApplicationSettingsExtensions.ImportSharedSettings(settings, commandLine.ConfigurationFilename);
            }
        }
        public void RunApplication(string[] args)
        {
            var commandLine = new CommandLine(args);

            var groups = SettingsGroupDescriptor.ListInstalledLocalSettingsGroups();

            foreach (var group in groups)
            {
                SettingsMigrator.MigrateSharedSettings(group, commandLine.PreviousExeConfigurationFilename);
            }
        }