Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Preparation for localization.
  • Loading branch information
moonpyk committed Apr 8, 2013
1 parent e5fa47a commit 67e16cc
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 21 deletions.
3 changes: 2 additions & 1 deletion SQLServerBackupTool.Web/App_Start/AutoInstall.cs
Expand Up @@ -2,14 +2,15 @@
using SQLServerBackupTool.Web;
using SQLServerBackupTool.Web.Lib;
using SQLServerBackupTool.Web.Models;
using System.ComponentModel;
using System.Data.Entity;
using System.Web.Security;

[assembly: WebActivator.PostApplicationStartMethod(typeof(AutoInstall), "PostStart")]

namespace SQLServerBackupTool.Web
{

[Localizable(false)]
public static class AutoInstall
{
[UsedImplicitly]
Expand Down
6 changes: 2 additions & 4 deletions SQLServerBackupTool.Web/App_Start/BundleConfig.cs
@@ -1,11 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.Web.Optimization;

namespace SQLServerBackupTool.Web
{
[Localizable(false)]
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
Expand Down
2 changes: 1 addition & 1 deletion SQLServerBackupTool.Web/App_Start/FilterConfig.cs
Expand Up @@ -3,7 +3,7 @@

namespace SQLServerBackupTool.Web
{
public class FilterConfig
public static class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
Expand Down
4 changes: 3 additions & 1 deletion SQLServerBackupTool.Web/App_Start/RouteConfig.cs
@@ -1,8 +1,10 @@
using System.Web.Mvc;
using System.ComponentModel;
using System.Web.Mvc;
using System.Web.Routing;

namespace SQLServerBackupTool.Web
{
[Localizable(false)]
public static class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
Expand Down
10 changes: 5 additions & 5 deletions SQLServerBackupTool.Web/App_Start/WebApiConfig.cs
Expand Up @@ -9,11 +9,11 @@ public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
// config.Routes.MapHttpRoute(
// name: "DefaultApi",
// routeTemplate: "api/{controller}/{id}",
// defaults: new { id = RouteParameter.Optional }
// );
}
}
}
8 changes: 4 additions & 4 deletions SQLServerBackupTool.Web/Controllers/HomeController.cs
Expand Up @@ -141,7 +141,7 @@ public async Task<ActionResult> Backup_Fmt(string id, string format = "json")
return HttpNotFound(string.Format("Unable to create database backup for '{0}'", id));
}

if (format.ToLowerInvariant() == "zip")
if (format.ToLowerInvariant() == @"zip")
{
var path = bk.Path;
var fileName = Path.GetFileName(path);
Expand Down Expand Up @@ -171,7 +171,7 @@ public ActionResult Download(int id)
* Deletion / Purge
*/

[HttpPost, ValidateAntiForgeryToken, Authorize(Roles = "Admin")]
[HttpPost, ValidateAntiForgeryToken, Authorize(Roles = @"Admin")]
public ActionResult BackupsPurge()
{
if (BackupsManager.PurgeOldBackups(DbContext, DateTime.Now, Logger))
Expand Down Expand Up @@ -203,7 +203,7 @@ public ActionResult Delete(int id)
DbContext.SaveChanges();
if (Request.IsAjaxRequest())
{
return Content("OK", "text/plain");
return Content(@"OK", "text/plain");
}

AddFlashMessage("Backup successfully deleted", FlashMessageType.Success);
Expand All @@ -218,7 +218,7 @@ public ActionResult Delete(int id)

if (Request.IsAjaxRequest())
{
return Content("ERR", "text/plain");
return Content(@"ERR", "text/plain");
}

AddFlashMessage("An error occurred while deleting backup.", FlashMessageType.Error);
Expand Down
4 changes: 2 additions & 2 deletions SQLServerBackupTool.Web/Controllers/UsersController.cs
Expand Up @@ -11,7 +11,7 @@

namespace SQLServerBackupTool.Web.Controllers
{
[Authorize(Roles = "Admin")]
[Authorize(Roles = @"Admin")]
public class UsersController : ApplicationController
{
private const int NumberItemsPerPage = 30;
Expand Down Expand Up @@ -46,7 +46,7 @@ public ActionResult Index()
{
int pageIndex;

if (!int.TryParse(Request.Params["page"], out pageIndex))
if (!int.TryParse(Request.Params[@"page"], out pageIndex))
{
pageIndex = 1;
}
Expand Down
2 changes: 2 additions & 0 deletions SQLServerBackupTool.Web/Global.asax.cs
@@ -1,6 +1,7 @@
using NLog;
using NLog.Config;
using NLog.Targets;
using System.ComponentModel;
using System.IO;
using System.Web.Mvc;
using System.Web.Optimization;
Expand All @@ -10,6 +11,7 @@ namespace SQLServerBackupTool.Web
{
// Remarque : pour obtenir des instructions sur l'activation du mode classique IIS6 ou IIS7,
// visitez http://go.microsoft.com/?LinkId=9394801
[Localizable(false)]
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
Expand Down
3 changes: 2 additions & 1 deletion SQLServerBackupTool.Web/Lib/Mvc/ApplicationController.cs
@@ -1,13 +1,14 @@
using NLog;
using SQLServerBackupTool.Web.Models;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Web.Mvc;
using System.Web.Routing;

namespace SQLServerBackupTool.Web.Lib.Mvc
{
[Authorize]
[Authorize, Localizable(false)]
public class ApplicationController : Controller, IFlashMessageProvider
{
protected Logger Logger
Expand Down
4 changes: 3 additions & 1 deletion SQLServerBackupTool.Web/Models/SSBTDbContext.cs
@@ -1,7 +1,9 @@
using System.Data.Entity;
using System.ComponentModel;
using System.Data.Entity;

namespace SQLServerBackupTool.Web.Models
{
[Localizable(false)]
public class SSBTDbContext : DbContext
{
public SSBTDbContext()
Expand Down
2 changes: 1 addition & 1 deletion SQLServerBackupTool/Lib/ConsoleHelper.cs
Expand Up @@ -2,7 +2,7 @@

namespace SQLServerBackupTool.Lib
{
public class ConsoleHelper
public static class ConsoleHelper
{
/// <summary>
/// Enable/disable all coloring while using those helpers
Expand Down

0 comments on commit 67e16cc

Please sign in to comment.