Click here to Skip to main content
15,921,643 members
Home / Discussions / C#
   

C#

 
AnswerRe: Error : Cannot write to a closed TextWriter Pin
Judah Gabriel Himango7-Jul-06 4:39
sponsorJudah Gabriel Himango7-Jul-06 4:39 
AnswerRe: Error : Cannot write to a closed TextWriter Pin
Judah Gabriel Himango7-Jul-06 4:40
sponsorJudah Gabriel Himango7-Jul-06 4:40 
GeneralProblem - Re: Error : Cannot write to a closed TextWriter [modified] Pin
adityap9-Jul-06 20:00
adityap9-Jul-06 20:00 
QuestionPage Timers Pin
Brendan Vogt7-Jul-06 1:46
Brendan Vogt7-Jul-06 1:46 
AnswerRe: Page Timers Pin
Guffa7-Jul-06 3:57
Guffa7-Jul-06 3:57 
AnswerRe: Page Timers Pin
Dustin Metzgar7-Jul-06 4:04
Dustin Metzgar7-Jul-06 4:04 
QuestionCreating an options dialog for my WinApp. Pin
anderslundsgard7-Jul-06 1:14
anderslundsgard7-Jul-06 1:14 
AnswerRe: Creating an options dialog for my WinApp. Pin
Robert Rohde7-Jul-06 4:37
Robert Rohde7-Jul-06 4:37 
I have a very similar situation. I'll try to outline what I did:

1. Every module has a class implementing my IModule interface.
2. The IModule interface contains a method like OptionsControlBase[] GetOptionsControl().
3. OptionsControlBase is simply an empty user control defining the following functions:
public abstract void ApplyChanges();
public abstract void UpdateOptions();
public abstract string Name { get; }
...

4. Now when the options dialog is opened it iterates through all modules, asks those for the options controls and generates one tab on the fly for each of them. The name of the tab is just what is returned by the Name property and the whole options control is docked with fill into the tab. Also one call to
UpdateOptions
is done for each.
5. UpdateOptions implements the logic for filling the options control with the current application settings. Thus if you need some kind of reset button on the options form just call this one again on each control.
6. ApplyChanges gets called on every options control when the user clicks 'Ok' or 'Apply' on the options form. It contains the logic to apply the settings within the option controls to the application settings.

Everything clear?
To store and load these settings just add more functions (like GetSettings and SetSettings) to your modules. Then when you want to load or save all application settings just iterate over the list of modules and call those functions on each of them.
QuestionHow to get data from text box respective of text position ? Pin
praveenqwe7-Jul-06 0:52
praveenqwe7-Jul-06 0:52 
AnswerRe: How to get data from text box respective of text position ? Pin
stancrm7-Jul-06 1:03
stancrm7-Jul-06 1:03 
QuestionHow to make a Class object global?? Pin
suguimoto7-Jul-06 0:25
suguimoto7-Jul-06 0:25 
AnswerRe: How to make a Class object global?? [modified] Pin
psamy7-Jul-06 0:38
psamy7-Jul-06 0:38 
AnswerRe: How to make a Class object global?? Pin
Brendan Vogt7-Jul-06 0:42
Brendan Vogt7-Jul-06 0:42 
AnswerRe: How to make a Class object global?? Pin
Guffa7-Jul-06 3:43
Guffa7-Jul-06 3:43 
GeneralHeh, doesn't work Pin
Ennis Ray Lynch, Jr.7-Jul-06 8:23
Ennis Ray Lynch, Jr.7-Jul-06 8:23 
AnswerRe: Heh, doesn't work Pin
Guffa7-Jul-06 23:45
Guffa7-Jul-06 23:45 
QuestionRichTextBoxControl cursor position Pin
Radu Sorin7-Jul-06 0:16
Radu Sorin7-Jul-06 0:16 
AnswerRe: RichTextBoxControl cursor position Pin
mav.northwind7-Jul-06 1:07
mav.northwind7-Jul-06 1:07 
AnswerRe: RichTextBoxControl cursor position Pin
BoneSoft7-Jul-06 3:48
BoneSoft7-Jul-06 3:48 
QuestionData Access Application Block AddInParameter method Pin
Brendan Vogt7-Jul-06 0:12
Brendan Vogt7-Jul-06 0:12 
AnswerRe: Data Access Application Block AddInParameter method Pin
Not Active7-Jul-06 2:56
mentorNot Active7-Jul-06 2:56 
QuestionData Access Application Block Pin
Brendan Vogt7-Jul-06 0:04
Brendan Vogt7-Jul-06 0:04 
AnswerRe: Data Access Application Block Pin
Not Active7-Jul-06 2:49
mentorNot Active7-Jul-06 2:49 
QuestionWebbrowser control - opening link in new window Pin
Oohmesh6-Jul-06 23:59
Oohmesh6-Jul-06 23:59 
AnswerRe: Webbrowser control - opening link in new window Pin
Anh_Tuan7-Jul-06 1:34
Anh_Tuan7-Jul-06 1:34 

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.