summaryrefslogtreecommitdiff
path: root/slips/src/app/Marina/Web/Views/WebView.cs
blob: f5174797839b2aaa2771e68fca0602f43ba54b5e (plain)
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
using Marina.Web.Http;

namespace Marina.Web.Views {
	public class WebView< T > : IWebView< T > {
		public WebView( string name, IViewLuggageTransporter< T > viewBag, IHttpGateway gateway ) {
			this.name = name;
			this.gateway = gateway;
			this.viewBag = viewBag;
		}

		public string Name() {
			return name;
		}

		public void Render() {
			gateway.RedirectTo( this );
		}

		public void AddToBag( T slips ) {
			viewBag.Add( slips );
		}

		private readonly string name;
		private readonly IHttpGateway gateway;
		private readonly IViewLuggageTransporter< T > viewBag;
	}
}