Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Global Variables C#
Message
From
11/12/2009 18:05:42
 
 
To
11/12/2009 18:02:10
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01438724
Message ID:
01438725
Views:
77
>What's the best way to handle global variables that are established when the app startes - e.g. user id, company id, connection string, etc in a Windows form or WPF application as the app moves from form to form?
>I've been rolling properties forward from one form to the other and it seems that must be a better way?
>I read somewhere about copying a dictionary and that seemed to make sense.
>Any suggestions?

Do you have an application object? That would be the best way. Basically, all applications should have an application object that contains all the settings like this. Thus, you can refer to it from anywhere in your code. That would be something such as oApp.cMyProperty.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform