Click here to Skip to main content
15,891,375 members
Home / Discussions / C#
   

C#

 
GeneralRe: Set MdiParent form BackgroundWorker Pin
ddecoy4-Feb-10 2:56
ddecoy4-Feb-10 2:56 
GeneralRe: Set MdiParent form BackgroundWorker Pin
Dave Kreskowiak4-Feb-10 3:37
mveDave Kreskowiak4-Feb-10 3:37 
GeneralRe: Set MdiParent form BackgroundWorker Pin
ddecoy4-Feb-10 4:47
ddecoy4-Feb-10 4:47 
GeneralRe: Set MdiParent form BackgroundWorker Pin
Dave Kreskowiak4-Feb-10 12:41
mveDave Kreskowiak4-Feb-10 12:41 
QuestionHow i implement Strategy Design pattern in following case Pin
pekhaleyogesh3-Feb-10 23:26
pekhaleyogesh3-Feb-10 23:26 
AnswerRe: How i implement Strategy Design pattern in following case Pin
J4amieC3-Feb-10 23:58
J4amieC3-Feb-10 23:58 
GeneralRe: How i implement Strategy Design pattern in following case Pin
pekhaleyogesh4-Feb-10 0:21
pekhaleyogesh4-Feb-10 0:21 
AnswerRe: How i implement Strategy Design pattern in following case Pin
Rob Philpott4-Feb-10 0:21
Rob Philpott4-Feb-10 0:21 
Firstly, and perhaps contentiously I'd forget about the Strategy Pattern. It doesn't event warrent having its own name. (This is just containing a polymorphic base class or interface in another class and providing a method therein to switch the type instantiated). Design patterns usually create more confusion than good.

The trouble you've got is that you don't have a consistent interface on your different derived classes, therefore they cannot be switched in and out. You've got two options, either extend the base class to include the child's additional methods (and provide empty implementations in other children where the method is not applicable) OR somehow call those methods from within those defined in the base class.

If neither of those solutions is applicable, you'll have to treat the two child classes individually with type testing and casts.

Regards,
Rob Philpott.

GeneralRe: How i implement Strategy Design pattern in following case Pin
pekhaleyogesh4-Feb-10 0:25
pekhaleyogesh4-Feb-10 0:25 
AnswerRe: How i implement Strategy Design pattern in following case Pin
Not Active4-Feb-10 1:55
mentorNot Active4-Feb-10 1:55 
GeneralRe: How i implement Strategy Design pattern in following case Pin
pekhaleyogesh4-Feb-10 2:21
pekhaleyogesh4-Feb-10 2:21 
GeneralRe: How i implement Strategy Design pattern in following case Pin
pekhaleyogesh4-Feb-10 2:30
pekhaleyogesh4-Feb-10 2:30 
GeneralRe: How i implement Strategy Design pattern in following case Pin
Not Active4-Feb-10 2:41
mentorNot Active4-Feb-10 2:41 
Questiontying an event to dynamically created radio buttons [Solved] Pin
Wamuti3-Feb-10 22:38
Wamuti3-Feb-10 22:38 
AnswerRe: tying an event to dynamically created radio buttons Pin
Zar Ni3-Feb-10 22:57
Zar Ni3-Feb-10 22:57 
AnswerRe: tying an event to dynamically created radio buttons Pin
Luc Pattyn4-Feb-10 0:14
sitebuilderLuc Pattyn4-Feb-10 0:14 
Questioncreate LogError file(C# Coding) [modified] for WindowsApplication Pin
jojoba20103-Feb-10 22:06
jojoba20103-Feb-10 22:06 
AnswerRe: create LogError file(C# Coding) Pin
Zar Ni3-Feb-10 22:16
Zar Ni3-Feb-10 22:16 
QuestionRe: create LogError file(C# Coding) Pin
jojoba20103-Feb-10 22:38
jojoba20103-Feb-10 22:38 
AnswerRe: create LogError file(C# Coding) Pin
Zar Ni3-Feb-10 22:42
Zar Ni3-Feb-10 22:42 
AnswerRe: create LogError file(C# Coding) [modified] for WindowsApplication Pin
Wamuti3-Feb-10 23:00
Wamuti3-Feb-10 23:00 
QuestionRe: create LogError file(C# Coding) [modified] for WindowsApplication Pin
jojoba20103-Feb-10 23:55
jojoba20103-Feb-10 23:55 
AnswerRe: create LogError file(C# Coding) [modified] for WindowsApplication Pin
Luc Pattyn4-Feb-10 0:18
sitebuilderLuc Pattyn4-Feb-10 0:18 
AnswerRe: create LogError file(C# Coding) [modified] for WindowsApplication Pin
Zar Ni4-Feb-10 13:41
Zar Ni4-Feb-10 13:41 
AnswerRe: create LogError file(C# Coding) [modified] for WindowsApplication Pin
Pr@teek B@h!5-Feb-10 3:37
Pr@teek B@h!5-Feb-10 3:37 

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.