Click here to Skip to main content
15,891,597 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: one questions about Builder Pattern Pin
CodingYoshi18-Nov-08 18:23
CodingYoshi18-Nov-08 18:23 
QuestionWorkflow Services Pin
Mycroft Holmes17-Nov-08 14:33
professionalMycroft Holmes17-Nov-08 14:33 
QuestionLoading objects Pin
CodingYoshi15-Nov-08 8:01
CodingYoshi15-Nov-08 8:01 
AnswerRe: Loading objects Pin
led mike17-Nov-08 5:06
led mike17-Nov-08 5:06 
GeneralRe: Loading objects Pin
CodingYoshi18-Nov-08 8:26
CodingYoshi18-Nov-08 8:26 
QuestionRe: Loading objects Pin
led mike18-Nov-08 8:28
led mike18-Nov-08 8:28 
AnswerRe: Loading objects Pin
CodingYoshi18-Nov-08 18:56
CodingYoshi18-Nov-08 18:56 
Questiondesigning a good way enable/disable controls [modified] Pin
giddy_guitarist12-Nov-08 15:18
giddy_guitarist12-Nov-08 15:18 
hi,

I've finished all the base code to my App. Tested it and everything, now I
need to make a UI.

Its not going to be overly complex but it could get complex later on, so I
want to design it well.

I want a proper way to enable/disable UI but later being able to change
maybe the real control, so far i've come up with.

interface IMainForm//implement this in the main form.
{
IUIController GetUIController(string name);
}
interface IUIController
{
bool Enabled
{ get;set;}
}

The default implementation would be:
class DefUIController : IUIController
{
DefUIController(Control cntrl);
{
}
//encapsulate Controls.Enabled
}


And then in the main form I could search for the control and create a new
UIController and return it, like this:
IUIController GetUIController(string name)
{
foreach(Control crt in this.Controls)
{
if(crt.Name== name)
{
return DefUIController(crt);
}
return null;
}
}



I would need to change the state of a control from a sub UserControl which has a reference via a property to IMainForm.
Like, if the selected Customer in the CustomerGridView UserControl doesn't have a bill yet, _within_ the usercontrol i could do this:
IUIController   ui = _mainform.GetUIController("mnuPrintBill");//Menu
ui.Enabled = false;

Is this design good enough or is there a method out there, I don't need
something complex like CAB or something, its not such a big app.

Thanks so much.

Gideon

modified on Thursday, November 13, 2008 12:07 AM

AnswerRe: designing a good way enable/disable controls Pin
Pete O'Hanlon12-Nov-08 22:30
mvePete O'Hanlon12-Nov-08 22:30 
AnswerRe: designing a good way enable/disable controls Pin
Giorgi Dalakishvili13-Nov-08 0:46
mentorGiorgi Dalakishvili13-Nov-08 0:46 
GeneralRe: designing a good way enable/disable controls Pin
giddy_guitarist13-Nov-08 4:39
giddy_guitarist13-Nov-08 4:39 
GeneralRe: designing a good way enable/disable controls Pin
Ray Cassick14-Nov-08 9:56
Ray Cassick14-Nov-08 9:56 
AnswerRe: designing a good way enable/disable controls Pin
Jani Giannoudis15-Nov-08 5:32
Jani Giannoudis15-Nov-08 5:32 
GeneralRe: designing a good way enable/disable controls Pin
Mycroft Holmes15-Nov-08 23:31
professionalMycroft Holmes15-Nov-08 23:31 
AnswerRe: designing a good way enable/disable controls Pin
CodingYoshi15-Nov-08 7:38
CodingYoshi15-Nov-08 7:38 
GeneralRe: designing a good way enable/disable controls Pin
giddy_guitarist15-Nov-08 19:27
giddy_guitarist15-Nov-08 19:27 
GeneralRe: designing a good way enable/disable controls Pin
CodingYoshi15-Nov-08 22:12
CodingYoshi15-Nov-08 22:12 
GeneralRe: designing a good way enable/disable controls Pin
giddy_guitarist15-Nov-08 22:25
giddy_guitarist15-Nov-08 22:25 
QuestionDatabase Engine Independant Data Modelling Pin
Brady Kelly7-Nov-08 5:03
Brady Kelly7-Nov-08 5:03 
AnswerRe: Database Engine Independant Data Modelling Pin
User 17164927-Nov-08 8:00
professionalUser 17164927-Nov-08 8:00 
AnswerRe: Database Engine Independant Data Modelling Pin
Eduardo B16-Nov-08 13:51
Eduardo B16-Nov-08 13:51 
GeneralPart One of a Series on Replicating Validation Logic Between Client and Server [modified] Pin
Brady Kelly7-Nov-08 3:42
Brady Kelly7-Nov-08 3:42 
QuestionHi there :) Please help me Pin
viashivan5-Nov-08 5:05
viashivan5-Nov-08 5:05 
AnswerRe: Hi there :) Please help me Pin
Vimalsoft(Pty) Ltd17-Nov-08 19:55
professionalVimalsoft(Pty) Ltd17-Nov-08 19:55 
QuestionData structure design Pin
hpjchobbes3-Nov-08 5:57
hpjchobbes3-Nov-08 5:57 

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.