471,336 Members | 1,290 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,336 software developers and data experts.

How to I manipulate a form to satisfy to customer.

Hello!!

Assume I have a form and this form is used by two different customer. At
this moment the form for the two customer is exactly the same.

But assume that one customer want to have the location for the controls at a
different place then the other customer. In addition want to add another
control that the other customer doesn't want to see.

If I had used MFC I could have used resource files to solve these problems
but C# is construced in a different way.

I don't want to duplicate the code by using two forms.

I just wonder how do I solve these kinds of problems in C#.
//Tony


Feb 20 '06 #1
9 1197
"Tony Johansson" <jo*****************@telia.com> wrote in message
news:mC*******************@newsb.telia.net...
Hello!!

Assume I have a form and this form is used by two different customer. At
this moment the form for the two customer is exactly the same.

But assume that one customer want to have the location for the controls at
a different place then the other customer. In addition want to add another
control that the other customer doesn't want to see.

If I had used MFC I could have used resource files to solve these problems
but C# is construced in a different way.

I don't want to duplicate the code by using two forms.

I just wonder how do I solve these kinds of problems in C#.


Use an If statement.

Michael
Feb 20 '06 #2
You could store profiles as serialised objects in your data store.
The profile object could contain descriptive information for each
control such as xy location, if its visible or not, color, size, etc.

Feb 20 '06 #3
You could store profiles as serialised objects in your data store.
The profile object could contain descriptive information for each
control such as xy location, if its visible or not, color, size, etc.

Feb 20 '06 #4

"Michael C" <no****@nospam.com> wrote in message
news:OA**************@TK2MSFTNGP15.phx.gbl...
"Tony Johansson" <jo*****************@telia.com> wrote in message
news:mC*******************@newsb.telia.net...
Hello!!

Assume I have a form and this form is used by two different customer. At
this moment the form for the two customer is exactly the same.

But assume that one customer want to have the location for the controls
at a different place then the other customer. In addition want to add
another control that the other customer doesn't want to see.

If I had used MFC I could have used resource files to solve these
problems but C# is construced in a different way.

I don't want to duplicate the code by using two forms.

I just wonder how do I solve these kinds of problems in C#.


Use an If statement


Ha ha.

Create an interface with properties, methods and events for the logical form
content (the union of the 2).

Create 2 forms implementing the interface.

Use MVC/MVP pattern with the interface as the view.

Load one form or the other using app config files.
Feb 22 '06 #5
"Nick Hounsome" <nh***@nickhounsome.me.uk> wrote in message
news:3e*******************@fe2.news.blueyonder.co. uk...
Use an If statement
Ha ha.


I'm not sure why you find that funny, the differences for the 2 customers
are very minor so just have an if statement to implement the different
functionality.
Create an interface with properties, methods and events for the logical
form content (the union of the 2).

Create 2 forms implementing the interface.

Use MVC/MVP pattern with the interface as the view.

Load one form or the other using app config files.


The OP stated he wanted to do this without creating 2 forms as they are
almost identical.

Michael
Feb 26 '06 #6
1. Create a generic UI container.
2. Use an external definition (serialized format) to describe the dialog.
3. You also need to describe the events of the dialog items as you crate
them, so you can act upon these events.

Not a simple task. I have seen it done before, in other languages, using
XML.

J

On Mon, 20 Feb 2006 21:35:14 +0000, Tony Johansson Woke up an had these
words of wisdom to grace the world.:
Hello!!

Assume I have a form and this form is used by two different customer. At
this moment the form for the two customer is exactly the same.

But assume that one customer want to have the location for the controls at a
different place then the other customer. In addition want to add another
control that the other customer doesn't want to see.

If I had used MFC I could have used resource files to solve these problems
but C# is construced in a different way.

I don't want to duplicate the code by using two forms.

I just wonder how do I solve these kinds of problems in C#.
//Tony


Feb 27 '06 #7

"Michael C" <no****@nospam.com> wrote in message
news:OI**************@TK2MSFTNGP14.phx.gbl...
"Nick Hounsome" <nh***@nickhounsome.me.uk> wrote in message
news:3e*******************@fe2.news.blueyonder.co. uk...
Use an If statement
Ha ha.


I'm not sure why you find that funny, the differences for the 2 customers
are very minor so just have an if statement to implement the different
functionality.


I honestly thought it was supposed to be funny.

I think it is probably safe to say that the OP had already thought of using
an IF statement.
Create an interface with properties, methods and events for the logical
form content (the union of the 2).

Create 2 forms implementing the interface.

Use MVC/MVP pattern with the interface as the view.

Load one form or the other using app config files.


The OP stated he wanted to do this without creating 2 forms as they are
almost identical.


I thought that what he was trying to do was break a mutual dependency
between 2 forms in 2 dlls but since I haven't got the original anymore I
can't say that you are wrong.
Feb 28 '06 #8
Don't any of you realise that this whole thread is redundant?

We all know its not possible to satisfy a customer....

Feb 28 '06 #9
"Steven Nagy" <le*********@hotmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
Don't any of you realise that this whole thread is redundant?

We all know its not possible to satisfy a customer....


Bribery? :-)
Mar 1 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by Phil Powell | last post: by
3 posts views Thread by Brad McMillan | last post: by
2 posts views Thread by rpjd | last post: by
1 post views Thread by info | last post: by
6 posts views Thread by CJONES | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.