-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathSharedControllerBase.cs
49 lines (41 loc) · 1.35 KB
/
SharedControllerBase.cs
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
45
46
47
48
49
//-----------------------------------------------------------------------
// <copyright file="SharedControllerBase.cs" company="(none)">
// Copyright © 2013 John Gietzen and the WebGit .NET Authors. All rights reserved.
// </copyright>
// <author>John Gietzen</author>
//-----------------------------------------------------------------------
namespace WebGitNet
{
using System.Web.Configuration;
using System.Web.Mvc;
public abstract partial class SharedControllerBase : Controller
{
private readonly BreadCrumbTrail breadCrumbs;
private readonly FileManager fileManager;
public SharedControllerBase()
{
var reposPath = WebConfigurationManager.AppSettings["RepositoriesPath"];
this.fileManager = new FileManager(reposPath);
this.breadCrumbs = new BreadCrumbTrail();
ViewBag.BreadCrumbs = this.breadCrumbs;
}
public BreadCrumbTrail BreadCrumbs
{
get
{
return this.breadCrumbs;
}
}
public FileManager FileManager
{
get
{
return this.fileManager;
}
}
protected void AddRepoBreadCrumb(string repo)
{
this.BreadCrumbs.Append("Browse", "ViewRepo", repo, new { repo });
}
}
}