Mimic Session object (of ASP.NET) in Winform app

  • Thread starter Thread starter John Indra
  • Start date Start date
J

John Indra

Hello all...

I need to have global data available within the lifetime of my Winform
app, accessible from any objects this application might spring at
runtime.

In ASP.NET, I can just create this holder object, put this object in
(System.Web.SessionState.HttpSessionState)Session object, and whenever
I need to access the global data from virtually any object having
access to the Session object, I just call

((HolderObjectType)Session["TheHolderObject"]).TheData

In Winform, I was hoping that I can rely on
System.Windows.Forms.Application object and put something in it.
Apparently the System.Windows.Forms.Application can't store data like
the System.Web.SessionState.HttpSessionState object.

Is there something obvious that I miss? If not, what is your
recommendation to achieve what I want?

Thanks in advance,

/john
 
Back
Top