Configuration() static private method

static private Configuration ( ) : string>.IDictionary
return string>.IDictionary
コード例 #1
0
        public static HtmlString GetHtml()
        {
            StringBuilder sb = new StringBuilder(_Style);

            sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "<h1 class=\"server-info\">{0}</h1>",
                                        HttpUtility.HtmlEncode(HelpersResources.ServerInfo_Header)));

            var configuration = ServerInfo.Configuration();

            Debug.Assert((configuration != null) && (configuration.Count > 0));
            PrintInfoSection(sb, HttpUtility.HtmlEncode(HelpersResources.ServerInfo_ServerConfigTable), configuration);

            var serverVariables = ServerInfo.ServerVariables();

            Debug.Assert((serverVariables != null));
            PrintInfoSection(sb, HelpersResources.ServerInfo_ServerVars, serverVariables);

            var legacyCAS = ServerInfo.LegacyCAS();

            if (legacyCAS.Any())
            {
                PrintInfoSection(sb, HelpersResources.ServerInfo_LegacyCAS, legacyCAS);
            }

            // Info below is not available in medium trust.

            var httpRuntimeInfo = ServerInfo.HttpRuntimeInfo();

            Debug.Assert(httpRuntimeInfo != null);

            if (!httpRuntimeInfo.Any())
            {
                sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "<p class=\"server-info\">{0}</p>",
                                            HttpUtility.HtmlEncode(HelpersResources.ServerInfo_AdditionalInfo)));
                return(new HtmlString(sb.ToString()));
            }
            else
            {
                PrintInfoSection(sb, HelpersResources.ServerInfo_HttpRuntime, httpRuntimeInfo);

                var envVariables = ServerInfo.EnvironmentVariables();
                Debug.Assert(envVariables != null);
                PrintInfoSection(sb, HelpersResources.ServerInfo_EnvVars, envVariables);
            }

            return(new HtmlString(sb.ToString()));
        }