Skip to content

Commit

Permalink
Removed backward compatibility code related to displaymode querystrin…
Browse files Browse the repository at this point in the history
…g and file naming.
  • Loading branch information
burningice2866 committed Feb 16, 2016
1 parent ba0df78 commit 99d4275
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 75 deletions.
15 changes: 0 additions & 15 deletions Composite/AspNet/DisplayModeFacade.cs

This file was deleted.

30 changes: 0 additions & 30 deletions Composite/AspNet/LegacyC1DisplayMode.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Composite/AspNet/Razor/RazorHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Web.WebPages;
using System.Xml;
using System.Xml.Linq;
using Composite.Core.Application;
using Composite.Core.IO;
//using Composite.Core.Extensions;
//using Composite.Core.IO;
using Composite.Core.Types;
Expand Down
4 changes: 1 addition & 3 deletions Composite/Composite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AspNet\CompositeC1SiteMapProvider.cs" />
<Compile Include="AspNet\DisplayModeFacade.cs" />
<Compile Include="AspNet\LegacyC1DisplayMode.cs" />
<Compile Include="AspNet\Razor\RazorFunction.cs" />
<Compile Include="AspNet\Razor\RazorHelper.cs" />
<Compile Include="AspNet\Razor\RazorPageTemplate.cs" />
Expand Down Expand Up @@ -191,7 +189,7 @@
<Compile Include="C1Console\Trees\SortDirection.cs" />
<Compile Include="Core\Application\ServiceLocator.cs" />
<Compile Include="Core\Application\Job.cs" />
<Compile Include="Core\Application\SpecialModesFileResolver.cs" />
<Compile Include="Core\IO\SpecialModesFileResolver.cs" />
<Compile Include="Core\Caching\FileRelatedDataCache.cs" />
<Compile Include="Core\Extensions\StackTraceExtensionMethods.cs" />
<Compile Include="Core\Instrumentation\LogExecutionTime.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Web.Hosting;
using System.Web.WebPages;

namespace Composite.Core.Application
namespace Composite.Core.IO
{
/// <exclude />
public static class SpecialModesFileResolver
Expand Down
8 changes: 3 additions & 5 deletions Composite/Core/WebClient/ApplicationLevelEventHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Globalization;
using System.Text;
using System.Web;
using Composite.AspNet;
using Composite.C1Console.Elements;
using Composite.C1Console.Events;
using Composite.Core.Application;
Expand Down Expand Up @@ -54,6 +53,8 @@ public static void Application_Start(object sender, EventArgs e)

SystemSetupFacade.SetFirstTimeStart();

InitializeServices();

if (!SystemSetupFacade.IsSystemFirstTimeInitialized)
{
return;
Expand All @@ -68,12 +69,10 @@ public static void Application_Start(object sender, EventArgs e)
{
throw new InvalidOperationException("Windows limitation problem detected! You have installed the website at a place where the total path length of the file with the longest filename exceeds the maximum allowed in Windows. See http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx#paths");
}


AppDomain.CurrentDomain.DomainUnload += CurrentDomain_DomainUnload;

InitializeServices();

lock (_syncRoot)
{
if (_systemIsInitialized) return;
Expand Down Expand Up @@ -345,7 +344,6 @@ public static void ApplicationStartInitialize(bool displayDebugInfo = false)
TempDirectoryFacade.OnApplicationStart();

HostnameBindingsFacade.Initialize();
DisplayModeFacade.Initialize();

ApplicationStartupFacade.FireSystemInitialized();

Expand Down
29 changes: 11 additions & 18 deletions Composite/Core/WebClient/Renderings/RenderingContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ namespace Composite.Core.WebClient.Renderings
/// Rendering context
/// </summary>
/// <exclude />
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class RenderingContext: IDisposable
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class RenderingContext : IDisposable
{
private static readonly string LogTitle = typeof (RenderingContext).Name;
private static readonly string LogTitle = typeof(RenderingContext).Name;

/// <summary>
/// Indicates whether performance profiling is enabled.
Expand Down Expand Up @@ -198,7 +198,7 @@ private void InitializeFromHttpContextInternal()
var request = httpContext.Request;
var response = httpContext.Response;

ProfilingEnabled = request.Url.OriginalString.Contains("c1mode=perf");
ProfilingEnabled = request.Url.OriginalString.Contains("c1mode=perf");
if (ProfilingEnabled)
{
if (!UserValidationFacade.IsLoggedIn())
Expand All @@ -221,17 +221,17 @@ private void InitializeFromHttpContextInternal()
Page = (IPage)HttpRuntime.Cache.Get(_previewKey + "_SelectedPage");
C1PageRoute.PageUrlData = new PageUrlData(Page);

PageRenderer.RenderingReason = (RenderingReason) HttpRuntime.Cache.Get(_previewKey + "_RenderingReason");
PageRenderer.RenderingReason = (RenderingReason)HttpRuntime.Cache.Get(_previewKey + "_RenderingReason");
}
else
{
PageUrlData pageUrl = C1PageRoute.PageUrlData ?? PageUrls.UrlProvider.ParseInternalUrl(request.Url.OriginalString);
PageUrlData pageUrl = C1PageRoute.PageUrlData ?? PageUrls.UrlProvider.ParseInternalUrl(request.Url.OriginalString);
Page = pageUrl.GetPage();

_cachedUrl = request.Url.PathAndQuery;

PageRenderer.RenderingReason = new UrlSpace(httpContext).ForceRelativeUrls
? RenderingReason.C1ConsoleBrowserPageView
PageRenderer.RenderingReason = new UrlSpace(httpContext).ForceRelativeUrls
? RenderingReason.C1ConsoleBrowserPageView
: RenderingReason.PageView;
}

Expand All @@ -258,7 +258,7 @@ private void InitializeFromHttpContextInternal()
Verify.IsNotNull(httpContext.Handler, "HttpHandler isn't defined");

var aspnetPage = (System.Web.UI.Page)httpContext.Handler;

OverrideDisplayMode(httpContext);

var pageRenderer = PageTemplateFacade.BuildPageRenderer(Page.TemplateId);
Expand All @@ -267,14 +267,7 @@ private void InitializeFromHttpContextInternal()

private static void OverrideDisplayMode(HttpContextBase httpContext)
{
var qs = httpContext.Request.QueryString;
var displayMode = qs["c1displaymode"];

if (qs.AllKeys.Length > 0 && qs.Keys[0] == null)
{
displayMode = qs[0];
}

var displayMode = httpContext.Request.QueryString["c1displaymode"];
if (!String.IsNullOrEmpty(displayMode))
{
if (displayMode.Equals("mobile", StringComparison.OrdinalIgnoreCase))
Expand Down Expand Up @@ -333,7 +326,7 @@ public bool PreRenderRedirectCheck()

return false;
}

private static string GetLoginRedirectUrl(string url)
{
return UrlUtils.PublicRootPath + "/Composite/Login.aspx?ReturnUrl=" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
using System.Linq;
using System.Web;
using Composite.C1Console.Security;
using Composite.Core.Application;
using Composite.Core.Collections.Generic;
using Composite.Core.Extensions;
using Composite.Core.IO;
using Composite.Core.PageTemplates;
using Composite.Core.WebClient.Renderings.Page;
using Composite.Core.Xml;
Expand Down
2 changes: 1 addition & 1 deletion Composite/Plugins/PageTemplates/Razor/RazorPageRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
using System.Web.WebPages;
using System.Xml.Linq;
using Composite.AspNet.Razor;
using Composite.Core.Application;
using Composite.Core.Collections.Generic;
using Composite.Core.Extensions;
using Composite.Core.Instrumentation;
using Composite.Core.IO;
using Composite.Core.PageTemplates;
using Composite.Core.WebClient.Renderings.Page;
using Composite.Functions;
Expand Down

0 comments on commit 99d4275

Please sign in to comment.