Click here to Skip to main content
15,913,487 members
Home / Discussions / C#
   

C#

 
QuestionWindows Forms vs DirectX Pin
Generico30010-Nov-08 7:38
Generico30010-Nov-08 7:38 
AnswerRe: Windows Forms vs DirectX Pin
Wendelius10-Nov-08 7:46
mentorWendelius10-Nov-08 7:46 
AnswerRe: Windows Forms vs DirectX Pin
Mark Salsbery10-Nov-08 8:25
Mark Salsbery10-Nov-08 8:25 
GeneralRe: Windows Forms vs DirectX Pin
Mark Churchill10-Nov-08 15:59
Mark Churchill10-Nov-08 15:59 
GeneralRe: Windows Forms vs DirectX Pin
Mark Salsbery10-Nov-08 16:04
Mark Salsbery10-Nov-08 16:04 
QuestionTrying to prevent the DataGridView Default Error Dialog Pin
Edward Hoad10-Nov-08 6:13
Edward Hoad10-Nov-08 6:13 
AnswerRe: Trying to prevent the DataGridView Default Error Dialog Pin
paas10-Nov-08 7:40
paas10-Nov-08 7:40 
QuestionUnified Session Variable Pin
k66610-Nov-08 5:56
k66610-Nov-08 5:56 
The situation is that I have utility libraries that are used by both ASP.NET and WinForm/console applications. Occasionally these libraries need to reach into the environment to get information. Since the environments are so different I was looking for suggestions on how to hide those differences in the libraries. Suggestions?

Haven't just been bitten by concurrency issues surrounding static variables in ASP.NET applications the specific problem at hand is storing session variables. In ASP.NET you need to store them in HttpContext.Current.Session and in winform/console apps you would simply use a static variable. How do I provide a storage mechanism that is transparent to which environment it is running in?

I suspect I could write a class that determines the environment (how do I do that?) and either stores the data in Session or a private hashtable for winforms. I'm not that familiar with the class loader. Would I avoid dragging in the Web assemblies if I use fully qualified names surrounded by environment if statements (rather than using statements)?

eg:
if (isAsp){
HttpContext.Current.Session["xxx"] = value;
} else {
winSession["xxx"] = value;
}


Help, suggestions appreciated.
AnswerRe: Unified Session Variable Pin
Ennis Ray Lynch, Jr.10-Nov-08 7:11
Ennis Ray Lynch, Jr.10-Nov-08 7:11 
GeneralAnd Pin
Ennis Ray Lynch, Jr.10-Nov-08 7:13
Ennis Ray Lynch, Jr.10-Nov-08 7:13 
GeneralRe: And Pin
k66610-Nov-08 7:23
k66610-Nov-08 7:23 
GeneralRe: And Pin
Ennis Ray Lynch, Jr.10-Nov-08 7:27
Ennis Ray Lynch, Jr.10-Nov-08 7:27 
GeneralRe: And Pin
Wendelius10-Nov-08 7:34
mentorWendelius10-Nov-08 7:34 
QuestionSave and Load problem on game of life! Pin
b3rt10-Nov-08 5:08
b3rt10-Nov-08 5:08 
AnswerCP Warning: LONG code and not using code tags Pin
leckey10-Nov-08 9:27
leckey10-Nov-08 9:27 
QuestionStrikethrough Font with Datagridview Control [modified] Pin
Paul Unsworth10-Nov-08 4:03
Paul Unsworth10-Nov-08 4:03 
AnswerRe: Strikethrough Font with Datagridview Control Pin
Wendelius10-Nov-08 6:42
mentorWendelius10-Nov-08 6:42 
GeneralRe: Strikethrough Font with Datagridview Control Pin
Paul Unsworth10-Nov-08 21:22
Paul Unsworth10-Nov-08 21:22 
GeneralRe: Strikethrough Font with Datagridview Control Pin
Wendelius11-Nov-08 4:08
mentorWendelius11-Nov-08 4:08 
GeneralRe: Strikethrough Font with Datagridview Control Pin
Paul Unsworth11-Nov-08 5:15
Paul Unsworth11-Nov-08 5:15 
GeneralRe: Strikethrough Font with Datagridview Control Pin
Wendelius11-Nov-08 5:36
mentorWendelius11-Nov-08 5:36 
GeneralRe: Strikethrough Font with Datagridview Control Pin
Paul Unsworth12-Nov-08 2:35
Paul Unsworth12-Nov-08 2:35 
GeneralRe: Strikethrough Font with Datagridview Control Pin
Wendelius13-Nov-08 10:36
mentorWendelius13-Nov-08 10:36 
Questionfast search Pin
duta10-Nov-08 3:42
duta10-Nov-08 3:42 
AnswerRe: fast search Pin
Christian Graus10-Nov-08 3:44
protectorChristian Graus10-Nov-08 3:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.