4 | You do not have a local username/password for this site. Add a local
5 | account so you can log in without an external login.
6 |
7 |
8 | @using (Html.BeginForm("Manage", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
9 | {
10 | @Html.AntiForgeryToken()
11 |
12 |
2 |
3 | @if (Model.Count > 0)
4 | {
5 | Registered Logins
6 |
34 | }
35 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/SelfHostDemo/packages/jQuery.2.1.1/Tools/install.ps1:
--------------------------------------------------------------------------------
1 | param($installPath, $toolsPath, $package, $project)
2 |
3 | . (Join-Path $toolsPath common.ps1)
4 |
5 | # VS 11 and above supports the new intellisense JS files
6 | $vsVersion = [System.Version]::Parse($dte.Version)
7 | $supportsJsIntelliSenseFile = $vsVersion.Major -ge 11
8 |
9 | if (-not $supportsJsIntelliSenseFile) {
10 | $displayVersion = $vsVersion.Major
11 | Write-Host "IntelliSense JS files are not supported by your version of Visual Studio: $displayVersion"
12 | exit
13 | }
14 |
15 | if ($scriptsFolderProjectItem -eq $null) {
16 | # No Scripts folder
17 | Write-Host "No Scripts folder found"
18 | exit
19 | }
20 |
21 | # Delete the vsdoc file from the project
22 | try {
23 | $vsDocProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("jquery-$ver-vsdoc.js")
24 | Delete-ProjectItem $vsDocProjectItem
25 | }
26 | catch {
27 | Write-Host "Error deleting vsdoc file: " + $_.Exception -ForegroundColor Red
28 | exit
29 | }
30 |
31 | # Copy the intellisense file to the project from the tools folder
32 | $intelliSenseFileSourcePath = Join-Path $toolsPath $intelliSenseFileName
33 | try {
34 | $scriptsFolderProjectItem.ProjectItems.AddFromFileCopy($intelliSenseFileSourcePath)
35 | }
36 | catch {
37 | # This will throw if the file already exists, so we need to catch here
38 | }
39 |
40 | # Update the _references.js file
41 | AddOrUpdate-Reference $scriptsFolderProjectItem $jqueryFileNameRegEx $jqueryFileName
--------------------------------------------------------------------------------
/SelfHostDemo/packages/Microsoft.AspNet.Mvc.5.1.2/Content/Web.config.install.xdt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Views/Account/ExternalLoginConfirmation.cshtml:
--------------------------------------------------------------------------------
1 | @model SelfHostDemo.Web.Models.ExternalLoginConfirmationViewModel
2 | @{
3 | ViewBag.Title = "Register";
4 | }
5 | @ViewBag.Title.
6 | Associate your @ViewBag.LoginProvider account.
7 |
8 | @using (Html.BeginForm("ExternalLoginConfirmation", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
9 | {
10 | @Html.AntiForgeryToken()
11 |
12 | Association Form
13 |
14 | @Html.ValidationSummary(true, "", new { @class = "text-danger" })
15 |
16 | You've successfully authenticated with @ViewBag.LoginProvider .
17 | Please enter a user name for this site below and click the Register button to finish
18 | logging in.
19 |
20 |
27 |
32 | }
33 |
34 | @section Scripts {
35 | @Scripts.Render("~/bundles/jqueryval")
36 | }
37 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("SelfHostDemo.Web")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("SelfHostDemo.Web")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("80148694-c569-496e-a139-9cf6b253f4bc")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Views/Account/_ChangePasswordPartial.cshtml:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNet.Identity
2 | @model SelfHostDemo.Web.Models.ManageUserViewModel
3 |
4 | You're logged in as @User.Identity.GetUserName() .
5 |
6 | @using (Html.BeginForm("Manage", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
7 | {
8 | @Html.AntiForgeryToken()
9 | Change Password Form
10 |
11 | @Html.ValidationSummary("", new { @class = "text-danger" })
12 |
18 |
24 |
30 |
31 |
36 | }
37 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Views/Account/Register.cshtml:
--------------------------------------------------------------------------------
1 | @model SelfHostDemo.Web.Models.RegisterViewModel
2 | @{
3 | ViewBag.Title = "Register";
4 | }
5 |
6 | @ViewBag.Title.
7 |
8 | @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
9 | {
10 | @Html.AntiForgeryToken()
11 | Create a new account.
12 |
13 | @Html.ValidationSummary("", new { @class = "text-danger" })
14 |
20 |
26 |
32 |
37 | }
38 |
39 | @section Scripts {
40 | @Scripts.Render("~/bundles/jqueryval")
41 | }
42 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Server/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("SelfHostDemo.Server")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("SelfHostDemo.Server")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("d3af0ed8-0157-4d5b-a785-55faa218fea0")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.30501.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SelfHostDemo.Web", "SelfHostDemo.Web\SelfHostDemo.Web.csproj", "{3431AD81-4A7F-4EE8-927D-EDED6FFBA767}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SelfHostDemo.Server", "SelfHostDemo.Server\SelfHostDemo.Server.csproj", "{EB5B8C40-FC1E-43D4-911D-00603E7D4F7B}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {3431AD81-4A7F-4EE8-927D-EDED6FFBA767}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {3431AD81-4A7F-4EE8-927D-EDED6FFBA767}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {3431AD81-4A7F-4EE8-927D-EDED6FFBA767}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {3431AD81-4A7F-4EE8-927D-EDED6FFBA767}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {EB5B8C40-FC1E-43D4-911D-00603E7D4F7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {EB5B8C40-FC1E-43D4-911D-00603E7D4F7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {EB5B8C40-FC1E-43D4-911D-00603E7D4F7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {EB5B8C40-FC1E-43D4-911D-00603E7D4F7B}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/App_Start/BundleConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Web;
2 | using System.Web.Optimization;
3 |
4 | namespace SelfHostDemo.Web
5 | {
6 | public class BundleConfig
7 | {
8 | // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
9 | public static void RegisterBundles(BundleCollection bundles)
10 | {
11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
12 | "~/Scripts/jquery-{version}.js"));
13 |
14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
15 | "~/Scripts/jquery.validate*"));
16 |
17 | // Use the development version of Modernizr to develop with and learn from. Then, when you're
18 | // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
20 | "~/Scripts/modernizr-*"));
21 |
22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
23 | "~/Scripts/bootstrap.js",
24 | "~/Scripts/respond.js"));
25 |
26 | bundles.Add(new StyleBundle("~/Content/css").Include(
27 | "~/Content/bootstrap.css",
28 | "~/Content/site.css"));
29 |
30 | // Set EnableOptimizations to false for debugging. For more information,
31 | // visit http://go.microsoft.com/fwlink/?LinkId=301862
32 | BundleTable.EnableOptimizations = true;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Views/Account/ResetPassword.cshtml:
--------------------------------------------------------------------------------
1 | @model SelfHostDemo.Web.Models.ResetPasswordViewModel
2 | @{
3 | ViewBag.Title = "Reset password";
4 | }
5 |
6 | @ViewBag.Title.
7 |
8 | @using (Html.BeginForm("ResetPassword", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
9 | {
10 | @Html.AntiForgeryToken()
11 | Reset your password.
12 |
13 | @Html.ValidationSummary("", new { @class = "text-danger" })
14 | @Html.HiddenFor(model => model.Code)
15 |
21 |
27 |
33 |
38 | }
39 |
40 | @section Scripts {
41 | @Scripts.Render("~/bundles/jqueryval")
42 | }
43 |
--------------------------------------------------------------------------------
/SelfHostDemo/packages/jQuery.2.1.1/Tools/uninstall.ps1:
--------------------------------------------------------------------------------
1 | param($installPath, $toolsPath, $package, $project)
2 |
3 | . (Join-Path $toolsPath common.ps1)
4 |
5 | # Determine the file paths
6 | $projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName
7 | $origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName
8 |
9 | if (Test-Path $projectIntelliSenseFilePath) {
10 | if ((Get-Checksum $projectIntelliSenseFilePath) -eq (Get-Checksum $origIntelliSenseFilePath)) {
11 | # The intellisense file in the project matches the file in the tools folder, delete it
12 |
13 | if ($scriptsFolderProjectItem -eq $null) {
14 | # No Scripts folder
15 | exit
16 | }
17 |
18 | try {
19 | # Get the project item for the intellisense file
20 | $intelliSenseFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item($intelliSenseFileName)
21 | }
22 | catch {
23 | # The item wasn't found
24 | exit
25 | }
26 |
27 | # Delete the project item
28 | Delete-ProjectItem $intelliSenseFileProjectItem
29 | }
30 | else {
31 | $projectScriptsFolderLeaf = Split-Path $projectScriptsFolderPath -Leaf
32 | Write-Host "Skipping '$projectScriptsFolderLeaf\$intelliSenseFileName' because it was modified." -ForegroundColor Magenta
33 | }
34 | }
35 | else {
36 | # The intellisense file was not found in project
37 | Write-Host "The intellisense file was not found in project at path $projectIntelliSenseFilePath"
38 | }
39 |
40 | # Update the _references.js file
41 | Remove-Reference $scriptsFolderProjectItem $jqueryFileNameRegEx
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Views/Shared/_Layout.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | @ViewBag.Title - My ASP.NET Application
7 | @Styles.Render("~/Content/css")
8 | @Scripts.Render("~/bundles/modernizr")
9 |
10 |
11 |
12 |
13 |
14 |
22 |
23 |
24 | @Html.ActionLink("Home", "Index", "Home")
25 | @Html.ActionLink("About", "About", "Home")
26 | @Html.ActionLink("Contact", "Contact", "Home")
27 |
28 | @Html.Partial("_LoginPartial")
29 |
30 |
31 |
32 |
33 | @RenderBody()
34 |
35 |
38 |
39 |
40 | @Scripts.Render("~/bundles/jquery")
41 | @Scripts.Render("~/bundles/bootstrap")
42 | @RenderSection("scripts", required: false)
43 |
44 |
45 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Views/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Views/Home/Index.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewBag.Title = "Help Ticket Management";
3 | }
4 |
5 |
6 |
7 |
Add a New Ticket
8 |
Title
9 |
10 |
Description
11 |
12 |
Add Ticket
13 |
14 |
15 |
16 |
17 |
Current Tickets
18 |
19 |
20 |
21 |
22 |
23 | @section Scripts
24 | {
25 |
26 |
27 |
28 |
51 | }
--------------------------------------------------------------------------------
/SelfHostDemo/packages/Microsoft.AspNet.WebPages.3.1.2/Content/Web.config.install.xdt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
21 |
22 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/SelfHostDemo/packages/EntityFramework.6.1.0/tools/about_EntityFramework.help.txt:
--------------------------------------------------------------------------------
1 | TOPIC
2 | about_EntityFramework
3 |
4 | SHORT DESCRIPTION
5 | Provides information about Entity Framework commands.
6 |
7 | LONG DESCRIPTION
8 | This topic describes the Entity Framework commands. Entity Framework is
9 | Microsoft's recommended data access technology for new applications.
10 |
11 | The following Entity Framework cmdlets are used with Entity Framework
12 | Migrations.
13 |
14 | Cmdlet Description
15 | ----------------- ---------------------------------------------------
16 | Enable-Migrations Enables Code First Migrations in a project.
17 |
18 | Add-Migration Scaffolds a migration script for any pending model
19 | changes.
20 |
21 | Update-Database Applies any pending migrations to the database.
22 |
23 | Get-Migrations Displays the migrations that have been applied to
24 | the target database.
25 |
26 | The following Entity Framework cmdlets are used by NuGet packages that
27 | install Entity Framework providers. These commands are not usually used as
28 | part of normal application development.
29 |
30 | Cmdlet Description
31 | ------------------------------ ---------------------------------------
32 | Add-EFProvider Adds or updates an Entity Framework
33 | provider entry in the project config
34 | file.
35 |
36 | Add-EFDefaultConnectionFactory Adds or updates an Entity Framework
37 | default connection factory in the
38 | project config file.
39 |
40 | Initialize-EFConfiguration Initializes the Entity Framework
41 | section in the project config file and
42 | sets defaults.
43 |
44 | SEE ALSO
45 | Enable-Migrations
46 | Add-Migration
47 | Update-Database
48 | Get-Migrations
49 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/App_Start/Startup.Auth.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNet.Identity;
2 | using Microsoft.AspNet.Identity.EntityFramework;
3 | using Microsoft.AspNet.Identity.Owin;
4 | using Microsoft.Owin;
5 | using Microsoft.Owin.Security.Cookies;
6 | using Microsoft.Owin.Security.DataProtection;
7 | using Microsoft.Owin.Security.Google;
8 | using Owin;
9 | using System;
10 | using SelfHostDemo.Web.Models;
11 |
12 | namespace SelfHostDemo.Web
13 | {
14 | public partial class Startup
15 | {
16 | // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
17 | public void ConfigureAuth(IAppBuilder app)
18 | {
19 | // Configure the db context and user manager to use a single instance per request
20 | app.CreatePerOwinContext(ApplicationDbContext.Create);
21 | app.CreatePerOwinContext(ApplicationUserManager.Create);
22 |
23 | // Enable the application to use a cookie to store information for the signed in user
24 | // and to use a cookie to temporarily store information about a user logging in with a third party login provider
25 | // Configure the sign in cookie
26 | app.UseCookieAuthentication(new CookieAuthenticationOptions
27 | {
28 | AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
29 | LoginPath = new PathString("/Account/Login"),
30 | Provider = new CookieAuthenticationProvider
31 | {
32 | OnValidateIdentity = SecurityStampValidator.OnValidateIdentity(
33 | validateInterval: TimeSpan.FromMinutes(30),
34 | regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
35 | }
36 | });
37 |
38 | app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
39 |
40 | // Uncomment the following lines to enable logging in with third party login providers
41 | //app.UseMicrosoftAccountAuthentication(
42 | // clientId: "",
43 | // clientSecret: "");
44 |
45 | //app.UseTwitterAuthentication(
46 | // consumerKey: "",
47 | // consumerSecret: "");
48 |
49 | //app.UseFacebookAuthentication(
50 | // appId: "",
51 | // appSecret: "");
52 |
53 | //app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
54 | //{
55 | // ClientId = "",
56 | // ClientSecret = ""
57 | //});
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Views/Account/Login.cshtml:
--------------------------------------------------------------------------------
1 | @using SelfHostDemo.Web.Models
2 | @model LoginViewModel
3 |
4 | @{
5 | ViewBag.Title = "Log in";
6 | }
7 |
8 | @ViewBag.Title.
9 |
61 | @section Scripts {
62 | @Scripts.Render("~/bundles/jqueryval")
63 | }
--------------------------------------------------------------------------------
/SelfHostDemo/packages/Modernizr.2.7.2/Tools/common.ps1:
--------------------------------------------------------------------------------
1 | function AddOrUpdate-Reference($scriptsFolderProjectItem, $fileNamePattern, $newFileName) {
2 | try {
3 | $referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
4 | }
5 | catch {
6 | # _references.js file not found
7 | return
8 | }
9 |
10 | if ($referencesFileProjectItem -eq $null) {
11 | # _references.js file not found
12 | return
13 | }
14 |
15 | $referencesFilePath = $referencesFileProjectItem.FileNames(1)
16 | $referencesTempFilePath = Join-Path $env:TEMP "_references.tmp.js"
17 |
18 | if ((Select-String $referencesFilePath -pattern $fileNamePattern).Length -eq 0) {
19 | # File has no existing matching reference line
20 | # Add the full reference line to the beginning of the file
21 | "/// " | Add-Content $referencesTempFilePath -Encoding UTF8
22 | Get-Content $referencesFilePath | Add-Content $referencesTempFilePath
23 | }
24 | else {
25 | # Loop through file and replace old file name with new file name
26 | Get-Content $referencesFilePath | ForEach-Object { $_ -replace $fileNamePattern, $newFileName } > $referencesTempFilePath
27 | }
28 |
29 | # Copy over the new _references.js file
30 | Copy-Item $referencesTempFilePath $referencesFilePath -Force
31 | Remove-Item $referencesTempFilePath -Force
32 | }
33 |
34 | function Remove-Reference($scriptsFolderProjectItem, $fileNamePattern) {
35 | try {
36 | $referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
37 | }
38 | catch {
39 | # _references.js file not found
40 | return
41 | }
42 |
43 | if ($referencesFileProjectItem -eq $null) {
44 | return
45 | }
46 |
47 | $referencesFilePath = $referencesFileProjectItem.FileNames(1)
48 | $referencesTempFilePath = Join-Path $env:TEMP "_references.tmp.js"
49 |
50 | if ((Select-String $referencesFilePath -pattern $fileNamePattern).Length -eq 1) {
51 | # Delete the line referencing the file
52 | Get-Content $referencesFilePath | ForEach-Object { if (-not ($_ -match $fileNamePattern)) { $_ } } > $referencesTempFilePath
53 |
54 | # Copy over the new _references.js file
55 | Copy-Item $referencesTempFilePath $referencesFilePath -Force
56 | Remove-Item $referencesTempFilePath -Force
57 | }
58 | }
59 |
60 | # Extract the version number from the file in the package's content\scripts folder
61 | $packageScriptsFolder = Join-Path $installPath Content\Scripts
62 | $modernizrFileName = Join-Path $packageScriptsFolder "modernizr-*.js" | Get-ChildItem -Exclude "*.min.js","*-vsdoc.js" | Split-Path -Leaf
63 | $modernizrFileNameRegEx = "modernizr-((?:\d+\.)?(?:\d+\.)?(?:\d+\.)?(?:\d+)).js"
64 | $modernizrFileName -match $modernizrFileNameRegEx
65 | $ver = $matches[1]
66 |
67 | # Get the project item for the scripts folder
68 | try {
69 | $scriptsFolderProjectItem = $project.ProjectItems.Item("Scripts")
70 | $projectScriptsFolderPath = $scriptsFolderProjectItem.FileNames(1)
71 | }
72 | catch {
73 | # No Scripts folder
74 | Write-Host "No scripts folder found"
75 | }
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/App_Start/IdentityConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Microsoft.AspNet.Identity;
3 | using Microsoft.AspNet.Identity.EntityFramework;
4 | using Microsoft.AspNet.Identity.Owin;
5 | using Microsoft.Owin;
6 | using SelfHostDemo.Web.Models;
7 |
8 | namespace SelfHostDemo.Web
9 | {
10 | // Configure the application user manager used in this application. UserManager is defined in ASP.NET Identity and is used by the application.
11 |
12 | public class ApplicationUserManager : UserManager
13 | {
14 | public ApplicationUserManager(IUserStore store)
15 | : base(store)
16 | {
17 | }
18 |
19 | public static ApplicationUserManager Create(IdentityFactoryOptions options, IOwinContext context)
20 | {
21 | var manager = new ApplicationUserManager(new UserStore(context.Get()));
22 | // Configure validation logic for usernames
23 | manager.UserValidator = new UserValidator(manager)
24 | {
25 | AllowOnlyAlphanumericUserNames = false,
26 | RequireUniqueEmail = true
27 | };
28 | // Configure validation logic for passwords
29 | manager.PasswordValidator = new PasswordValidator
30 | {
31 | RequiredLength = 6,
32 | RequireNonLetterOrDigit = true,
33 | RequireDigit = true,
34 | RequireLowercase = true,
35 | RequireUppercase = true,
36 | };
37 | // Register two factor authentication providers. This application uses Phone and Emails as a step of receiving a code for verifying the user
38 | // You can write your own provider and plug in here.
39 | manager.RegisterTwoFactorProvider("PhoneCode", new PhoneNumberTokenProvider
40 | {
41 | MessageFormat = "Your security code is: {0}"
42 | });
43 | manager.RegisterTwoFactorProvider("EmailCode", new EmailTokenProvider
44 | {
45 | Subject = "Security Code",
46 | BodyFormat = "Your security code is: {0}"
47 | });
48 | manager.EmailService = new EmailService();
49 | manager.SmsService = new SmsService();
50 | var dataProtectionProvider = options.DataProtectionProvider;
51 | if (dataProtectionProvider != null)
52 | {
53 | manager.UserTokenProvider = new DataProtectorTokenProvider(dataProtectionProvider.Create("ASP.NET Identity"));
54 | }
55 | return manager;
56 | }
57 | }
58 |
59 | public class EmailService : IIdentityMessageService
60 | {
61 | public Task SendAsync(IdentityMessage message)
62 | {
63 | // Plug in your email service here to send an email.
64 | return Task.FromResult(0);
65 | }
66 | }
67 |
68 | public class SmsService : IIdentityMessageService
69 | {
70 | public Task SendAsync(IdentityMessage message)
71 | {
72 | // Plug in your sms service here to send a text message.
73 | return Task.FromResult(0);
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/SelfHostDemo/packages/Microsoft.AspNet.SignalR.SelfHost.2.0.3/readme.txt:
--------------------------------------------------------------------------------
1 | Please see http://go.microsoft.com/fwlink/?LinkId=272764 for more information on using SignalR.
2 |
3 | Upgrading from 1.x to 2.0
4 | -------------------------
5 | Please see http://go.microsoft.com/fwlink/?LinkId=320578 for more information on how to
6 | upgrade your SignalR 1.x application to 2.0.
7 |
8 | Mapping the Hubs connection
9 | ----------------------------------------
10 | SignalR Hubs will not work without a Hub route being configured. To register the default Hubs route, create a class called Startup
11 | with the signature below and call app.MapSignalR() in your application's Configuration method. e.g.:
12 |
13 | using Microsoft.AspNet.SignalR;
14 | using Owin;
15 |
16 | namespace MyWebApplication
17 | {
18 | public class Startup
19 | {
20 | public void Configuration(IAppBuilder app)
21 | {
22 | app.MapSignalR();
23 | }
24 | }
25 | }
26 |
27 | Enabling cross-domain requests
28 | ---------------------------------------
29 | To enable CORS requests, Install-Package Microsoft.Owin.Cors and change the startup class to look like the following:
30 |
31 | using Microsoft.AspNet.SignalR;
32 | using Microsoft.Owin.Cors;
33 | using Owin;
34 |
35 | namespace MyWebApplication
36 | {
37 | public class Startup
38 | {
39 | public void Configuration(IAppBuilder app)
40 | {
41 | app.Map("/signalr", map =>
42 | {
43 | // Setup the cors middleware to run before SignalR.
44 | // By default this will allow all origins. You can
45 | // configure the set of origins and/or http verbs by
46 | // providing a cors options with a different policy.
47 | map.UseCors(CorsOptions.AllowAll);
48 |
49 | var hubConfiguration = new HubConfiguration
50 | {
51 | // You can enable JSONP by uncommenting line below.
52 | // JSONP requests are insecure but some older browsers (and some
53 | // versions of IE) require JSONP to work cross domain
54 | // EnableJSONP = true
55 | };
56 |
57 | // Run the SignalR pipeline. We're not using MapSignalR
58 | // since this branch is already runs under the "/signalr"
59 | // path.
60 | map.RunSignalR(hubConfiguration);
61 | });
62 | }
63 | }
64 | }
65 |
66 |
67 |
68 | Starting the Web server
69 | --------------------------------
70 | To start the web server, call WebApp.Start(endpoint). You should now be able to navigate to endpoint/signalr/hubs in your browser.
71 |
72 | using System;
73 | using Microsoft.Owin.Hosting;
74 |
75 | namespace MyWebApplication
76 | {
77 | public class Program
78 | {
79 | static void Main(string[] args)
80 | {
81 | // This will *ONLY* bind to localhost, if you want to bind to all addresses
82 | // use http://*:8080 or http://+:8080 to bind to all addresses.
83 | // See http://msdn.microsoft.com/en-us/library/system.net.httplistener.aspx
84 | // for more information.
85 |
86 | using (WebApp.Start("http://localhost:8080/"))
87 | {
88 | Console.WriteLine("Server running at http://localhost:8080/");
89 | Console.ReadLine();
90 | }
91 | }
92 | }
93 | }
94 |
95 |
--------------------------------------------------------------------------------
/SelfHostDemo/packages/Newtonsoft.Json.6.0.3/tools/install.ps1:
--------------------------------------------------------------------------------
1 | param($installPath, $toolsPath, $package, $project)
2 |
3 | # open json.net splash page on package install
4 | # don't open if json.net is installed as a dependency
5 |
6 | try
7 | {
8 | $url = "http://james.newtonking.com/json"
9 | $dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
10 |
11 | if ($dte2.ActiveWindow.Caption -eq "Package Manager Console")
12 | {
13 | # user is installing from VS NuGet console
14 | # get reference to the window, the console host and the input history
15 | # show webpage if "install-package newtonsoft.json" was last input
16 |
17 | $consoleWindow = $(Get-VSComponentModel).GetService([NuGetConsole.IPowerConsoleWindow])
18 |
19 | $props = $consoleWindow.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor `
20 | [System.Reflection.BindingFlags]::NonPublic)
21 |
22 | $prop = $props | ? { $_.Name -eq "ActiveHostInfo" } | select -first 1
23 | if ($prop -eq $null) { return }
24 |
25 | $hostInfo = $prop.GetValue($consoleWindow)
26 | if ($hostInfo -eq $null) { return }
27 |
28 | $history = $hostInfo.WpfConsole.InputHistory.History
29 |
30 | $lastCommand = $history | select -last 1
31 |
32 | if ($lastCommand)
33 | {
34 | $lastCommand = $lastCommand.Trim().ToLower()
35 | if ($lastCommand.StartsWith("install-package") -and $lastCommand.Contains("newtonsoft.json"))
36 | {
37 | $dte2.ItemOperations.Navigate($url) | Out-Null
38 | }
39 | }
40 | }
41 | else
42 | {
43 | # user is installing from VS NuGet dialog
44 | # get reference to the window, then smart output console provider
45 | # show webpage if messages in buffered console contains "installing...newtonsoft.json" in last operation
46 |
47 | $instanceField = [NuGet.Dialog.PackageManagerWindow].GetField("CurrentInstance", [System.Reflection.BindingFlags]::Static -bor `
48 | [System.Reflection.BindingFlags]::NonPublic)
49 | $consoleField = [NuGet.Dialog.PackageManagerWindow].GetField("_smartOutputConsoleProvider", [System.Reflection.BindingFlags]::Instance -bor `
50 | [System.Reflection.BindingFlags]::NonPublic)
51 | if ($instanceField -eq $null -or $consoleField -eq $null) { return }
52 |
53 | $instance = $instanceField.GetValue($null)
54 | if ($instance -eq $null) { return }
55 |
56 | $consoleProvider = $consoleField.GetValue($instance)
57 | if ($consoleProvider -eq $null) { return }
58 |
59 | $console = $consoleProvider.CreateOutputConsole($false)
60 |
61 | $messagesField = $console.GetType().GetField("_messages", [System.Reflection.BindingFlags]::Instance -bor `
62 | [System.Reflection.BindingFlags]::NonPublic)
63 | if ($messagesField -eq $null) { return }
64 |
65 | $messages = $messagesField.GetValue($console)
66 | if ($messages -eq $null) { return }
67 |
68 | $operations = $messages -split "=============================="
69 |
70 | $lastOperation = $operations | select -last 1
71 |
72 | if ($lastOperation)
73 | {
74 | $lastOperation = $lastOperation.ToLower()
75 |
76 | $lines = $lastOperation -split "`r`n"
77 |
78 | $installMatch = $lines | ? { $_.StartsWith("------- installing...newtonsoft.json ") } | select -first 1
79 |
80 | if ($installMatch)
81 | {
82 | $dte2.ItemOperations.Navigate($url) | Out-Null
83 | }
84 | }
85 | }
86 | }
87 | catch
88 | {
89 | # stop potential errors from bubbling up
90 | # worst case the splash page won't open
91 | }
92 |
93 | # yolo
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Models/AccountViewModels.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace SelfHostDemo.Web.Models
4 | {
5 | public class ExternalLoginConfirmationViewModel
6 | {
7 | [Required]
8 | [EmailAddress]
9 | [Display(Name = "Email")]
10 | public string Email { get; set; }
11 | }
12 |
13 | public class ExternalLoginListViewModel
14 | {
15 | public string Action { get; set; }
16 | public string ReturnUrl { get; set; }
17 | }
18 |
19 | public class ManageUserViewModel
20 | {
21 | [Required]
22 | [DataType(DataType.Password)]
23 | [Display(Name = "Current password")]
24 | public string OldPassword { get; set; }
25 |
26 | [Required]
27 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
28 | [DataType(DataType.Password)]
29 | [Display(Name = "New password")]
30 | public string NewPassword { get; set; }
31 |
32 | [DataType(DataType.Password)]
33 | [Display(Name = "Confirm new password")]
34 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
35 | public string ConfirmPassword { get; set; }
36 | }
37 |
38 | public class LoginViewModel
39 | {
40 | [Required]
41 | [EmailAddress]
42 | [Display(Name = "Email")]
43 | public string Email { get; set; }
44 |
45 | [Required]
46 | [DataType(DataType.Password)]
47 | [Display(Name = "Password")]
48 | public string Password { get; set; }
49 |
50 | [Display(Name = "Remember me?")]
51 | public bool RememberMe { get; set; }
52 | }
53 |
54 | public class RegisterViewModel
55 | {
56 | [Required]
57 | [EmailAddress]
58 | [Display(Name = "Email")]
59 | public string Email { get; set; }
60 |
61 | [Required]
62 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
63 | [DataType(DataType.Password)]
64 | [Display(Name = "Password")]
65 | public string Password { get; set; }
66 |
67 | [DataType(DataType.Password)]
68 | [Display(Name = "Confirm password")]
69 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
70 | public string ConfirmPassword { get; set; }
71 | }
72 |
73 | public class ResetPasswordViewModel
74 | {
75 | [Required]
76 | [EmailAddress]
77 | [Display(Name = "Email")]
78 | public string Email { get; set; }
79 |
80 | [Required]
81 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
82 | [DataType(DataType.Password)]
83 | [Display(Name = "Password")]
84 | public string Password { get; set; }
85 |
86 | [DataType(DataType.Password)]
87 | [Display(Name = "Confirm password")]
88 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
89 | public string ConfirmPassword { get; set; }
90 |
91 | public string Code { get; set; }
92 | }
93 |
94 | public class ForgotPasswordViewModel
95 | {
96 | [Required]
97 | [EmailAddress]
98 | [Display(Name = "Email")]
99 | public string Email { get; set; }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #################
2 | ## Eclipse
3 | #################
4 |
5 | *.pydevproject
6 | .project
7 | .metadata
8 | bin/
9 | tmp/
10 | *.tmp
11 | *.bak
12 | *.swp
13 | *~.nib
14 | local.properties
15 | .classpath
16 | .settings/
17 | .loadpath
18 |
19 | # External tool builders
20 | .externalToolBuilders/
21 |
22 | # Locally stored "Eclipse launch configurations"
23 | *.launch
24 |
25 | # CDT-specific
26 | .cproject
27 |
28 | # PDT-specific
29 | .buildpath
30 |
31 |
32 | #################
33 | ## Visual Studio
34 | #################
35 |
36 | ## Ignore Visual Studio temporary files, build results, and
37 | ## files generated by popular Visual Studio add-ons.
38 |
39 | # User-specific files
40 | *.suo
41 | *.user
42 | *.sln.docstates
43 |
44 | # Build results
45 |
46 | [Dd]ebug/
47 | [Rr]elease/
48 | x64/
49 | build/
50 | [Bb]in/
51 | [Oo]bj/
52 |
53 | # MSTest test Results
54 | [Tt]est[Rr]esult*/
55 | [Bb]uild[Ll]og.*
56 |
57 | *_i.c
58 | *_p.c
59 | *.ilk
60 | *.meta
61 | *.obj
62 | *.pch
63 | *.pdb
64 | *.pgc
65 | *.pgd
66 | *.rsp
67 | *.sbr
68 | *.tlb
69 | *.tli
70 | *.tlh
71 | *.tmp
72 | *.tmp_proj
73 | *.log
74 | *.vspscc
75 | *.vssscc
76 | .builds
77 | *.pidb
78 | *.log
79 | *.scc
80 |
81 | # Visual C++ cache files
82 | ipch/
83 | *.aps
84 | *.ncb
85 | *.opensdf
86 | *.sdf
87 | *.cachefile
88 |
89 | # Visual Studio profiler
90 | *.psess
91 | *.vsp
92 | *.vspx
93 |
94 | # Guidance Automation Toolkit
95 | *.gpState
96 |
97 | # ReSharper is a .NET coding add-in
98 | _ReSharper*/
99 | *.[Rr]e[Ss]harper
100 |
101 | # TeamCity is a build add-in
102 | _TeamCity*
103 |
104 | # DotCover is a Code Coverage Tool
105 | *.dotCover
106 |
107 | # NCrunch
108 | *.ncrunch*
109 | .*crunch*.local.xml
110 |
111 | # Installshield output folder
112 | [Ee]xpress/
113 |
114 | # DocProject is a documentation generator add-in
115 | DocProject/buildhelp/
116 | DocProject/Help/*.HxT
117 | DocProject/Help/*.HxC
118 | DocProject/Help/*.hhc
119 | DocProject/Help/*.hhk
120 | DocProject/Help/*.hhp
121 | DocProject/Help/Html2
122 | DocProject/Help/html
123 |
124 | # Click-Once directory
125 | publish/
126 |
127 | # Publish Web Output
128 | *.Publish.xml
129 | *.pubxml
130 |
131 | # NuGet Packages Directory
132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line
133 | #packages/
134 |
135 | # Windows Azure Build Output
136 | csx
137 | *.build.csdef
138 |
139 | # Windows Store app package directory
140 | AppPackages/
141 |
142 | # Others
143 | sql/
144 | *.Cache
145 | ClientBin/
146 | [Ss]tyle[Cc]op.*
147 | ~$*
148 | *~
149 | *.dbmdl
150 | *.[Pp]ublish.xml
151 | *.pfx
152 | *.publishsettings
153 |
154 | # RIA/Silverlight projects
155 | Generated_Code/
156 |
157 | # Backup & report files from converting an old project file to a newer
158 | # Visual Studio version. Backup files are not needed, because we have git ;-)
159 | _UpgradeReport_Files/
160 | Backup*/
161 | UpgradeLog*.XML
162 | UpgradeLog*.htm
163 |
164 | # SQL Server files
165 | App_Data/*.mdf
166 | App_Data/*.ldf
167 |
168 | #############
169 | ## Windows detritus
170 | #############
171 |
172 | # Windows image file caches
173 | Thumbs.db
174 | ehthumbs.db
175 |
176 | # Folder config file
177 | Desktop.ini
178 |
179 | # Recycle Bin used on file shares
180 | $RECYCLE.BIN/
181 |
182 | # Mac crap
183 | .DS_Store
184 |
185 |
186 | #############
187 | ## Python
188 | #############
189 |
190 | *.py[co]
191 |
192 | # Packages
193 | *.egg
194 | *.egg-info
195 | dist/
196 | build/
197 | eggs/
198 | parts/
199 | var/
200 | sdist/
201 | develop-eggs/
202 | .installed.cfg
203 |
204 | # Installer logs
205 | pip-log.txt
206 |
207 | # Unit test / coverage reports
208 | .coverage
209 | .tox
210 |
211 | #Translations
212 | *.mo
213 |
214 | #Mr Developer
215 | .mr.developer.cfg
216 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Scripts/respond.min.js:
--------------------------------------------------------------------------------
1 | /*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
2 | * Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
3 | * */
4 |
5 | !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b #mq-test-1 { width: 42px; }',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b " | Add-Content $referencesTempFilePath -Encoding UTF8
44 | Get-Content $referencesFilePath | Add-Content $referencesTempFilePath
45 | }
46 | else {
47 | # Loop through file and replace old file name with new file name
48 | Get-Content $referencesFilePath | ForEach-Object { $_ -replace $fileNamePattern, $newFileName } > $referencesTempFilePath
49 | }
50 |
51 | # Copy over the new _references.js file
52 | Copy-Item $referencesTempFilePath $referencesFilePath -Force
53 | Remove-Item $referencesTempFilePath -Force
54 | }
55 |
56 | function Remove-Reference($scriptsFolderProjectItem, $fileNamePattern) {
57 | try {
58 | $referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
59 | }
60 | catch {
61 | # _references.js file not found
62 | return
63 | }
64 |
65 | if ($referencesFileProjectItem -eq $null) {
66 | return
67 | }
68 |
69 | $referencesFilePath = $referencesFileProjectItem.FileNames(1)
70 | $referencesTempFilePath = Join-Path $env:TEMP "_references.tmp.js"
71 |
72 | if ((Select-String $referencesFilePath -pattern $fileNamePattern).Length -eq 1) {
73 | # Delete the line referencing the file
74 | Get-Content $referencesFilePath | ForEach-Object { if (-not ($_ -match $fileNamePattern)) { $_ } } > $referencesTempFilePath
75 |
76 | # Copy over the new _references.js file
77 | Copy-Item $referencesTempFilePath $referencesFilePath -Force
78 | Remove-Item $referencesTempFilePath -Force
79 | }
80 | }
81 |
82 | function Delete-ProjectItem($item) {
83 | $itemDeleted = $false
84 | for ($1=1; $i -le 5; $i++) {
85 | try {
86 | $item.Delete()
87 | $itemDeleted = $true
88 | break
89 | }
90 | catch {
91 | # Try again in 200ms
92 | [System.Threading.Thread]::Sleep(200)
93 | }
94 | }
95 | if ($itemDeleted -eq $false) {
96 | throw "Unable to delete project item after five attempts."
97 | }
98 | }
99 |
100 | # Extract the version number from the jquery file in the package's content\scripts folder
101 | $packageScriptsFolder = Join-Path $installPath Content\Scripts
102 | $jqueryFileName = Join-Path $packageScriptsFolder "jquery-*.js" | Get-ChildItem -Exclude "*.min.js","*-vsdoc.js" | Split-Path -Leaf
103 | $jqueryFileNameRegEx = "jquery-((?:\d+\.)?(?:\d+\.)?(?:\d+\.)?(?:\d+)).js"
104 | $jqueryFileName -match $jqueryFileNameRegEx
105 | $ver = $matches[1]
106 |
107 | $intelliSenseFileName = "jquery-$ver.intellisense.js"
108 |
109 | # Get the project item for the scripts folder
110 | try {
111 | $scriptsFolderProjectItem = $project.ProjectItems.Item("Scripts")
112 | $projectScriptsFolderPath = $scriptsFolderProjectItem.FileNames(1)
113 | }
114 | catch {
115 | # No Scripts folder
116 | Write-Host "No scripts folder found"
117 | }
--------------------------------------------------------------------------------
/SelfHostDemo/packages/Microsoft.Owin.Cors.2.1.0/lib/net45/Microsoft.Owin.Cors.XML:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Microsoft.Owin.Cors
5 |
6 |
7 |
8 |
9 | Extension methods for adding CorsMiddleware to an application pipeline.
10 |
11 |
12 |
13 |
14 | Adds a CORS middleware to your web application pipeline to allow cross domain requests.
15 |
16 | The IAppBuilder passed to your configuration method
17 | An options class that controls the middleware behavior
18 | The original app parameter
19 |
20 |
21 |
22 | Processes requests according to the provided cross domain policy.
23 |
24 |
25 |
26 |
27 | Creates a new instance of CorsMiddleware.
28 |
29 |
30 |
31 |
32 |
33 |
34 | Evaluates and applies the CORS policy. Responses will be generated for preflight requests.
35 | Requests that are permitted by the CORS policy will be passed onto the next middleware.
36 |
37 |
38 |
39 |
40 |
41 |
42 | Contains the options used by the CorsMiddleware
43 |
44 |
45 |
46 |
47 | A policy that allows all headers, all methods, any origin and supports credentials
48 |
49 |
50 |
51 |
52 | The cors policy to apply
53 |
54 |
55 |
56 |
57 | The cors engine
58 |
59 |
60 |
61 |
62 | A pluggable CORS policy provider that always returns null by default.
63 |
64 |
65 |
66 |
67 | Defines how to select a CORS policy for a given request.
68 |
69 |
70 |
71 |
72 | Selects a CORS policy to apply for the given request.
73 |
74 |
75 | The CORS policy to apply to the request, or null if no policy applies and
76 | the request should be passed through to the next middleware.
77 |
78 |
79 |
80 | Creates a new CorsPolicyProvider instance.
81 |
82 |
83 |
84 |
85 | Executes the PolicyResolver unless overridden by a subclass.
86 |
87 |
88 |
89 |
90 |
91 |
92 | A pluggable callback that will be used to select the CORS policy for the given requests.
93 |
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Server/SelfHostDemo.Server.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {EB5B8C40-FC1E-43D4-911D-00603E7D4F7B}
8 | Exe
9 | Properties
10 | SelfHostDemo.Server
11 | SelfHostDemo.Server
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 | ..\packages\Microsoft.AspNet.SignalR.Core.2.0.3\lib\net45\Microsoft.AspNet.SignalR.Core.dll
37 |
38 |
39 | ..\packages\Microsoft.Owin.2.1.0\lib\net45\Microsoft.Owin.dll
40 |
41 |
42 | ..\packages\Microsoft.Owin.Cors.2.1.0\lib\net45\Microsoft.Owin.Cors.dll
43 |
44 |
45 | ..\packages\Microsoft.Owin.Diagnostics.2.0.1\lib\net40\Microsoft.Owin.Diagnostics.dll
46 |
47 |
48 | ..\packages\Microsoft.Owin.Host.HttpListener.2.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll
49 |
50 |
51 | ..\packages\Microsoft.Owin.Hosting.2.0.1\lib\net45\Microsoft.Owin.Hosting.dll
52 |
53 |
54 | ..\packages\Microsoft.Owin.Security.2.0.1\lib\net45\Microsoft.Owin.Security.dll
55 |
56 |
57 | ..\packages\Newtonsoft.Json.5.0.1\lib\net45\Newtonsoft.Json.dll
58 |
59 |
60 | ..\packages\Owin.1.0\lib\net40\Owin.dll
61 |
62 |
63 |
64 |
65 | ..\packages\Microsoft.AspNet.Cors.5.0.0\lib\net45\System.Web.Cors.dll
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
92 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Scripts/respond.matchmedia.addListener.min.js:
--------------------------------------------------------------------------------
1 | /*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
2 | * Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
3 | * */
4 |
5 | !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";if(a.matchMedia&&a.matchMedia("all").addListener)return!1;var b=a.matchMedia,c=b("only all").matches,d=!1,e=0,f=[],g=function(){a.clearTimeout(e),e=a.setTimeout(function(){for(var c=0,d=f.length;d>c;c++){var e=f[c].mql,g=f[c].listeners||[],h=b(e.media).matches;if(h!==e.matches){e.matches=h;for(var i=0,j=g.length;j>i;i++)g[i].call(a,e)}}},30)};a.matchMedia=function(e){var h=b(e),i=[],j=0;return h.addListener=function(b){c&&(d||(d=!0,a.addEventListener("resize",g,!0)),0===j&&(j=f.push({mql:h,listeners:i})),i.push(b))},h.removeListener=function(a){for(var b=0,c=i.length;c>b;b++)i[b]===a&&i.splice(b,1)},h}}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b #mq-test-1 { width: 42px; }',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";if(a.matchMedia&&a.matchMedia("all").addListener)return!1;var b=a.matchMedia,c=b("only all").matches,d=!1,e=0,f=[],g=function(){a.clearTimeout(e),e=a.setTimeout(function(){for(var c=0,d=f.length;d>c;c++){var e=f[c].mql,g=f[c].listeners||[],h=b(e.media).matches;if(h!==e.matches){e.matches=h;for(var i=0,j=g.length;j>i;i++)g[i].call(a,e)}}},30)};a.matchMedia=function(e){var h=b(e),i=[],j=0;return h.addListener=function(b){c&&(d||(d=!0,a.addEventListener("resize",g,!0)),0===j&&(j=f.push({mql:h,listeners:i})),i.push(b))},h.removeListener=function(a){for(var b=0,c=i.length;c>b;b++)i[b]===a&&i.splice(b,1)},h}}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b
2 |
3 |
4 | System.Web.WebPages.Deployment
5 |
6 |
7 |
8 | Provides a registration point for pre-application start code for Web Pages deployment.
9 |
10 |
11 | Registers pre-application start code for Web Pages deployment.
12 |
13 |
14 | This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides methods that are used to get deployment information about the Web application.
15 |
16 |
17 | This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the assembly path for the Web Pages deployment.
18 | The assembly path for the Web Pages deployment.
19 | The Web Pages version.
20 |
21 |
22 | This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the Web Pages version from the given binary path.
23 | The Web Pages version.
24 | The binary path for the Web Pages.
25 |
26 |
27 | This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the assembly references from the given path regardless of the Web Pages version.
28 | The dictionary containing the assembly references of the Web Pages and its version.
29 | The path to the Web Pages application.
30 |
31 |
32 | This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the maximum version of the Web Pages loaded assemblies.
33 | The maximum version of the Web Pages loaded assemblies.
34 |
35 |
36 | Gets the Web Pages version from the given path.
37 | The Web Pages version.
38 | The path of the root directory for the application.
39 |
40 |
41 | This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the Web Pages version using the configuration settings with the specified path.
42 | The Web Pages version.
43 | The path to the application settings.
44 |
45 |
46 | This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the assemblies for this Web Pages deployment.
47 | A list containing the assemblies for this Web Pages deployment.
48 |
49 |
50 | This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the Web Pages deployment is enabled.
51 | true if the Web Pages deployment is enabled; otherwise, false.
52 | The path to the Web Pages deployment.
53 |
54 |
55 | This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the Web Pages deployment is explicitly disabled.
56 | true if the Web Pages deployment is explicitly disabled; otherwise, false.
57 | The path to the Web Pages deployment.
58 |
59 |
60 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Scripts/jquery.validate.unobtrusive.min.js:
--------------------------------------------------------------------------------
1 | /* NUGET: BEGIN LICENSE TEXT
2 | *
3 | * Microsoft grants you the right to use these script files for the sole
4 | * purpose of either: (i) interacting through your browser with the Microsoft
5 | * website or online service, subject to the applicable licensing or use
6 | * terms; or (ii) using the files as included with a Microsoft product subject
7 | * to that product's license terms. Microsoft reserves all other rights to the
8 | * files not expressly granted by Microsoft, whether by implication, estoppel
9 | * or otherwise. Insofar as a script file is dual licensed under GPL,
10 | * Microsoft neither took the code under GPL nor distributes it thereunder but
11 | * under the terms set out in this paragraph. All notices and licenses
12 | * below are for informational purposes only.
13 | *
14 | * NUGET: END LICENSE TEXT */
15 | /*
16 | ** Unobtrusive validation support library for jQuery and jQuery Validate
17 | ** Copyright (C) Microsoft Corporation. All rights reserved.
18 | */
19 | (function(a){var d=a.validator,b,e="unobtrusiveValidation";function c(a,b,c){a.rules[b]=c;if(a.message)a.messages[b]=a.message}function j(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function f(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function h(a){return a.substr(0,a.lastIndexOf(".")+1)}function g(a,b){if(a.indexOf("*.")===0)a=a.replace("*.",b);return a}function m(c,e){var b=a(this).find("[data-valmsg-for='"+f(e[0].name)+"']"),d=b.attr("data-valmsg-replace"),g=d?a.parseJSON(d)!==false:null;b.removeClass("field-validation-valid").addClass("field-validation-error");c.data("unobtrusiveContainer",b);if(g){b.empty();c.removeClass("input-validation-error").appendTo(b)}else c.hide()}function l(e,d){var c=a(this).find("[data-valmsg-summary=true]"),b=c.find("ul");if(b&&b.length&&d.errorList.length){b.empty();c.addClass("validation-summary-errors").removeClass("validation-summary-valid");a.each(d.errorList,function(){a(" ").html(this.message).appendTo(b)})}}function k(d){var b=d.data("unobtrusiveContainer"),c=b.attr("data-valmsg-replace"),e=c?a.parseJSON(c):null;if(b){b.addClass("field-validation-valid").removeClass("field-validation-error");d.removeData("unobtrusiveContainer");e&&b.empty()}}function n(){var b=a(this);b.data("validator").resetForm();b.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors");b.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}function i(c){var b=a(c),d=b.data(e),f=a.proxy(n,c);if(!d){d={options:{errorClass:"input-validation-error",errorElement:"span",errorPlacement:a.proxy(m,c),invalidHandler:a.proxy(l,c),messages:{},rules:{},success:a.proxy(k,c)},attachValidation:function(){b.unbind("reset."+e,f).bind("reset."+e,f).validate(this.options)},validate:function(){b.validate();return b.valid()}};b.data(e,d)}return d}d.unobtrusive={adapters:[],parseElement:function(b,h){var d=a(b),f=d.parents("form")[0],c,e,g;if(!f)return;c=i(f);c.options.rules[b.name]=e={};c.options.messages[b.name]=g={};a.each(this.adapters,function(){var c="data-val-"+this.name,i=d.attr(c),h={};if(i!==undefined){c+="-";a.each(this.params,function(){h[this]=d.attr(c+this)});this.adapt({element:b,form:f,message:i,params:h,rules:e,messages:g})}});a.extend(e,{__dummy__:true});!h&&c.attachValidation()},parse:function(b){var c=a(b).parents("form").andSelf().add(a(b).find("form")).filter("form");a(b).find(":input").filter("[data-val=true]").each(function(){d.unobtrusive.parseElement(this,true)});c.each(function(){var a=i(this);a&&a.attachValidation()})}};b=d.unobtrusive.adapters;b.add=function(c,a,b){if(!b){b=a;a=[]}this.push({name:c,params:a,adapt:b});return this};b.addBool=function(a,b){return this.add(a,function(d){c(d,b||a,true)})};b.addMinMax=function(e,g,f,a,d,b){return this.add(e,[d||"min",b||"max"],function(b){var e=b.params.min,d=b.params.max;if(e&&d)c(b,a,[e,d]);else if(e)c(b,g,e);else d&&c(b,f,d)})};b.addSingleVal=function(a,b,d){return this.add(a,[b||"val"],function(e){c(e,d||a,e.params[b])})};d.addMethod("__dummy__",function(){return true});d.addMethod("regex",function(b,c,d){var a;if(this.optional(c))return true;a=(new RegExp(d)).exec(b);return a&&a.index===0&&a[0].length===b.length});d.addMethod("nonalphamin",function(c,d,b){var a;if(b){a=c.match(/\W/g);a=a&&a.length>=b}return a});if(d.methods.extension){b.addSingleVal("accept","mimtype");b.addSingleVal("extension","extension")}else b.addSingleVal("extension","extension","accept");b.addSingleVal("regex","pattern");b.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");b.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range");b.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength");b.add("equalto",["other"],function(b){var i=h(b.element.name),j=b.params.other,d=g(j,i),e=a(b.form).find(":input").filter("[name='"+f(d)+"']")[0];c(b,"equalTo",e)});b.add("required",function(a){(a.element.tagName.toUpperCase()!=="INPUT"||a.element.type.toUpperCase()!=="CHECKBOX")&&c(a,"required",true)});b.add("remote",["url","type","additionalfields"],function(b){var d={url:b.params.url,type:b.params.type||"GET",data:{}},e=h(b.element.name);a.each(j(b.params.additionalfields||b.element.name),function(i,h){var c=g(h,e);d.data[c]=function(){return a(b.form).find(":input").filter("[name='"+f(c)+"']").val()}});c(b,"remote",d)});b.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&c(a,"minlength",a.params.min);a.params.nonalphamin&&c(a,"nonalphamin",a.params.nonalphamin);a.params.regex&&c(a,"regex",a.params.regex)});a(function(){d.unobtrusive.parse(document)})})(jQuery);
--------------------------------------------------------------------------------
/SelfHostDemo/packages/Microsoft.jQuery.Unobtrusive.Validation.3.1.2/Content/Scripts/jquery.validate.unobtrusive.min.js:
--------------------------------------------------------------------------------
1 | /* NUGET: BEGIN LICENSE TEXT
2 | *
3 | * Microsoft grants you the right to use these script files for the sole
4 | * purpose of either: (i) interacting through your browser with the Microsoft
5 | * website or online service, subject to the applicable licensing or use
6 | * terms; or (ii) using the files as included with a Microsoft product subject
7 | * to that product's license terms. Microsoft reserves all other rights to the
8 | * files not expressly granted by Microsoft, whether by implication, estoppel
9 | * or otherwise. Insofar as a script file is dual licensed under GPL,
10 | * Microsoft neither took the code under GPL nor distributes it thereunder but
11 | * under the terms set out in this paragraph. All notices and licenses
12 | * below are for informational purposes only.
13 | *
14 | * NUGET: END LICENSE TEXT */
15 | /*
16 | ** Unobtrusive validation support library for jQuery and jQuery Validate
17 | ** Copyright (C) Microsoft Corporation. All rights reserved.
18 | */
19 | (function(a){var d=a.validator,b,e="unobtrusiveValidation";function c(a,b,c){a.rules[b]=c;if(a.message)a.messages[b]=a.message}function j(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function f(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function h(a){return a.substr(0,a.lastIndexOf(".")+1)}function g(a,b){if(a.indexOf("*.")===0)a=a.replace("*.",b);return a}function m(c,e){var b=a(this).find("[data-valmsg-for='"+f(e[0].name)+"']"),d=b.attr("data-valmsg-replace"),g=d?a.parseJSON(d)!==false:null;b.removeClass("field-validation-valid").addClass("field-validation-error");c.data("unobtrusiveContainer",b);if(g){b.empty();c.removeClass("input-validation-error").appendTo(b)}else c.hide()}function l(e,d){var c=a(this).find("[data-valmsg-summary=true]"),b=c.find("ul");if(b&&b.length&&d.errorList.length){b.empty();c.addClass("validation-summary-errors").removeClass("validation-summary-valid");a.each(d.errorList,function(){a(" ").html(this.message).appendTo(b)})}}function k(d){var b=d.data("unobtrusiveContainer"),c=b.attr("data-valmsg-replace"),e=c?a.parseJSON(c):null;if(b){b.addClass("field-validation-valid").removeClass("field-validation-error");d.removeData("unobtrusiveContainer");e&&b.empty()}}function n(){var b=a(this);b.data("validator").resetForm();b.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors");b.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}function i(c){var b=a(c),d=b.data(e),f=a.proxy(n,c);if(!d){d={options:{errorClass:"input-validation-error",errorElement:"span",errorPlacement:a.proxy(m,c),invalidHandler:a.proxy(l,c),messages:{},rules:{},success:a.proxy(k,c)},attachValidation:function(){b.unbind("reset."+e,f).bind("reset."+e,f).validate(this.options)},validate:function(){b.validate();return b.valid()}};b.data(e,d)}return d}d.unobtrusive={adapters:[],parseElement:function(b,h){var d=a(b),f=d.parents("form")[0],c,e,g;if(!f)return;c=i(f);c.options.rules[b.name]=e={};c.options.messages[b.name]=g={};a.each(this.adapters,function(){var c="data-val-"+this.name,i=d.attr(c),h={};if(i!==undefined){c+="-";a.each(this.params,function(){h[this]=d.attr(c+this)});this.adapt({element:b,form:f,message:i,params:h,rules:e,messages:g})}});a.extend(e,{__dummy__:true});!h&&c.attachValidation()},parse:function(b){var c=a(b).parents("form").andSelf().add(a(b).find("form")).filter("form");a(b).find(":input").filter("[data-val=true]").each(function(){d.unobtrusive.parseElement(this,true)});c.each(function(){var a=i(this);a&&a.attachValidation()})}};b=d.unobtrusive.adapters;b.add=function(c,a,b){if(!b){b=a;a=[]}this.push({name:c,params:a,adapt:b});return this};b.addBool=function(a,b){return this.add(a,function(d){c(d,b||a,true)})};b.addMinMax=function(e,g,f,a,d,b){return this.add(e,[d||"min",b||"max"],function(b){var e=b.params.min,d=b.params.max;if(e&&d)c(b,a,[e,d]);else if(e)c(b,g,e);else d&&c(b,f,d)})};b.addSingleVal=function(a,b,d){return this.add(a,[b||"val"],function(e){c(e,d||a,e.params[b])})};d.addMethod("__dummy__",function(){return true});d.addMethod("regex",function(b,c,d){var a;if(this.optional(c))return true;a=(new RegExp(d)).exec(b);return a&&a.index===0&&a[0].length===b.length});d.addMethod("nonalphamin",function(c,d,b){var a;if(b){a=c.match(/\W/g);a=a&&a.length>=b}return a});if(d.methods.extension){b.addSingleVal("accept","mimtype");b.addSingleVal("extension","extension")}else b.addSingleVal("extension","extension","accept");b.addSingleVal("regex","pattern");b.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");b.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range");b.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength");b.add("equalto",["other"],function(b){var i=h(b.element.name),j=b.params.other,d=g(j,i),e=a(b.form).find(":input").filter("[name='"+f(d)+"']")[0];c(b,"equalTo",e)});b.add("required",function(a){(a.element.tagName.toUpperCase()!=="INPUT"||a.element.type.toUpperCase()!=="CHECKBOX")&&c(a,"required",true)});b.add("remote",["url","type","additionalfields"],function(b){var d={url:b.params.url,type:b.params.type||"GET",data:{}},e=h(b.element.name);a.each(j(b.params.additionalfields||b.element.name),function(i,h){var c=g(h,e);d.data[c]=function(){return a(b.form).find(":input").filter("[name='"+f(c)+"']").val()}});c(b,"remote",d)});b.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&c(a,"minlength",a.params.min);a.params.nonalphamin&&c(a,"nonalphamin",a.params.nonalphamin);a.params.regex&&c(a,"regex",a.params.regex)});a(function(){d.unobtrusive.parse(document)})})(jQuery);
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Project_Readme.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Your ASP.NET application
6 |
95 |
96 |
97 |
98 |
102 |
103 |
104 |
105 |
This application consists of:
106 |
107 | Sample pages showing basic nav between Home, About, and Contact
108 | Theming using Bootstrap
109 | Authentication , if selected, shows how to register and sign in
110 | ASP.NET features managed using NuGet
111 |
112 |
113 |
114 |
115 |
Customize app
116 |
130 |
131 |
132 |
140 |
141 |
142 |
Get help
143 |
147 |
148 |
149 |
150 |
151 |
--------------------------------------------------------------------------------
/SelfHostDemo/packages/Microsoft.Owin.Host.HttpListener.2.0.1/lib/net45/Microsoft.Owin.Host.HttpListener.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Microsoft.Owin.Host.HttpListener
5 |
6 |
7 |
8 |
9 | This class is used to wrap other streams and convert some exception types.
10 |
11 |
12 |
13 |
14 | This wraps HttpListenerRequest's WebHeaderCollection (NameValueCollection) and adapts it to
15 | the OWIN required IDictionary surface area. It remains fully mutable, but you will be subject
16 | to the header validations performed by the underlying collection.
17 |
18 |
19 |
20 |
21 | This wraps HttpListener and exposes it as an OWIN compatible server.
22 |
23 |
24 |
25 |
26 | Creates a listener wrapper that can be configured by the user before starting.
27 |
28 |
29 |
30 |
31 | These are merged as one call because they should be swapped out atomically.
32 | This controls how many requests the server attempts to process concurrently.
33 |
34 | The maximum number of pending request receives.
35 | The maximum number of active requests being processed.
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | Starts the listener and request processing threads.
47 |
48 |
49 |
50 |
51 | Shuts down the listener and disposes it.
52 |
53 |
54 |
55 |
56 | The HttpListener instance wrapped by this wrapper.
57 |
58 |
59 |
60 |
61 | This wraps an HttpListenerRequest and exposes it as an OWIN environment IDictionary.
62 |
63 |
64 |
65 |
66 | Initializes a new instance of the class.
67 | Uses the given request object to populate the OWIN standard keys in the environment IDictionary.
68 | Most values are copied so that they can be mutable, but the headers collection is only wrapped.
69 |
70 |
71 |
72 |
73 | This wraps an HttpListenerResponse, populates it with the given response fields, and relays
74 | the response body to the underlying stream.
75 |
76 |
77 |
78 |
79 | Initializes a new instance of the class.
80 | Sets up the Environment with the necessary request state items.
81 |
82 |
83 |
84 |
85 | A strongly-typed resource class, for looking up localized strings, etc.
86 |
87 |
88 |
89 |
90 | Returns the cached ResourceManager instance used by this class.
91 |
92 |
93 |
94 |
95 | Overrides the current thread's CurrentUICulture property for all
96 | resource lookups using this strongly typed resource class.
97 |
98 |
99 |
100 |
101 | Looks up a localized string similar to The key '{0}' is already present in the dictionary..
102 |
103 |
104 |
105 |
106 | Looks up a localized string similar to App errors on disconnect notification..
107 |
108 |
109 |
110 |
111 | Looks up a localized string similar to Exception during request processing..
112 |
113 |
114 |
115 |
116 | Looks up a localized string similar to Unable to resolve handles. Disconnect notifications will be ignored..
117 |
118 |
119 |
120 |
121 | Looks up a localized string similar to Unexpected exception..
122 |
123 |
124 |
125 |
126 | Implements the Katana setup pattern for the OwinHttpListener server.
127 |
128 |
129 |
130 |
131 | Advertise the capabilities of the server.
132 |
133 |
134 |
135 |
136 |
137 | Creates an OwinHttpListener and starts listening on the given URL.
138 |
139 | The application entry point.
140 | The addresses to listen on.
141 | The OwinHttpListener. Invoke Dispose to shut down.
142 |
143 |
144 |
145 | Standard keys and values for use within the OWIN interfaces
146 |
147 |
148 |
149 |
150 |
--------------------------------------------------------------------------------
/SelfHostDemo/packages/Microsoft.Owin.Host.HttpListener.2.0.1/lib/net40/Microsoft.Owin.Host.HttpListener.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Microsoft.Owin.Host.HttpListener
5 |
6 |
7 |
8 |
9 | Provided as a down-level stub for the 4.5 AssemblyMetaDataAttribute class.
10 | All released assemblies should define [AssemblyMetadata("Serviceable", "True")].
11 |
12 |
13 |
14 |
15 | This class is used to wrap other streams and convert some exception types.
16 |
17 |
18 |
19 |
20 | This wraps HttpListenerRequest's WebHeaderCollection (NameValueCollection) and adapts it to
21 | the OWIN required IDictionary surface area. It remains fully mutable, but you will be subject
22 | to the header validations performed by the underlying collection.
23 |
24 |
25 |
26 |
27 | This wraps HttpListener and exposes it as an OWIN compatible server.
28 |
29 |
30 |
31 |
32 | Creates a listener wrapper that can be configured by the user before starting.
33 |
34 |
35 |
36 |
37 | These are merged as one call because they should be swapped out atomically.
38 | This controls how many requests the server attempts to process concurrently.
39 |
40 | The maximum number of pending request receives.
41 | The maximum number of active requests being processed.
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | Starts the listener and request processing threads.
53 |
54 |
55 |
56 |
57 | Shuts down the listener and disposes it.
58 |
59 |
60 |
61 |
62 | The HttpListener instance wrapped by this wrapper.
63 |
64 |
65 |
66 |
67 | This wraps an HttpListenerRequest and exposes it as an OWIN environment IDictionary.
68 |
69 |
70 |
71 |
72 | Initializes a new instance of the class.
73 | Uses the given request object to populate the OWIN standard keys in the environment IDictionary.
74 | Most values are copied so that they can be mutable, but the headers collection is only wrapped.
75 |
76 |
77 |
78 |
79 | This wraps an HttpListenerResponse, populates it with the given response fields, and relays
80 | the response body to the underlying stream.
81 |
82 |
83 |
84 |
85 | Initializes a new instance of the class.
86 | Sets up the Environment with the necessary request state items.
87 |
88 |
89 |
90 |
91 | A strongly-typed resource class, for looking up localized strings, etc.
92 |
93 |
94 |
95 |
96 | Returns the cached ResourceManager instance used by this class.
97 |
98 |
99 |
100 |
101 | Overrides the current thread's CurrentUICulture property for all
102 | resource lookups using this strongly typed resource class.
103 |
104 |
105 |
106 |
107 | Looks up a localized string similar to The key '{0}' is already present in the dictionary..
108 |
109 |
110 |
111 |
112 | Looks up a localized string similar to App errors on disconnect notification..
113 |
114 |
115 |
116 |
117 | Looks up a localized string similar to Exception during request processing..
118 |
119 |
120 |
121 |
122 | Looks up a localized string similar to Unable to resolve handles. Disconnect notifications will be ignored..
123 |
124 |
125 |
126 |
127 | Looks up a localized string similar to Unexpected exception..
128 |
129 |
130 |
131 |
132 | Implements the Katana setup pattern for the OwinHttpListener server.
133 |
134 |
135 |
136 |
137 | Advertise the capabilities of the server.
138 |
139 |
140 |
141 |
142 |
143 | Creates an OwinHttpListener and starts listening on the given URL.
144 |
145 | The application entry point.
146 | The addresses to listen on.
147 | The OwinHttpListener. Invoke Dispose to shut down.
148 |
149 |
150 |
151 |
--------------------------------------------------------------------------------
/SelfHostDemo/SelfHostDemo.Web/Scripts/respond.js:
--------------------------------------------------------------------------------
1 | /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
2 | /*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
3 | (function(w) {
4 | "use strict";
5 | w.matchMedia = w.matchMedia || function(doc, undefined) {
6 | var bool, docElem = doc.documentElement, refNode = docElem.firstElementChild || docElem.firstChild, fakeBody = doc.createElement("body"), div = doc.createElement("div");
7 | div.id = "mq-test-1";
8 | div.style.cssText = "position:absolute;top:-100em";
9 | fakeBody.style.background = "none";
10 | fakeBody.appendChild(div);
11 | return function(q) {
12 | div.innerHTML = '';
13 | docElem.insertBefore(fakeBody, refNode);
14 | bool = div.offsetWidth === 42;
15 | docElem.removeChild(fakeBody);
16 | return {
17 | matches: bool,
18 | media: q
19 | };
20 | };
21 | }(w.document);
22 | })(this);
23 |
24 | /*! Respond.js v1.4.0: min/max-width media query polyfill. (c) Scott Jehl. MIT Lic. j.mp/respondjs */
25 | (function(w) {
26 | "use strict";
27 | var respond = {};
28 | w.respond = respond;
29 | respond.update = function() {};
30 | var requestQueue = [], xmlHttp = function() {
31 | var xmlhttpmethod = false;
32 | try {
33 | xmlhttpmethod = new w.XMLHttpRequest();
34 | } catch (e) {
35 | xmlhttpmethod = new w.ActiveXObject("Microsoft.XMLHTTP");
36 | }
37 | return function() {
38 | return xmlhttpmethod;
39 | };
40 | }(), ajax = function(url, callback) {
41 | var req = xmlHttp();
42 | if (!req) {
43 | return;
44 | }
45 | req.open("GET", url, true);
46 | req.onreadystatechange = function() {
47 | if (req.readyState !== 4 || req.status !== 200 && req.status !== 304) {
48 | return;
49 | }
50 | callback(req.responseText);
51 | };
52 | if (req.readyState === 4) {
53 | return;
54 | }
55 | req.send(null);
56 | };
57 | respond.ajax = ajax;
58 | respond.queue = requestQueue;
59 | respond.regex = {
60 | media: /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,
61 | keyframes: /@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,
62 | urls: /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,
63 | findStyles: /@media *([^\{]+)\{([\S\s]+?)$/,
64 | only: /(only\s+)?([a-zA-Z]+)\s?/,
65 | minw: /\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,
66 | maxw: /\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/
67 | };
68 | respond.mediaQueriesSupported = w.matchMedia && w.matchMedia("only all") !== null && w.matchMedia("only all").matches;
69 | if (respond.mediaQueriesSupported) {
70 | return;
71 | }
72 | var doc = w.document, docElem = doc.documentElement, mediastyles = [], rules = [], appendedEls = [], parsedSheets = {}, resizeThrottle = 30, head = doc.getElementsByTagName("head")[0] || docElem, base = doc.getElementsByTagName("base")[0], links = head.getElementsByTagName("link"), lastCall, resizeDefer, eminpx, getEmValue = function() {
73 | var ret, div = doc.createElement("div"), body = doc.body, originalHTMLFontSize = docElem.style.fontSize, originalBodyFontSize = body && body.style.fontSize, fakeUsed = false;
74 | div.style.cssText = "position:absolute;font-size:1em;width:1em";
75 | if (!body) {
76 | body = fakeUsed = doc.createElement("body");
77 | body.style.background = "none";
78 | }
79 | docElem.style.fontSize = "100%";
80 | body.style.fontSize = "100%";
81 | body.appendChild(div);
82 | if (fakeUsed) {
83 | docElem.insertBefore(body, docElem.firstChild);
84 | }
85 | ret = div.offsetWidth;
86 | if (fakeUsed) {
87 | docElem.removeChild(body);
88 | } else {
89 | body.removeChild(div);
90 | }
91 | docElem.style.fontSize = originalHTMLFontSize;
92 | if (originalBodyFontSize) {
93 | body.style.fontSize = originalBodyFontSize;
94 | }
95 | ret = eminpx = parseFloat(ret);
96 | return ret;
97 | }, applyMedia = function(fromResize) {
98 | var name = "clientWidth", docElemProp = docElem[name], currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[name] || docElemProp, styleBlocks = {}, lastLink = links[links.length - 1], now = new Date().getTime();
99 | if (fromResize && lastCall && now - lastCall < resizeThrottle) {
100 | w.clearTimeout(resizeDefer);
101 | resizeDefer = w.setTimeout(applyMedia, resizeThrottle);
102 | return;
103 | } else {
104 | lastCall = now;
105 | }
106 | for (var i in mediastyles) {
107 | if (mediastyles.hasOwnProperty(i)) {
108 | var thisstyle = mediastyles[i], min = thisstyle.minw, max = thisstyle.maxw, minnull = min === null, maxnull = max === null, em = "em";
109 | if (!!min) {
110 | min = parseFloat(min) * (min.indexOf(em) > -1 ? eminpx || getEmValue() : 1);
111 | }
112 | if (!!max) {
113 | max = parseFloat(max) * (max.indexOf(em) > -1 ? eminpx || getEmValue() : 1);
114 | }
115 | if (!thisstyle.hasquery || (!minnull || !maxnull) && (minnull || currWidth >= min) && (maxnull || currWidth <= max)) {
116 | if (!styleBlocks[thisstyle.media]) {
117 | styleBlocks[thisstyle.media] = [];
118 | }
119 | styleBlocks[thisstyle.media].push(rules[thisstyle.rules]);
120 | }
121 | }
122 | }
123 | for (var j in appendedEls) {
124 | if (appendedEls.hasOwnProperty(j)) {
125 | if (appendedEls[j] && appendedEls[j].parentNode === head) {
126 | head.removeChild(appendedEls[j]);
127 | }
128 | }
129 | }
130 | appendedEls.length = 0;
131 | for (var k in styleBlocks) {
132 | if (styleBlocks.hasOwnProperty(k)) {
133 | var ss = doc.createElement("style"), css = styleBlocks[k].join("\n");
134 | ss.type = "text/css";
135 | ss.media = k;
136 | head.insertBefore(ss, lastLink.nextSibling);
137 | if (ss.styleSheet) {
138 | ss.styleSheet.cssText = css;
139 | } else {
140 | ss.appendChild(doc.createTextNode(css));
141 | }
142 | appendedEls.push(ss);
143 | }
144 | }
145 | }, translate = function(styles, href, media) {
146 | var qs = styles.replace(respond.regex.keyframes, "").match(respond.regex.media), ql = qs && qs.length || 0;
147 | href = href.substring(0, href.lastIndexOf("/"));
148 | var repUrls = function(css) {
149 | return css.replace(respond.regex.urls, "$1" + href + "$2$3");
150 | }, useMedia = !ql && media;
151 | if (href.length) {
152 | href += "/";
153 | }
154 | if (useMedia) {
155 | ql = 1;
156 | }
157 | for (var i = 0; i < ql; i++) {
158 | var fullq, thisq, eachq, eql;
159 | if (useMedia) {
160 | fullq = media;
161 | rules.push(repUrls(styles));
162 | } else {
163 | fullq = qs[i].match(respond.regex.findStyles) && RegExp.$1;
164 | rules.push(RegExp.$2 && repUrls(RegExp.$2));
165 | }
166 | eachq = fullq.split(",");
167 | eql = eachq.length;
168 | for (var j = 0; j < eql; j++) {
169 | thisq = eachq[j];
170 | mediastyles.push({
171 | media: thisq.split("(")[0].match(respond.regex.only) && RegExp.$2 || "all",
172 | rules: rules.length - 1,
173 | hasquery: thisq.indexOf("(") > -1,
174 | minw: thisq.match(respond.regex.minw) && parseFloat(RegExp.$1) + (RegExp.$2 || ""),
175 | maxw: thisq.match(respond.regex.maxw) && parseFloat(RegExp.$1) + (RegExp.$2 || "")
176 | });
177 | }
178 | }
179 | applyMedia();
180 | }, makeRequests = function() {
181 | if (requestQueue.length) {
182 | var thisRequest = requestQueue.shift();
183 | ajax(thisRequest.href, function(styles) {
184 | translate(styles, thisRequest.href, thisRequest.media);
185 | parsedSheets[thisRequest.href] = true;
186 | w.setTimeout(function() {
187 | makeRequests();
188 | }, 0);
189 | });
190 | }
191 | }, ripCSS = function() {
192 | for (var i = 0; i < links.length; i++) {
193 | var sheet = links[i], href = sheet.href, media = sheet.media, isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet";
194 | if (!!href && isCSS && !parsedSheets[href]) {
195 | if (sheet.styleSheet && sheet.styleSheet.rawCssText) {
196 | translate(sheet.styleSheet.rawCssText, href, media);
197 | parsedSheets[href] = true;
198 | } else {
199 | if (!/^([a-zA-Z:]*\/\/)/.test(href) && !base || href.replace(RegExp.$1, "").split("/")[0] === w.location.host) {
200 | if (href.substring(0, 2) === "//") {
201 | href = w.location.protocol + href;
202 | }
203 | requestQueue.push({
204 | href: href,
205 | media: media
206 | });
207 | }
208 | }
209 | }
210 | }
211 | makeRequests();
212 | };
213 | ripCSS();
214 | respond.update = ripCSS;
215 | respond.getEmValue = getEmValue;
216 | function callMedia() {
217 | applyMedia(true);
218 | }
219 | if (w.addEventListener) {
220 | w.addEventListener("resize", callMedia, false);
221 | } else if (w.attachEvent) {
222 | w.attachEvent("onresize", callMedia);
223 | }
224 | })(this);
--------------------------------------------------------------------------------
/SelfHostDemo/packages/Respond.1.4.2/content/Scripts/respond.js:
--------------------------------------------------------------------------------
1 | /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
2 | /*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
3 | (function(w) {
4 | "use strict";
5 | w.matchMedia = w.matchMedia || function(doc, undefined) {
6 | var bool, docElem = doc.documentElement, refNode = docElem.firstElementChild || docElem.firstChild, fakeBody = doc.createElement("body"), div = doc.createElement("div");
7 | div.id = "mq-test-1";
8 | div.style.cssText = "position:absolute;top:-100em";
9 | fakeBody.style.background = "none";
10 | fakeBody.appendChild(div);
11 | return function(q) {
12 | div.innerHTML = '';
13 | docElem.insertBefore(fakeBody, refNode);
14 | bool = div.offsetWidth === 42;
15 | docElem.removeChild(fakeBody);
16 | return {
17 | matches: bool,
18 | media: q
19 | };
20 | };
21 | }(w.document);
22 | })(this);
23 |
24 | /*! Respond.js v1.4.0: min/max-width media query polyfill. (c) Scott Jehl. MIT Lic. j.mp/respondjs */
25 | (function(w) {
26 | "use strict";
27 | var respond = {};
28 | w.respond = respond;
29 | respond.update = function() {};
30 | var requestQueue = [], xmlHttp = function() {
31 | var xmlhttpmethod = false;
32 | try {
33 | xmlhttpmethod = new w.XMLHttpRequest();
34 | } catch (e) {
35 | xmlhttpmethod = new w.ActiveXObject("Microsoft.XMLHTTP");
36 | }
37 | return function() {
38 | return xmlhttpmethod;
39 | };
40 | }(), ajax = function(url, callback) {
41 | var req = xmlHttp();
42 | if (!req) {
43 | return;
44 | }
45 | req.open("GET", url, true);
46 | req.onreadystatechange = function() {
47 | if (req.readyState !== 4 || req.status !== 200 && req.status !== 304) {
48 | return;
49 | }
50 | callback(req.responseText);
51 | };
52 | if (req.readyState === 4) {
53 | return;
54 | }
55 | req.send(null);
56 | };
57 | respond.ajax = ajax;
58 | respond.queue = requestQueue;
59 | respond.regex = {
60 | media: /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,
61 | keyframes: /@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,
62 | urls: /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,
63 | findStyles: /@media *([^\{]+)\{([\S\s]+?)$/,
64 | only: /(only\s+)?([a-zA-Z]+)\s?/,
65 | minw: /\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,
66 | maxw: /\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/
67 | };
68 | respond.mediaQueriesSupported = w.matchMedia && w.matchMedia("only all") !== null && w.matchMedia("only all").matches;
69 | if (respond.mediaQueriesSupported) {
70 | return;
71 | }
72 | var doc = w.document, docElem = doc.documentElement, mediastyles = [], rules = [], appendedEls = [], parsedSheets = {}, resizeThrottle = 30, head = doc.getElementsByTagName("head")[0] || docElem, base = doc.getElementsByTagName("base")[0], links = head.getElementsByTagName("link"), lastCall, resizeDefer, eminpx, getEmValue = function() {
73 | var ret, div = doc.createElement("div"), body = doc.body, originalHTMLFontSize = docElem.style.fontSize, originalBodyFontSize = body && body.style.fontSize, fakeUsed = false;
74 | div.style.cssText = "position:absolute;font-size:1em;width:1em";
75 | if (!body) {
76 | body = fakeUsed = doc.createElement("body");
77 | body.style.background = "none";
78 | }
79 | docElem.style.fontSize = "100%";
80 | body.style.fontSize = "100%";
81 | body.appendChild(div);
82 | if (fakeUsed) {
83 | docElem.insertBefore(body, docElem.firstChild);
84 | }
85 | ret = div.offsetWidth;
86 | if (fakeUsed) {
87 | docElem.removeChild(body);
88 | } else {
89 | body.removeChild(div);
90 | }
91 | docElem.style.fontSize = originalHTMLFontSize;
92 | if (originalBodyFontSize) {
93 | body.style.fontSize = originalBodyFontSize;
94 | }
95 | ret = eminpx = parseFloat(ret);
96 | return ret;
97 | }, applyMedia = function(fromResize) {
98 | var name = "clientWidth", docElemProp = docElem[name], currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[name] || docElemProp, styleBlocks = {}, lastLink = links[links.length - 1], now = new Date().getTime();
99 | if (fromResize && lastCall && now - lastCall < resizeThrottle) {
100 | w.clearTimeout(resizeDefer);
101 | resizeDefer = w.setTimeout(applyMedia, resizeThrottle);
102 | return;
103 | } else {
104 | lastCall = now;
105 | }
106 | for (var i in mediastyles) {
107 | if (mediastyles.hasOwnProperty(i)) {
108 | var thisstyle = mediastyles[i], min = thisstyle.minw, max = thisstyle.maxw, minnull = min === null, maxnull = max === null, em = "em";
109 | if (!!min) {
110 | min = parseFloat(min) * (min.indexOf(em) > -1 ? eminpx || getEmValue() : 1);
111 | }
112 | if (!!max) {
113 | max = parseFloat(max) * (max.indexOf(em) > -1 ? eminpx || getEmValue() : 1);
114 | }
115 | if (!thisstyle.hasquery || (!minnull || !maxnull) && (minnull || currWidth >= min) && (maxnull || currWidth <= max)) {
116 | if (!styleBlocks[thisstyle.media]) {
117 | styleBlocks[thisstyle.media] = [];
118 | }
119 | styleBlocks[thisstyle.media].push(rules[thisstyle.rules]);
120 | }
121 | }
122 | }
123 | for (var j in appendedEls) {
124 | if (appendedEls.hasOwnProperty(j)) {
125 | if (appendedEls[j] && appendedEls[j].parentNode === head) {
126 | head.removeChild(appendedEls[j]);
127 | }
128 | }
129 | }
130 | appendedEls.length = 0;
131 | for (var k in styleBlocks) {
132 | if (styleBlocks.hasOwnProperty(k)) {
133 | var ss = doc.createElement("style"), css = styleBlocks[k].join("\n");
134 | ss.type = "text/css";
135 | ss.media = k;
136 | head.insertBefore(ss, lastLink.nextSibling);
137 | if (ss.styleSheet) {
138 | ss.styleSheet.cssText = css;
139 | } else {
140 | ss.appendChild(doc.createTextNode(css));
141 | }
142 | appendedEls.push(ss);
143 | }
144 | }
145 | }, translate = function(styles, href, media) {
146 | var qs = styles.replace(respond.regex.keyframes, "").match(respond.regex.media), ql = qs && qs.length || 0;
147 | href = href.substring(0, href.lastIndexOf("/"));
148 | var repUrls = function(css) {
149 | return css.replace(respond.regex.urls, "$1" + href + "$2$3");
150 | }, useMedia = !ql && media;
151 | if (href.length) {
152 | href += "/";
153 | }
154 | if (useMedia) {
155 | ql = 1;
156 | }
157 | for (var i = 0; i < ql; i++) {
158 | var fullq, thisq, eachq, eql;
159 | if (useMedia) {
160 | fullq = media;
161 | rules.push(repUrls(styles));
162 | } else {
163 | fullq = qs[i].match(respond.regex.findStyles) && RegExp.$1;
164 | rules.push(RegExp.$2 && repUrls(RegExp.$2));
165 | }
166 | eachq = fullq.split(",");
167 | eql = eachq.length;
168 | for (var j = 0; j < eql; j++) {
169 | thisq = eachq[j];
170 | mediastyles.push({
171 | media: thisq.split("(")[0].match(respond.regex.only) && RegExp.$2 || "all",
172 | rules: rules.length - 1,
173 | hasquery: thisq.indexOf("(") > -1,
174 | minw: thisq.match(respond.regex.minw) && parseFloat(RegExp.$1) + (RegExp.$2 || ""),
175 | maxw: thisq.match(respond.regex.maxw) && parseFloat(RegExp.$1) + (RegExp.$2 || "")
176 | });
177 | }
178 | }
179 | applyMedia();
180 | }, makeRequests = function() {
181 | if (requestQueue.length) {
182 | var thisRequest = requestQueue.shift();
183 | ajax(thisRequest.href, function(styles) {
184 | translate(styles, thisRequest.href, thisRequest.media);
185 | parsedSheets[thisRequest.href] = true;
186 | w.setTimeout(function() {
187 | makeRequests();
188 | }, 0);
189 | });
190 | }
191 | }, ripCSS = function() {
192 | for (var i = 0; i < links.length; i++) {
193 | var sheet = links[i], href = sheet.href, media = sheet.media, isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet";
194 | if (!!href && isCSS && !parsedSheets[href]) {
195 | if (sheet.styleSheet && sheet.styleSheet.rawCssText) {
196 | translate(sheet.styleSheet.rawCssText, href, media);
197 | parsedSheets[href] = true;
198 | } else {
199 | if (!/^([a-zA-Z:]*\/\/)/.test(href) && !base || href.replace(RegExp.$1, "").split("/")[0] === w.location.host) {
200 | if (href.substring(0, 2) === "//") {
201 | href = w.location.protocol + href;
202 | }
203 | requestQueue.push({
204 | href: href,
205 | media: media
206 | });
207 | }
208 | }
209 | }
210 | }
211 | makeRequests();
212 | };
213 | ripCSS();
214 | respond.update = ripCSS;
215 | respond.getEmValue = getEmValue;
216 | function callMedia() {
217 | applyMedia(true);
218 | }
219 | if (w.addEventListener) {
220 | w.addEventListener("resize", callMedia, false);
221 | } else if (w.attachEvent) {
222 | w.attachEvent("onresize", callMedia);
223 | }
224 | })(this);
--------------------------------------------------------------------------------
23 | @foreach (AuthenticationDescription p in loginProviders) 24 | { 25 | 26 | } 27 |
28 |