示例#1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            Platform.Log(LogLevel.Info, ProductInformation.GetNameAndVersion(true, true, true, true));

            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.ListInstalledSettingsGroups(SettingsGroupFilter.LocalStorage);
                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();
            }
        }
示例#2
0
        private static string GetProductVersionString()
        {
            if (ProductInformation.Name.Equals(ProductInformation.Component))
            {
                return(ProductInformation.GetNameAndVersion(false, false));
            }

            return(string.Format("{0}\n{1}\n{2}", ProductInformation.Name,
                                 Concatenate(ProductInformation.Component, String.Format("v{0}", ProductInformation.GetVersion(false, true))),
                                 Concatenate(ProductInformation.Edition, ProductInformation.Release)));
        }
 protected void SetPageTitle(string title)
 {
     if (title.Contains("{0}"))
     {
         Page.Title = string.IsNullOrEmpty(ConfigurationManager.AppSettings["ServerName"]) ? String.Format(title, ProductInformation.GetNameAndVersion(false, true)) : String.Format(title, ProductInformation.GetNameAndVersion(false, true)) + " [" + ConfigurationManager.AppSettings["ServerName"] + "]";
     }
     else
     {
         Page.Title = string.IsNullOrEmpty(ConfigurationManager.AppSettings["ServerName"]) ? title : title + " [" + ConfigurationManager.AppSettings["ServerName"] + "]";
     }
 }