Repository navigation
Expand file tree
/
Copy pathBaseContainer.cs
More file actions
43 lines (37 loc) · 1.55 KB
/
Copy pathBaseContainer.cs
File metadata and controls
43 lines (37 loc) · 1.55 KB
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
using System;
using System.IO;
using System.Web.Mvc;
namespace SuperScript.Container.Mvc
{
public abstract class BaseContainer : IDisposable
{
protected internal readonly string EmitterKey;
protected internal readonly int? InsertAt;
protected internal readonly WebViewPage WebPage;
/// <summary>
/// Create a new using block from the given helper (used for trapping appropriate context)
/// </summary>
/// <param name="helper">
/// The helper from which we use the context.
/// </param>
/// <param name="emitterKey">
/// <para>Indicates which instance of <see cref="SuperScript.Emitters.IEmitter"/> the content should be added to.</para>
/// <para>If not specified then the contents will be added to the default implementation of <see cref="SuperScript.Emitters.IEmitter"/>.</para>
/// </param>
/// <param name="insertAt">
/// Indicates the index in the collection at which the contents are to be inserted.
/// </param>
protected BaseContainer(HtmlHelper helper, string emitterKey, int? insertAt)
{
EmitterKey = emitterKey;
InsertAt = insertAt;
WebPage = (WebViewPage) helper.ViewDataContainer;
// start a new writing context
WebPage.OutputStack.Push(new StringWriter());
}
/// <summary>
/// Append the internal content to the context's cached list of output delegates
/// </summary>
public abstract void Dispose();
}
}