Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@ -0,0 +1,31 @@
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.Configuration;
namespace System.Web.WebPages.Razor.Configuration
{
public class HostSection : ConfigurationSection
{
public static readonly string SectionName = RazorWebSectionGroup.GroupName + "/host";
private static readonly ConfigurationProperty _typeProperty =
new ConfigurationProperty("factoryType",
typeof(string),
null,
ConfigurationPropertyOptions.IsRequired);
private bool _factoryTypeSet = false;
private string _factoryType;
[ConfigurationProperty("factoryType", IsRequired = true, DefaultValue = null)]
public string FactoryType
{
get { return _factoryTypeSet ? _factoryType : (string)this[_typeProperty]; }
set
{
_factoryType = value;
_factoryTypeSet = true;
}
}
}
}

View File

@ -0,0 +1,54 @@
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.Configuration;
using System.Diagnostics.CodeAnalysis;
using System.Web.Configuration;
namespace System.Web.WebPages.Razor.Configuration
{
public class RazorPagesSection : ConfigurationSection
{
public static readonly string SectionName = RazorWebSectionGroup.GroupName + "/pages";
private static readonly ConfigurationProperty _pageBaseTypeProperty =
new ConfigurationProperty("pageBaseType",
typeof(string),
null,
ConfigurationPropertyOptions.IsRequired);
private static readonly ConfigurationProperty _namespacesProperty =
new ConfigurationProperty("namespaces",
typeof(NamespaceCollection),
null,
ConfigurationPropertyOptions.IsRequired);
private bool _pageBaseTypeSet = false;
private bool _namespacesSet = false;
private string _pageBaseType;
private NamespaceCollection _namespaces;
[ConfigurationProperty("pageBaseType", IsRequired = true)]
public string PageBaseType
{
get { return _pageBaseTypeSet ? _pageBaseType : (string)this[_pageBaseTypeProperty]; }
set
{
_pageBaseType = value;
_pageBaseTypeSet = true;
}
}
[ConfigurationProperty("namespaces", IsRequired = true)]
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Being able to set this property is extremely useful for third-parties who are testing components which interact with the Razor configuration system")]
public NamespaceCollection Namespaces
{
get { return _namespacesSet ? _namespaces : (NamespaceCollection)this[_namespacesProperty]; }
set
{
_namespaces = value;
_namespacesSet = true;
}
}
}
}

View File

@ -0,0 +1,40 @@
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.Configuration;
namespace System.Web.WebPages.Razor.Configuration
{
public class RazorWebSectionGroup : ConfigurationSectionGroup
{
public static readonly string GroupName = "system.web.webPages.razor";
// Use flags instead of null values since tests may want to set the property to null
private bool _hostSet = false;
private bool _pagesSet = false;
private HostSection _host;
private RazorPagesSection _pages;
[ConfigurationProperty("host", IsRequired = false)]
public HostSection Host
{
get { return _hostSet ? _host : (HostSection)Sections["host"]; }
set
{
_host = value;
_hostSet = true;
}
}
[ConfigurationProperty("pages", IsRequired = false)]
public RazorPagesSection Pages
{
get { return _pagesSet ? _pages : (RazorPagesSection)Sections["pages"]; }
set
{
_pages = value;
_pagesSet = true;
}
}
}
}