mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
static objects data. * SessionDictionary.cs: Remove type serialization methods, these have been moved to a utility class. Add convenience methods for converting to/from byte arrays. * SessionSQLServerHandler.cs: * SessionStateServerHandler.cs: Save/Restore static objects. Use new to/from byte array methods. * StateServerItem.cs: Hold static objects data. svn path=/trunk/mcs/; revision=20439
53 lines
985 B
C#
53 lines
985 B
C#
//
|
|
// System.Web.SessionState.StateServerItem
|
|
//
|
|
// Author(s):
|
|
// Jackson Harper ([email protected])
|
|
//
|
|
// (C) 2003 Novell, Inc (http://www.novell.com)
|
|
//
|
|
|
|
using System;
|
|
|
|
namespace System.Web.SessionState {
|
|
|
|
[Serializable]
|
|
public 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;
|
|
}
|
|
}
|
|
}
|
|
|