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

StateServerItem.cs « System.Web.SessionState « System.Web « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0b6d26046f0199bea4f0d76b3abc3f62ce6445ba (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
52
//
// System.Web.SessionState.StateServerItem
//
// Author(s):
//  Jackson Harper (jackson@ximian.com)
//
// (C) 2003 Novell, Inc (http://www.novell.com)
//

using System;

namespace System.Web.SessionState {

	[Serializable]
	class StateServerItem {

		private byte [] dict_data;
		private byte [] sobjs_data;
		private DateTime last_access;
		private int timeout;

		public StateServerItem (byte [] dict_data, byte [] sobjs_data, int timeout)
		{
			this.dict_data = dict_data;
			this.sobjs_data = sobjs_data;
			this.timeout = timeout;
			this.last_access = DateTime.Now;
		}

		public byte [] DictionaryData {
			get { return dict_data; }
			set { dict_data = value; }
		}

		public byte [] StaticObjectsData {
			get { return sobjs_data; }
			set { sobjs_data = value; }
		}
		
		public void Touch ()
		{
			last_access = DateTime.Now;
		}

		public bool IsAbandoned () {
			if (last_access.AddMinutes (timeout) < DateTime.Now)
				return true;
			return false;
		}
	}
}