Welcome to mirror list, hosted at ThFree Co, Russian Federation.

StaticPartialCachingControl.cs « System.Web.UI « System.Web « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e21e9e2b40f21322b816eff5b2b2957c65662ed4 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// System.Web.UI.StaticPartialCachingControl.cs
//
// Author:
//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2003 Andreas Nahr
//

using System;
using System.ComponentModel;

namespace System.Web.UI
{
	public class StaticPartialCachingControl : BasePartialCachingControl
	{

		private BuildMethod buildMethod;

		public StaticPartialCachingControl (string ctrlID, string guid, int duration,
				string varyByParams, string varyByControls, string varyByCustom,
				BuildMethod buildMethod)
		{
			CtrlID = ctrlID;
			Guid = guid;
			Duration = duration;
			VaryByParams = varyByParams;
			VaryByControls = varyByControls;
			VaryByCustom = varyByCustom;
			
			this.buildMethod = buildMethod;
		}

		public static void BuildCachedControl (Control parent, string ctrlID, string guid,
				int duration, string varyByParams, string varyByControls,
				string varyByCustom, BuildMethod buildMethod)
		{
			StaticPartialCachingControl NewControl =
				new StaticPartialCachingControl (ctrlID, guid, duration,
						varyByParams, varyByControls, varyByCustom,
						buildMethod);

			parent.Controls.Add (NewControl);
		}

		internal override Control CreateControl()
		{
		       return buildMethod ();
		}
	}
}