Click here to Skip to main content
15,888,341 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to create Poker Game!!! Pin
Sean Michael Murphy9-Apr-07 2:39
Sean Michael Murphy9-Apr-07 2:39 
GeneralRe: How to create Poker Game!!! Pin
DukeKing9-Apr-07 5:44
DukeKing9-Apr-07 5:44 
QuestionHow to display customize value in ComboBox Pin
indiaone9-Apr-07 1:32
indiaone9-Apr-07 1:32 
AnswerRe: How to display customize value in ComboBox Pin
SABhatti9-Apr-07 3:29
SABhatti9-Apr-07 3:29 
AnswerRe: How to display customize value in ComboBox Pin
PS@Codeproj9-Apr-07 19:35
PS@Codeproj9-Apr-07 19:35 
QuestionDataGridView Pin
719-Apr-07 1:11
719-Apr-07 1:11 
QuestionSelect Operation in ComboBox Pin
AL3600B9-Apr-07 0:20
AL3600B9-Apr-07 0:20 
AnswerRe: Select Operation in ComboBox Pin
Colin Angus Mackay9-Apr-07 1:11
Colin Angus Mackay9-Apr-07 1:11 
A little OO thinking helps.
abstract class FilterBase
{
    public abstract bool PerformOperator(int a, int b); // Or what ever type a and b need to be
}
 
public class EqualsFilter : FilterBase
{
   public bool PerformOperator(int a, int b);
   {
       return (a == b);
   }
}
 
// Create other classes as necessary.

The above is an example of the strategy pattern.

Each item in the combo box is assosiated with a specific instance of the Filter class (or rather one of its derived varients). Because the FilterBase class cotains the methods needed, that is all you ever need to reference. Once set up the rest of the code does not need to know anything about each of the specialised classes.


Upcoming events:
* Edinburgh: Web Security Conference Day for Windows Developers (12th April)
* Glasgow: Introduction to AJAX (2nd May), SQL Server, Mock Objects

Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton


My website

GeneralRe: Select Operation in ComboBox Pin
AL3600B10-Apr-07 18:38
AL3600B10-Apr-07 18:38 
Questionhow to embedding any fileType (also exe) to resources by code (at runTime) ? Pin
hdv2129-Apr-07 0:17
hdv2129-Apr-07 0:17 
AnswerRe: how to embedding any fileType (also exe) to resources by code (at runTime) ? Pin
Colin Angus Mackay9-Apr-07 0:19
Colin Angus Mackay9-Apr-07 0:19 
QuestionLudo board game in c# Pin
khalidelmeknesi8-Apr-07 23:39
khalidelmeknesi8-Apr-07 23:39 
AnswerRe: Ludo board game in c# Pin
netJP12L9-Apr-07 4:31
netJP12L9-Apr-07 4:31 
AnswerRe: Ludo board game in c# Pin
Member 208658512-Nov-10 2:20
Member 208658512-Nov-10 2:20 
Question[Message Deleted] Pin
gubba8-Apr-07 23:36
gubba8-Apr-07 23:36 
AnswerRe: exit from if and for Pin
Luc Pattyn8-Apr-07 23:46
sitebuilderLuc Pattyn8-Apr-07 23:46 
AnswerRe: exit from if and for Pin
AL3600B9-Apr-07 0:23
AL3600B9-Apr-07 0:23 
AnswerRe: exit from if and for Pin
Vasudevan Deepak Kumar9-Apr-07 6:48
Vasudevan Deepak Kumar9-Apr-07 6:48 
QuestionLine Graph in C# Pin
NET/C++Developer8-Apr-07 23:33
NET/C++Developer8-Apr-07 23:33 
Questionis there is any collection which returns three(two key and a values) Pin
pashitech8-Apr-07 23:04
pashitech8-Apr-07 23:04 
AnswerRe: is there is any collection which returns three(two key and a values) Pin
Shajeel8-Apr-07 23:53
Shajeel8-Apr-07 23:53 
AnswerRe: is there is any collection which returns three(two key and a values) Pin
Morantex11-Apr-07 7:59
Morantex11-Apr-07 7:59 
QuestionObject Type Casting problem Pin
srivatsan248-Apr-07 22:28
srivatsan248-Apr-07 22:28 
AnswerRe: Object Type Casting problem Pin
Colin Angus Mackay9-Apr-07 0:17
Colin Angus Mackay9-Apr-07 0:17 
QuestionRe: Object Type Casting problem [modified] Pin
srivatsan249-Apr-07 0:24
srivatsan249-Apr-07 0:24 

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.