OtherLogins { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/ViewModels/Manage/SetPasswordViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace MvcTemplate.Web.ViewModels.Manage
2 | {
3 | using System.ComponentModel.DataAnnotations;
4 |
5 | public class SetPasswordViewModel
6 | {
7 | [Required]
8 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = Common.GlobalConstants.PasswordMinLength)]
9 | [DataType(DataType.Password)]
10 | [Display(Name = "New password")]
11 | public string NewPassword { get; set; }
12 |
13 | [DataType(DataType.Password)]
14 | [Display(Name = "Confirm new password")]
15 | [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
16 | public string ConfirmPassword { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/ViewModels/Manage/VerifyPhoneNumberViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace MvcTemplate.Web.ViewModels.Manage
2 | {
3 | using System.ComponentModel.DataAnnotations;
4 |
5 | public class VerifyPhoneNumberViewModel
6 | {
7 | [Required]
8 | [Display(Name = "Code")]
9 | public string Code { get; set; }
10 |
11 | [Required]
12 | [Phone]
13 | [Display(Name = "Phone Number")]
14 | public string PhoneNumber { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Account/ConfirmEmail.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | this.ViewBag.Title = "Confirm Email";
3 | }
4 |
5 | @(this.ViewBag.Title).
6 |
7 |
8 | Thank you for confirming your email. Please @(this.Html.ActionLink("Click here to Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" }))
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Account/ExternalLoginConfirmation.cshtml:
--------------------------------------------------------------------------------
1 | @model MvcTemplate.Web.ViewModels.Account.ExternalLoginConfirmationViewModel
2 | @{
3 | this.ViewBag.Title = "Register";
4 | }
5 | @(this.ViewBag.Title).
6 | Associate your @(this.ViewBag.LoginProvider) account.
7 |
8 | @using (this.Html.BeginForm("ExternalLoginConfirmation", "Account", new { this.ViewBag.ReturnUrl }, FormMethod.Post, new { role = "form" }))
9 | {
10 | @(this.Html.AntiForgeryToken())
11 |
12 | Association Form
13 |
14 | @(this.Html.ValidationSummary(true, string.Empty, new { @class = "text-danger" }))
15 |
16 | You've successfully authenticated with @(this.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 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Account/ExternalLoginFailure.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | this.ViewBag.Title = "Login Failure";
3 | }
4 |
5 |
6 | @(this.ViewBag.Title).
7 | Unsuccessful login with service.
8 |
9 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Account/ForgotPassword.cshtml:
--------------------------------------------------------------------------------
1 | @model MvcTemplate.Web.ViewModels.Account.ForgotPasswordViewModel
2 | @{
3 | this.ViewBag.Title = "Forgot your password?";
4 | }
5 |
6 | @(this.ViewBag.Title).
7 |
8 | @using (this.Html.BeginForm("ForgotPassword", "Account", FormMethod.Post, new { role = "form" }))
9 | {
10 | @(this.Html.AntiForgeryToken())
11 | Enter your email.
12 |
13 | @(this.Html.ValidationSummary(string.Empty, new { @class = "text-danger" }))
14 |
20 |
25 | }
26 |
27 | @section Scripts {
28 | @Scripts.Render("~/bundles/jqueryval")
29 | }
30 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Account/ForgotPasswordConfirmation.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | this.ViewBag.Title = "Forgot Password Confirmation";
3 | }
4 |
5 |
6 | @(this.ViewBag.Title).
7 |
8 |
9 |
10 | Please check your email to reset your password.
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Account/Login.cshtml:
--------------------------------------------------------------------------------
1 | @using MvcTemplate.Web.ViewModels.Account
2 | @model LoginViewModel
3 | @{
4 | this.ViewBag.Title = "Log in";
5 | }
6 |
7 | @(this.ViewBag.Title).
8 |
60 |
61 | @section Scripts {
62 | @Scripts.Render("~/bundles/jqueryval")
63 | }
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Account/Register.cshtml:
--------------------------------------------------------------------------------
1 | @model MvcTemplate.Web.ViewModels.Account.RegisterViewModel
2 | @{
3 | this.ViewBag.Title = "Register";
4 | }
5 |
6 | @(this.ViewBag.Title).
7 |
8 | @using (this.Html.BeginForm("Register", "Account", FormMethod.Post, new { role = "form" }))
9 | {
10 | @(this.Html.AntiForgeryToken())
11 | Create a new account.
12 |
13 | @(this.Html.ValidationSummary(string.Empty, new { @class = "text-danger" }))
14 |
20 |
26 |
32 |
37 | }
38 |
39 | @section Scripts {
40 | @Scripts.Render("~/bundles/jqueryval")
41 | }
42 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Account/ResetPassword.cshtml:
--------------------------------------------------------------------------------
1 | @model MvcTemplate.Web.ViewModels.Account.ResetPasswordViewModel
2 | @{
3 | this.ViewBag.Title = "Reset password";
4 | }
5 |
6 | @(this.ViewBag.Title).
7 |
8 | @using (this.Html.BeginForm("ResetPassword", "Account", FormMethod.Post, new { role = "form" }))
9 | {
10 | @(this.Html.AntiForgeryToken())
11 | Reset your password.
12 |
13 | @(this.Html.ValidationSummary(string.Empty, new { @class = "text-danger" }))
14 | @(this.Html.HiddenFor(model => model.Code))
15 |
21 |
27 |
33 |
38 | }
39 |
40 | @section Scripts {
41 | @Scripts.Render("~/bundles/jqueryval")
42 | }
43 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Account/ResetPasswordConfirmation.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | this.ViewBag.Title = "Reset password confirmation";
3 | }
4 |
5 |
6 | @(this.ViewBag.Title).
7 |
8 |
9 |
10 | Your password has been reset. Please @(this.Html.ActionLink("click here to log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" }))
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Account/SendCode.cshtml:
--------------------------------------------------------------------------------
1 | @model MvcTemplate.Web.ViewModels.Account.SendCodeViewModel
2 | @{
3 | this.ViewBag.Title = "Send";
4 | }
5 |
6 | @(this.ViewBag.Title).
7 |
8 | @using (this.Html.BeginForm("SendCode", "Account", new { this.Model.ReturnUrl }, FormMethod.Post, new { role = "form" }))
9 | {
10 | @(this.Html.AntiForgeryToken())
11 | @(this.Html.Hidden("rememberMe", this.Model.RememberMe))
12 | Send verification code
13 |
14 |
15 |
16 | Select Two-Factor Authentication Provider:
17 | @(this.Html.DropDownListFor(model => model.SelectedProvider, this.Model.Providers))
18 |
19 |
20 |
21 | }
22 |
23 | @section Scripts {
24 | @Scripts.Render("~/bundles/jqueryval")
25 | }
26 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Account/VerifyCode.cshtml:
--------------------------------------------------------------------------------
1 | @model MvcTemplate.Web.ViewModels.Account.VerifyCodeViewModel
2 | @{
3 | this.ViewBag.Title = "Verify";
4 | }
5 |
6 | @(this.ViewBag.Title).
7 |
8 | @using (this.Html.BeginForm("VerifyCode", "Account", new { this.Model.ReturnUrl }, FormMethod.Post, new { role = "form" }))
9 | {
10 | @(this.Html.AntiForgeryToken())
11 | @(this.Html.Hidden("provider", this.Model.Provider))
12 | @(this.Html.Hidden("rememberMe", this.Model.RememberMe))
13 | Enter verification code
14 |
15 | @(this.Html.ValidationSummary(string.Empty, new { @class = "text-danger" }))
16 |
22 |
30 |
35 | }
36 |
37 | @section Scripts {
38 | @Scripts.Render("~/bundles/jqueryval")
39 | }
40 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Account/_ExternalLoginsListPartial.cshtml:
--------------------------------------------------------------------------------
1 | @model MvcTemplate.Web.ViewModels.Account.ExternalLoginListViewModel
2 | @using Microsoft.Owin.Security
3 |
4 | Use another service to log in.
5 |
6 | @{
7 | var loginProviders = this.Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes();
8 | if (!loginProviders.Any())
9 | {
10 |
11 |
12 | There are no external authentication services configured. See this article
13 | for details on setting up this ASP.NET application to support logging in via external services.
14 |
15 |
16 | }
17 | else
18 | {
19 | using (this.Html.BeginForm("ExternalLogin", "Account", new { this.Model.ReturnUrl }))
20 | {
21 | @(this.Html.AntiForgeryToken())
22 |
23 |
24 | @foreach (AuthenticationDescription p in loginProviders)
25 | {
26 |
27 | }
28 |
29 |
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Home/Index.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | this.ViewBag.Title = "Home Page";
3 | }
4 |
5 |
Welcome to MvcTemplate
6 |
Welcome to MvcTemplate.
7 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Manage/AddPhoneNumber.cshtml:
--------------------------------------------------------------------------------
1 | @model MvcTemplate.Web.ViewModels.Manage.AddPhoneNumberViewModel
2 | @{
3 | this.ViewBag.Title = "Phone Number";
4 | }
5 |
6 | @(this.ViewBag.Title).
7 |
8 | @using (this.Html.BeginForm("AddPhoneNumber", "Manage", FormMethod.Post, new { role = "form" }))
9 | {
10 | @(this.Html.AntiForgeryToken())
11 | Add a phone number
12 |
13 | @(this.Html.ValidationSummary(string.Empty, new { @class = "text-danger" }))
14 |
20 |
25 | }
26 |
27 | @section Scripts {
28 | @Scripts.Render("~/bundles/jqueryval")
29 | }
30 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Manage/ChangePassword.cshtml:
--------------------------------------------------------------------------------
1 | @model MvcTemplate.Web.ViewModels.Manage.ChangePasswordViewModel
2 | @{
3 | this.ViewBag.Title = "Change Password";
4 | }
5 |
6 | @(this.ViewBag.Title).
7 |
8 | @using (this.Html.BeginForm("ChangePassword", "Manage", FormMethod.Post, new { role = "form" }))
9 | {
10 | @(this.Html.AntiForgeryToken())
11 | Change Password Form
12 |
13 | @(this.Html.ValidationSummary(string.Empty, new { @class = "text-danger" }))
14 |
20 |
26 |
32 |
37 | }
38 |
39 | @section Scripts {
40 | @Scripts.Render("~/bundles/jqueryval")
41 | }
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Manage/Index.cshtml:
--------------------------------------------------------------------------------
1 | @model MvcTemplate.Web.ViewModels.Manage.IndexViewModel
2 | @{
3 | this.ViewBag.Title = "Manage";
4 | }
5 |
6 | @(this.ViewBag.Title).
7 |
8 | @(this.ViewBag.StatusMessage)
9 |
10 |
Change your account settings
11 |
12 |
13 | - Password:
14 | -
15 | [
16 | @(this.Model.HasPassword ? this.Html.ActionLink("Change your password", "ChangePassword") : this.Html.ActionLink("Create", "SetPassword"))
17 | ]
18 |
19 | - External Logins:
20 | -
21 | @(this.Model.Logins.Count) [
22 | @(this.Html.ActionLink("Manage", "ManageLogins")) ]
23 |
24 | @*
25 | Phone Numbers can used as a second factor of verification in a two-factor authentication system.
26 |
27 | See this article
28 | for details on setting up this ASP.NET application to support two-factor authentication using SMS.
29 |
30 | Uncomment the following block after you have set up two-factor authentication
31 | *@
32 | @*
33 | - Phone Number:
34 | -
35 | @(Model.PhoneNumber ?? "None")
36 | @if (Model.PhoneNumber != null)
37 | {
38 |
39 | [ @Html.ActionLink("Change", "AddPhoneNumber") ]
40 | using (Html.BeginForm("RemovePhoneNumber", "Manage", FormMethod.Post, new { role = "form" }))
41 | {
42 | @Html.AntiForgeryToken()
43 | []
44 | }
45 | }
46 | else
47 | {
48 | [ @Html.ActionLink("Add", "AddPhoneNumber")
49 | }
50 |
51 | *@
52 | - Two-Factor Authentication:
53 | -
54 |
55 | There are no two-factor authentication providers configured. See this article
56 | for details on setting up this ASP.NET application to support two-factor authentication.
57 |
58 | @*@if (Model.TwoFactor)
59 | {
60 | using (Html.BeginForm("DisableTwoFactorAuthentication", "Manage", FormMethod.Post, new { role = "form" }))
61 | {
62 | @Html.AntiForgeryToken()
63 | Enabled
64 |
65 |
66 | }
67 | }
68 | else
69 | {
70 | using (Html.BeginForm("EnableTwoFactorAuthentication", "Manage", FormMethod.Post, new { role = "form" }))
71 | {
72 | @Html.AntiForgeryToken()
73 | Disabled
74 |
75 |
76 | }
77 | }*@
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Manage/ManageLogins.cshtml:
--------------------------------------------------------------------------------
1 | @model MvcTemplate.Web.ViewModels.Manage.ManageLoginsViewModel
2 | @using Microsoft.Owin.Security
3 | @{
4 | this.ViewBag.Title = "Manage your external logins";
5 | }
6 |
7 | @(this.ViewBag.Title).
8 |
9 | @(this.ViewBag.StatusMessage)
10 | @{
11 | var loginProviders = this.Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes();
12 | if (!loginProviders.Any())
13 | {
14 |
15 |
16 | There are no external authentication services configured. See this article
17 | for details on setting up this ASP.NET application to support logging in via external services.
18 |
19 |
20 | }
21 | else
22 | {
23 | if (this.Model.CurrentLogins.Count > 0)
24 | {
25 | Registered Logins
26 |
54 | }
55 |
56 | if (this.Model.OtherLogins.Count > 0)
57 | {
58 | using (this.Html.BeginForm("LinkLogin", "Manage"))
59 | {
60 | @(this.Html.AntiForgeryToken())
61 |
62 |
63 | @foreach (AuthenticationDescription p in this.Model.OtherLogins)
64 | {
65 |
66 | }
67 |
68 |
69 | }
70 | }
71 | }
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Manage/SetPassword.cshtml:
--------------------------------------------------------------------------------
1 | @model MvcTemplate.Web.ViewModels.Manage.SetPasswordViewModel
2 | @{
3 | this.ViewBag.Title = "Create Password";
4 | }
5 |
6 | @(this.ViewBag.Title).
7 |
8 | You do not have a local username/password for this site. Add a local
9 | account so you can log in without an external login.
10 |
11 |
12 | @using (this.Html.BeginForm("SetPassword", "Manage", FormMethod.Post, new { role = "form" }))
13 | {
14 | @(this.Html.AntiForgeryToken())
15 |
16 | Create Local Login
17 |
18 | @(this.Html.ValidationSummary(string.Empty, new { @class = "text-danger" }))
19 |
25 |
31 |
36 | }
37 |
38 | @section Scripts {
39 | @Scripts.Render("~/bundles/jqueryval")
40 | }
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Manage/VerifyPhoneNumber.cshtml:
--------------------------------------------------------------------------------
1 | @model MvcTemplate.Web.ViewModels.Manage.VerifyPhoneNumberViewModel
2 | @{
3 | this.ViewBag.Title = "Verify Phone Number";
4 | }
5 |
6 | @(this.ViewBag.Title).
7 |
8 | @using (this.Html.BeginForm("VerifyPhoneNumber", "Manage", FormMethod.Post, new { role = "form" }))
9 | {
10 | @(this.Html.AntiForgeryToken())
11 | @(this.Html.Hidden("phoneNumber", this.Model.PhoneNumber))
12 | Enter verification code
13 | @(this.ViewBag.Status)
14 |
15 | @(this.Html.ValidationSummary(string.Empty, new { @class = "text-danger" }))
16 |
22 |
27 | }
28 |
29 | @section Scripts {
30 | @Scripts.Render("~/bundles/jqueryval")
31 | }
32 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Shared/Error.cshtml:
--------------------------------------------------------------------------------
1 | @model HandleErrorInfo
2 |
3 | @{
4 | this.ViewBag.Title = "Error";
5 | }
6 |
7 | Error.
8 | An error occurred while processing your request.
9 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Shared/Lockout.cshtml:
--------------------------------------------------------------------------------
1 | @model HandleErrorInfo
2 |
3 | @{
4 | this.ViewBag.Title = "Locked Out";
5 | }
6 |
7 |
8 | Locked out.
9 | This account has been locked out, please try again later.
10 |
11 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Shared/_Layout.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | @(this.ViewBag.Title) - MvcTemplate
7 | @Styles.Render("~/Content/css")
8 |
9 |
10 |
22 |
23 |
24 | @(this.RenderBody())
25 |
26 |
29 |
30 |
31 | @Scripts.Render("~/bundles/jquery")
32 | @Scripts.Render("~/bundles/bootstrap")
33 | @(this.RenderSection("scripts", required: false))
34 |
35 |
36 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/Shared/_LoginPartial.cshtml:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNet.Identity
2 | @if (this.Request.IsAuthenticated)
3 | {
4 | using (this.Html.BeginForm("LogOff", "Account", new { area = string.Empty }, FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
5 | {
6 | @(this.Html.AntiForgeryToken())
7 |
8 |
9 | -
10 | @(this.Html.ActionLink("Hello " + this.User.Identity.GetUserName() + "!", "Index", "Manage", routeValues: new { area = string.Empty }, htmlAttributes: new { title = "Manage", @class = "nav-link" }))
11 |
12 | -
13 | Log off
14 |
15 |
16 | }
17 | }
18 | else
19 | {
20 |
21 | - @(this.Html.ActionLink("Register", "Register", "Account", routeValues: new { area = string.Empty }, htmlAttributes: new { id = "registerLink", @class = "nav-link" }))
22 | - @(this.Html.ActionLink("Log in", "Login", "Account", routeValues: new { area = string.Empty }, htmlAttributes: new { id = "loginLink", @class = "nav-link" }))
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.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 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | this.Layout = "~/Views/Shared/_Layout.cshtml";
3 | }
4 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.Web/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NikolayIT/ASP.NET-MVC-5-Template/23ae5bc7b15c60d8e108088b4290dec27792529d/src/Web/MvcTemplate.Web/favicon.ico
--------------------------------------------------------------------------------
/src/Web/MvcTemplate.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 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/src/appveyor.yml:
--------------------------------------------------------------------------------
1 | version: 1.0.{build}
2 | before_build:
3 | - cmd: nuget restore "ASP.NET MVC 5/MvcTemplate.sln"
4 | build:
5 | project: ASP.NET MVC 5/MvcTemplate.sln
6 | verbosity: minimal
--------------------------------------------------------------------------------
/src/stylecop.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
3 | "settings": {
4 | "layoutRules": {
5 | "newlineAtEndOfFile": "require"
6 | },
7 | "namingRules": {
8 | "allowCommonHungarianPrefixes": true
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/tools/TemplateRenamer/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 |
24 | # Visual Studio 2015 cache/options directory
25 | .vs/
26 | # Uncomment if you have tasks that create the project's static files in wwwroot
27 | #wwwroot/
28 |
29 | # MSTest test Results
30 | [Tt]est[Rr]esult*/
31 | [Bb]uild[Ll]og.*
32 |
33 | # NUNIT
34 | *.VisualState.xml
35 | TestResult.xml
36 |
37 | # Build Results of an ATL Project
38 | [Dd]ebugPS/
39 | [Rr]eleasePS/
40 | dlldata.c
41 |
42 | # DNX
43 | project.lock.json
44 | artifacts/
45 |
46 | *_i.c
47 | *_p.c
48 | *_i.h
49 | *.ilk
50 | *.meta
51 | *.obj
52 | *.pch
53 | *.pdb
54 | *.pgc
55 | *.pgd
56 | *.rsp
57 | *.sbr
58 | *.tlb
59 | *.tli
60 | *.tlh
61 | *.tmp
62 | *.tmp_proj
63 | *.log
64 | *.vspscc
65 | *.vssscc
66 | .builds
67 | *.pidb
68 | *.svclog
69 | *.scc
70 |
71 | # Chutzpah Test files
72 | _Chutzpah*
73 |
74 | # Visual C++ cache files
75 | ipch/
76 | *.aps
77 | *.ncb
78 | *.opendb
79 | *.opensdf
80 | *.sdf
81 | *.cachefile
82 |
83 | # Visual Studio profiler
84 | *.psess
85 | *.vsp
86 | *.vspx
87 | *.sap
88 |
89 | # TFS 2012 Local Workspace
90 | $tf/
91 |
92 | # Guidance Automation Toolkit
93 | *.gpState
94 |
95 | # ReSharper is a .NET coding add-in
96 | _ReSharper*/
97 | *.[Rr]e[Ss]harper
98 | *.DotSettings.user
99 |
100 | # JustCode is a .NET coding add-in
101 | .JustCode
102 |
103 | # TeamCity is a build add-in
104 | _TeamCity*
105 |
106 | # DotCover is a Code Coverage Tool
107 | *.dotCover
108 |
109 | # NCrunch
110 | _NCrunch_*
111 | .*crunch*.local.xml
112 | nCrunchTemp_*
113 |
114 | # MightyMoose
115 | *.mm.*
116 | AutoTest.Net/
117 |
118 | # Web workbench (sass)
119 | .sass-cache/
120 |
121 | # Installshield output folder
122 | [Ee]xpress/
123 |
124 | # DocProject is a documentation generator add-in
125 | DocProject/buildhelp/
126 | DocProject/Help/*.HxT
127 | DocProject/Help/*.HxC
128 | DocProject/Help/*.hhc
129 | DocProject/Help/*.hhk
130 | DocProject/Help/*.hhp
131 | DocProject/Help/Html2
132 | DocProject/Help/html
133 |
134 | # Click-Once directory
135 | publish/
136 |
137 | # Publish Web Output
138 | *.[Pp]ublish.xml
139 | *.azurePubxml
140 | # TODO: Comment the next line if you want to checkin your web deploy settings
141 | # but database connection strings (with potential passwords) will be unencrypted
142 | *.pubxml
143 | *.publishproj
144 |
145 | # NuGet Packages
146 | *.nupkg
147 | # The packages folder can be ignored because of Package Restore
148 | **/packages/*
149 | # except build/, which is used as an MSBuild target.
150 | !**/packages/build/
151 | # Uncomment if necessary however generally it will be regenerated when needed
152 | #!**/packages/repositories.config
153 | # NuGet v3's project.json files produces more ignoreable files
154 | *.nuget.props
155 | *.nuget.targets
156 |
157 | # Microsoft Azure Build Output
158 | csx/
159 | *.build.csdef
160 |
161 | # Microsoft Azure Emulator
162 | ecf/
163 | rcf/
164 |
165 | # Microsoft Azure ApplicationInsights config file
166 | ApplicationInsights.config
167 |
168 | # Windows Store app package directory
169 | AppPackages/
170 | BundleArtifacts/
171 |
172 | # Visual Studio cache files
173 | # files ending in .cache can be ignored
174 | *.[Cc]ache
175 | # but keep track of directories ending in .cache
176 | !*.[Cc]ache/
177 |
178 | # Others
179 | ClientBin/
180 | ~$*
181 | *~
182 | *.dbmdl
183 | *.dbproj.schemaview
184 | *.pfx
185 | *.publishsettings
186 | node_modules/
187 | orleans.codegen.cs
188 |
189 | # RIA/Silverlight projects
190 | Generated_Code/
191 |
192 | # Backup & report files from converting an old project file
193 | # to a newer Visual Studio version. Backup files are not needed,
194 | # because we have git ;-)
195 | _UpgradeReport_Files/
196 | Backup*/
197 | UpgradeLog*.XML
198 | UpgradeLog*.htm
199 |
200 | # SQL Server files
201 | *.mdf
202 | *.ldf
203 |
204 | # Business Intelligence projects
205 | *.rdl.data
206 | *.bim.layout
207 | *.bim_*.settings
208 |
209 | # Microsoft Fakes
210 | FakesAssemblies/
211 |
212 | # GhostDoc plugin setting file
213 | *.GhostDoc.xml
214 |
215 | # Node.js Tools for Visual Studio
216 | .ntvs_analysis.dat
217 |
218 | # Visual Studio 6 build log
219 | *.plg
220 |
221 | # Visual Studio 6 workspace options file
222 | *.opt
223 |
224 | # Visual Studio LightSwitch build output
225 | **/*.HTMLClient/GeneratedArtifacts
226 | **/*.DesktopClient/GeneratedArtifacts
227 | **/*.DesktopClient/ModelManifest.xml
228 | **/*.Server/GeneratedArtifacts
229 | **/*.Server/ModelManifest.xml
230 | _Pvt_Extensions
231 |
232 | # Paket dependency manager
233 | .paket/paket.exe
234 |
235 | # FAKE - F# Make
236 | .fake/
237 |
--------------------------------------------------------------------------------
/tools/TemplateRenamer/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/tools/TemplateRenamer/Program.cs:
--------------------------------------------------------------------------------
1 | namespace TemplateRenamer
2 | {
3 | using System;
4 | using System.IO;
5 | using System.Text;
6 |
7 | public static class Program
8 | {
9 | public static void Main()
10 | {
11 | Console.WriteLine("ASP.NET MVC Template Renamer v1.0");
12 | Console.WriteLine("Working in: " + Environment.CurrentDirectory);
13 |
14 | var oldName = string.Empty;
15 | while (string.IsNullOrWhiteSpace(oldName))
16 | {
17 | Console.Write("What is your project's old name ([a-zA-z]): ");
18 | oldName = Console.ReadLine();
19 | }
20 |
21 | var newName = string.Empty;
22 | while (string.IsNullOrWhiteSpace(newName))
23 | {
24 | Console.Write("What is your project's name ([a-zA-z]): ");
25 | newName = Console.ReadLine();
26 | }
27 |
28 | Console.WriteLine("Renaming directories...");
29 | RenameDirectories(Environment.CurrentDirectory, oldName, newName);
30 | Console.WriteLine("Directories renamed.");
31 |
32 | Console.WriteLine("Renaming files...");
33 | RenameFiles(Environment.CurrentDirectory, oldName, newName);
34 | Console.WriteLine("Files renamed.");
35 |
36 | Console.WriteLine("Renaming file contents...");
37 | RenameFileContents(Environment.CurrentDirectory, oldName, newName);
38 | Console.WriteLine("File contents renamed.");
39 |
40 | Console.WriteLine("Done!");
41 | }
42 |
43 | private static void RenameDirectories(string currentDirectory, string originalName, string newName)
44 | {
45 | var directories = Directory.GetDirectories(currentDirectory);
46 | foreach (var directory in directories)
47 | {
48 | var newDirectoryName = directory.Replace(originalName, newName);
49 | if (newDirectoryName != directory)
50 | {
51 | Directory.Move(directory, newDirectoryName);
52 | }
53 | }
54 |
55 | directories = Directory.GetDirectories(currentDirectory);
56 | foreach (var directory in directories)
57 | {
58 | RenameDirectories(directory, originalName, newName);
59 | }
60 | }
61 |
62 | private static void RenameFiles(string currentDirectory, string originalName, string newName)
63 | {
64 | var files = Directory.GetFiles(currentDirectory);
65 | foreach (var file in files)
66 | {
67 | var newFileName = file.Replace(originalName, newName);
68 | if (newFileName != file)
69 | {
70 | Directory.Move(file, newFileName);
71 | }
72 | }
73 |
74 | var subDirectories = Directory.GetDirectories(currentDirectory);
75 | foreach (var directory in subDirectories)
76 | {
77 | RenameFiles(directory, originalName, newName);
78 | }
79 | }
80 |
81 | private static void RenameFileContents(string currentDirectory, string originalName, string newName)
82 | {
83 | var files = Directory.GetFiles(currentDirectory);
84 | foreach (var file in files)
85 | {
86 | if (!file.EndsWith(".exe"))
87 | {
88 | var contents = File.ReadAllText(file);
89 | contents = contents.Replace(originalName, newName);
90 | File.WriteAllText(file, contents, Encoding.UTF8);
91 | }
92 | }
93 |
94 | var subDirectories = Directory.GetDirectories(currentDirectory);
95 | foreach (var directory in subDirectories)
96 | {
97 | RenameFileContents(directory, originalName, newName);
98 | }
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/tools/TemplateRenamer/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("TemplateRenamer")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("TemplateRenamer")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
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("25cb8f9b-87b7-46d2-a80d-c96e70ceb27f")]
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 |
--------------------------------------------------------------------------------
/tools/TemplateRenamer/TemplateRenamer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {25CB8F9B-87B7-46D2-A80D-C96E70CEB27F}
8 | Exe
9 | Properties
10 | TemplateRenamer
11 | TemplateRenamer
12 | v4.6
13 | 512
14 | true
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
60 |
--------------------------------------------------------------------------------
/tools/TemplateRenamer/TemplateRenamer.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.24720.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TemplateRenamer", "TemplateRenamer.csproj", "{25CB8F9B-87B7-46D2-A80D-C96E70CEB27F}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {25CB8F9B-87B7-46D2-A80D-C96E70CEB27F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {25CB8F9B-87B7-46D2-A80D-C96E70CEB27F}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {25CB8F9B-87B7-46D2-A80D-C96E70CEB27F}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {25CB8F9B-87B7-46D2-A80D-C96E70CEB27F}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------