Get Config State

Get Config State

Config State C# Web Control Code

Sitecore.Data.Items.Item item = Sitecore.Context.Item; 
if (item == null) return; 

output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold; width:100%; clear:both"); 
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div); 
output.Write("C# Web Control Real-time Output"); 
output.RenderEndTag(); //Div 

output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-size:small; width:100%; clear:both"); 
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div); 
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold"); 
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.P); 
//using : for colon and   for space 
output.Write("{0}: {1}", "Item", item.DisplayName); 
output.RenderEndTag(); //P 

string publishDate = Sitecore.Configuration.State.ActivePublishDate.Date.ToString(); 
string appRoot = Sitecore.Configuration.State.ActivePublishGroups; 
string clientLang = Sitecore.Configuration.State.ClientLanguage; 
string contentDB = Sitecore.Configuration.State.ContentDatabase; 
string debugMode = Sitecore.Configuration.State.DebugMode.ToString(); 
string desktopPath = Sitecore.Configuration.State.Desktop; 
string defRendDisable = Sitecore.Configuration.State.DisableDefaultRenderings.ToString(); 
string itmChangeRegDisable = Sitecore.Configuration.State.DisableItemChangeRegistering.ToString(); 
string dispatchEvts = Sitecore.Configuration.State.DispatchEvents.ToString(); 
string drawBorders = Sitecore.Configuration.State.DrawRenderingBorders.ToString(); 
string currentForm = Sitecore.Configuration.State.Form.ToString(); 
string appDomainAppPath = Sitecore.Configuration.State.HttpRuntime.AppDomainAppPath; 
string langCode = Sitecore.Configuration.State.Language; 
string currentDevice = Sitecore.Configuration.State.PageDesigner.CurrentDevice; 
string previewing = Sitecore.Configuration.State.Previewing.ToString(); 
string profilingData = Sitecore.Configuration.State.Profiling.ToString(); 
string fullScreen = Sitecore.Configuration.State.Request.ContentType; 
string resetAfterWebView = Sitecore.Configuration.State.ResetAfterWebView.ToString(); 
string showEditDots = Sitecore.Configuration.State.ShowEditDots.ToString(); 
string showRenderInfo = Sitecore.Configuration.State.ShowRenderingInfo.ToString(); 
string isSiteResolved = Sitecore.Configuration.State.Sites.IsSiteResolved.ToString(); 
string currentTheme = Sitecore.Configuration.State.Theme; 
string isTracing = Sitecore.Configuration.State.Tracing.ToString(); 
string isTranslating = Sitecore.Configuration.State.Translating.ToString(); 
string isWebEditing = Sitecore.Configuration.State.WebEditing.ToString(); 

if (!System.String.IsNullOrEmpty(publishDate)) 
output.Write("{0}&#58;&#160;{1}", "Active Publish Date:&#160;", "<b>" + publishDate + "</b><br/>"); 
else 
output.Write("{0}", "Active Publish Date not found.<br/>"); 
if (!System.String.IsNullOrEmpty(appRoot)) 
output.Write("{0}&#58;&#160;{1}", "Application Root:&#160;", "<b>" + appRoot + "</b><br/>"); 
else 
output.Write("{0}", "Application Root not found.<br/>"); 
if (!System.String.IsNullOrEmpty(clientLang)) 
output.Write("{0}&#58;&#160;{1}", "Client Language:&#160;", "<b>" + clientLang + "</b><br/>"); 
else 
output.Write("{0}", "Client Language not found.<br/>"); 
if (!System.String.IsNullOrEmpty(contentDB)) 
output.Write("{0}&#58;&#160;{1}", "Content Database:&#160;", "<b>" + contentDB + "</b><br/>"); 
else 
output.Write("{0}", "Content Database not found.<br/>"); 
if (!System.String.IsNullOrEmpty(debugMode)) 
output.Write("{0}&#58;&#160;{1}", "Debug Mode?&#160;", "<b>" + debugMode + "</b><br/>"); 
else 
output.Write("{0}", "Debug Mode data not found.<br/>"); 
if (!System.String.IsNullOrEmpty(desktopPath)) 
output.Write("{0}&#58;&#160;{1}", "Desktop Path:&#160;", "<b>" + desktopPath + "</b><br/>"); 
else 
output.Write("{0}", "Desktop Path not found.<br/>"); 
if (!System.String.IsNullOrEmpty(defRendDisable)) 
output.Write("{0}&#58;&#160;{1}", "Disable Rendering Definition?&#160;", "<b>" + defRendDisable + "</b><br/>"); 
else 
output.Write("{0}", "Disable Rendering Definition not found.<br/>"); 
if (!System.String.IsNullOrEmpty(itmChangeRegDisable)) 
output.Write("{0}&#58;&#160;{1}", "Disable Item Change Registration?&#160;", "<b>" + itmChangeRegDisable + "</b><br/>"); 
else 
output.Write("{0}", "Disable Item Change Registration not found.<br/>"); 
if (!System.String.IsNullOrEmpty(dispatchEvts)) 
output.Write("{0}&#58;&#160;{1}", "Dispatch Events?&#160;", "<b>" + dispatchEvts + "</b><br/>"); 
else 
output.Write("{0}", "Dispatch Events data not found.<br/>"); 
if (!System.String.IsNullOrEmpty(drawBorders)) 
output.Write("{0}&#58;&#160;{1}", "Draw Borders?&#160;", "<b>" + drawBorders + "</b><br/>"); 
else 
output.Write("{0}", "Draw Borders data not found.<br/>"); 
if (!System.String.IsNullOrEmpty(currentForm)) 
output.Write("{0}&#58;&#160;{1}", "Current Form:&#160;", "<b>" + currentForm + "</b><br/>"); 
else 
output.Write("{0}", "Current Form not found.<br/>"); 
if (!System.String.IsNullOrEmpty(appDomainAppPath)) 
output.Write("{0}&#58;&#160;{1}", "Your browser is reporting the following user agent text:&#160;", "<b>" + appDomainAppPath + "</b><br/>"); 
else 
output.Write("{0}", "Active Publish Date not found.<br/>"); 
if (!System.String.IsNullOrEmpty(langCode)) 
output.Write("{0}&#58;&#160;{1}", "Language Code:&#160;", "<b>" + langCode + "</b><br/>"); 
else 
output.Write("{0}", "Language code not found.<br/>"); 
if (!System.String.IsNullOrEmpty(currentDevice)) 
output.Write("{0}&#58;&#160;{1}", "Current Device:&#160;", "<b>" + currentDevice + "</b><br/>"); 
else 
output.Write("{0}", "Current Device not found.<br/>"); 
if (!System.String.IsNullOrEmpty(previewing)) 
output.Write("{0}&#58;&#160;{1}", "Previewing Data:&#160;", "<b>" + previewing + "</b><br/>"); 
else 
output.Write("{0}", "Previewing data not found.<br/>"); 
if (!System.String.IsNullOrEmpty(profilingData)) 
output.Write("{0}&#58;&#160;{1}", "Profiling Data:&#160;", "<b>" + profilingData + "</b><br/>"); 
else 
output.Write("{0}", "Profiling data not found.<br/>"); 
if (!System.String.IsNullOrEmpty(fullScreen)) 
output.Write("{0}&#58;&#160;{1}", "Fullscreen?&#160;", "<b>" + fullScreen + "</b><br/>"); 
else 
output.Write("{0}", "Fullscreen info not found.<br/>"); 
if (!System.String.IsNullOrEmpty(resetAfterWebView)) 
output.Write("{0}&#58;&#160;{1}", "Reset after Webview?&#160;", "<b>" + resetAfterWebView + "</b><br/>"); 
else 
output.Write("{0}", "Reset After Webview data not found.<br/>"); 
if (!System.String.IsNullOrEmpty(showEditDots)) 
output.Write("{0}&#58;&#160;{1}", "Show Edit Dots?&#160;", "<b>" + showEditDots + "</b><br/>"); 
else 
output.Write("{0}", "Edit Dots data not found.<br/>"); 
if (!System.String.IsNullOrEmpty(showRenderInfo)) 
output.Write("{0}&#58;&#160;{1}", "Rendering Info:&#160;", "<b>" + showRenderInfo + "</b><br/>"); 
else 
output.Write("{0}", "Rendering Info not found.<br/>"); 
if (!System.String.IsNullOrEmpty(isSiteResolved)) 
output.Write("{0}&#58;&#160;{1}", "Is Site Resolved?&#160;", "<b>" + isSiteResolved + "</b><br/>"); 
else 
output.Write("{0}", "Site Resolved not found.<br/>"); 
if (!System.String.IsNullOrEmpty(currentTheme)) 
output.Write("{0}&#58;&#160;{1}", "Current Theme:&#160;", "<b>" + currentTheme + "</b><br/>"); 
else 
output.Write("{0}", "Current Theme not found.<br/>"); 
if (!System.String.IsNullOrEmpty(isTracing)) 
output.Write("{0}&#58;&#160;{1}", "Is Tracing?&#160;", "<b>" + isTracing + "</b><br/>"); 
else 
output.Write("{0}", "Tracing info not found.<br/>"); 
if (!System.String.IsNullOrEmpty(isTranslating)) 
output.Write("{0}&#58;&#160;{1}", "Is Translating?&#160;", "<b>" + isTranslating + "</b><br/>"); 
else 
output.Write("{0}", "Translating info not found.<br/>"); 
if (!System.String.IsNullOrEmpty(isWebEditing)) 
output.Write("{0}&#58;&#160;{1}", "Is Web Editing?&#160;", "<b>" + isWebEditing + "</b><br/>"); 
else 
output.Write("{0}", "Web Editing info not found.<br/>"); 

output.RenderEndTag(); //Div


Config State C# Web Control Output

Active Publish Date: : 1/1/0001 12:00:00 AM
Application Root not found.
Client Language not found.
Content Database not found.
Debug Mode? : False
Desktop Path: : /sitecore/client/desktops/standard/default.aspx
Disable Rendering Definition? : False
Disable Item Change Registration? : False
Dispatch Events? : True
Draw Borders? : False
Current Form not found.
Active Publish Date not found.
Language Code: : en
Current Device not found.
Previewing Data: : False
Profiling Data: : False
Fullscreen info not found.
Reset after Webview? : True
Show Edit Dots? : False
Rendering Info: : False
Is Site Resolved? : True
Current Theme: : standard
Is Tracing? : False
Is Translating? : False
Is Web Editing? : False