using System;
using System.Collections.Generic;
using System.Text;
using Ubik.Engine.Client;
using System.Windows.Forms;
namespace StoresAndStockPricing.Controls{
/// <summary>
/// Simple, and probably temporary, class to ensure that
/// Session.Refresh() is called regularly in a Forms environment.
/// </summary>
public class SessionRefreshTimer
{
Session _session;
Timer _timer = new Timer();
public SessionRefreshTimer(Session session)
{
_session = session;
_timer.Interval = 2000;
_timer.Tick += _timer_Tick;
}
void _timer_Tick(object sender, EventArgs e)
{
_session.Refresh();
}
public bool Enabled
{
get
{
return _timer.Enabled;
}
set
{
_timer.Enabled = value;
}
}
}
}
|