1 // Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
2 
3 using System.ComponentModel;
4 using System.Web.WebPages.Scope;
5 
6 namespace System.Web.Mvc
7 {
8     [EditorBrowsable(EditorBrowsableState.Never)]
9     public static class PreApplicationStartCode
10     {
11         private static bool _startWasCalled;
12 
Start()13         public static void Start()
14         {
15             // Guard against multiple calls. All Start calls are made on same thread, so no lock needed here
16             if (_startWasCalled)
17             {
18                 return;
19             }
20             _startWasCalled = true;
21 
22             WebPages.Razor.PreApplicationStartCode.Start();
23             WebPages.PreApplicationStartCode.Start();
24 
25             ViewContext.GlobalScopeThunk = () => ScopeStorage.CurrentScope;
26         }
27     }
28 }
29