Click here to Skip to main content
15,887,875 members
Home / Discussions / C#
   

C#

 
GeneralRe: Factory Pattern... Why? Pin
harold aptroot6-Apr-15 10:09
harold aptroot6-Apr-15 10:09 
AnswerRe: Factory Pattern... Why? Pin
CHill606-Apr-15 9:57
mveCHill606-Apr-15 9:57 
AnswerRe: Factory Pattern... Why? Pin
Abhinav S6-Apr-15 16:52
Abhinav S6-Apr-15 16:52 
AnswerRe: Factory Pattern... Why? Pin
Eddy Vluggen6-Apr-15 21:41
professionalEddy Vluggen6-Apr-15 21:41 
AnswerRe: Factory Pattern... Why? Pin
Nathan Minier8-Apr-15 2:30
professionalNathan Minier8-Apr-15 2:30 
GeneralRe: Factory Pattern... Why? Pin
BillWoodruff9-Apr-15 9:27
professionalBillWoodruff9-Apr-15 9:27 
GeneralRe: Factory Pattern... Why? Pin
Nathan Minier13-Apr-15 1:54
professionalNathan Minier13-Apr-15 1:54 
QuestionReading and storing application settings in an object at startup Pin
Member 115846886-Apr-15 6:44
Member 115846886-Apr-15 6:44 
Hi,

My application has a properties class that I currently instantiate in a form. I then read values from a database to store in the class. I use this class to store settings I need in the form currently.

I want this class to be application wide instead, as more than one form (or other class) will need the data. I defined my properties class in the namespace already.

If I want to instantiate the class for the WHOLE application, should I use the app.Properties.Settings.Default to use it application wide? This is not an object I want to persist. I will create and load it up every time the application starts.

Can I define an instance of the class as static member in the program.cs module? Load it up by running a function before the application.Run is executed?

I don't want this to be form dependent if possible, as I want to re-use the concept in my future applications, whether they are forms, services etc.

What is the best method to accomplish this cleanly?

Best wishes!

AnswerRe: Reading and storing application settings in an object at startup Pin
Gerry Schmitz6-Apr-15 12:27
mveGerry Schmitz6-Apr-15 12:27 
GeneralRe: Reading and storing application settings in an object at startup Pin
Member 115846887-Apr-15 4:57
Member 115846887-Apr-15 4:57 
GeneralRe: Reading and storing application settings in an object at startup Pin
Gerry Schmitz7-Apr-15 9:06
mveGerry Schmitz7-Apr-15 9:06 
GeneralRe: Reading and storing application settings in an object at startup Pin
Member 115846887-Apr-15 8:54
Member 115846887-Apr-15 8:54 
GeneralRe: Reading and storing application settings in an object at startup Pin
Gerry Schmitz7-Apr-15 10:30
mveGerry Schmitz7-Apr-15 10:30 
GeneralRe: Reading and storing application settings in an object at startup Pin
Member 115846888-Apr-15 2:43
Member 115846888-Apr-15 2:43 
GeneralRe: Reading and storing application settings in an object at startup Pin
Gerry Schmitz8-Apr-15 10:49
mveGerry Schmitz8-Apr-15 10:49 
AnswerRe: Reading and storing application settings in an object at startup Pin
Nathan Minier8-Apr-15 2:37
professionalNathan Minier8-Apr-15 2:37 
QuestionPerformanceCounter RawValue is not changed\modified Pin
dushkin6-Apr-15 6:05
dushkin6-Apr-15 6:05 
QuestionTextbox for numbers C# Pin
Member 114516056-Apr-15 5:06
Member 114516056-Apr-15 5:06 
AnswerRe: Textbox for numbers C# Pin
PIEBALDconsult6-Apr-15 5:09
mvePIEBALDconsult6-Apr-15 5:09 
GeneralRe: Textbox for numbers C# Pin
Member 1145160512-Apr-15 9:23
Member 1145160512-Apr-15 9:23 
AnswerRe: Textbox for numbers C# Pin
Ravi Bhavnani6-Apr-15 6:05
professionalRavi Bhavnani6-Apr-15 6:05 
QuestionQuery error: no such column Pin
DPaul19946-Apr-15 4:17
DPaul19946-Apr-15 4:17 
AnswerRe: Query error: no such column Pin
Dave Kreskowiak6-Apr-15 4:50
mveDave Kreskowiak6-Apr-15 4:50 
GeneralRe: Query error: no such column Pin
DPaul19946-Apr-15 5:40
DPaul19946-Apr-15 5:40 
GeneralRe: Query error: no such column Pin
Dave Kreskowiak6-Apr-15 6:26
mveDave Kreskowiak6-Apr-15 6:26 

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.