Click here to Skip to main content
15,886,963 members
Home / Discussions / C#
   

C#

 
AnswerRe: Comparing Images Pin
eclipse2k122-Apr-06 10:42
eclipse2k122-Apr-06 10:42 
QuestionRead strings between delimiters Pin
kani9821-Apr-06 11:28
kani9821-Apr-06 11:28 
AnswerRe: Read strings between delimiters Pin
Ravi Bhavnani21-Apr-06 11:31
professionalRavi Bhavnani21-Apr-06 11:31 
AnswerRe: Read strings between delimiters Pin
Guffa21-Apr-06 12:55
Guffa21-Apr-06 12:55 
AnswerRe: Read strings between delimiters Pin
sujithkumarsl22-Apr-06 16:47
sujithkumarsl22-Apr-06 16:47 
QuestionHaving a max line count in a list control Pin
BambooMoon21-Apr-06 11:25
BambooMoon21-Apr-06 11:25 
AnswerRe: Having a max line count in a list control Pin
Ravi Bhavnani21-Apr-06 11:30
professionalRavi Bhavnani21-Apr-06 11:30 
QuestionObserver Pattern Pin
martin_hughes21-Apr-06 11:07
martin_hughes21-Apr-06 11:07 
Hi All,

Since my last post on Design Patterns, I've been reading up on them and in particular the Observer Pattern, as I think it's the right tool for my specific task.

My scenario is this: I have a small(ish) application which uses a barcode scanner to read barcodes (naturally). Various parts (forms) of the application need to be able to accept the data from the barcode scanner (although not all at once, which I manage on a focus basis). To this end, I created a BarcodeScanner class as a Singleton, so that only one instance exists and so that it has public visability; I also created an event in this class so that it can notify any listeners when a Barcode has been successfully read. Each form that needs to read barcodes simply attaches itself as an Event receiver and so can listen (observe) the barcode scanner class.

And this all works pretty well, which is the important thing. But what I'd like to know is, is this an example of the Observer pattern as implemented in C#? Most of the articles I've read on the subject are great at explaining the abstract concept, but rely on the reader's intelligence (Sigh | :sigh: ) to work out the implementation details for themselves.

Cheers,

Martin.


AnswerRe: Observer Pattern Pin
Ravi Bhavnani21-Apr-06 11:26
professionalRavi Bhavnani21-Apr-06 11:26 
GeneralRe: Observer Pattern Pin
martin_hughes21-Apr-06 11:51
martin_hughes21-Apr-06 11:51 
General64 bit / IME / WindowsHook problem Pin
Daniel Grunwald21-Apr-06 10:11
Daniel Grunwald21-Apr-06 10:11 
GeneralRe: 64 bit / IME / WindowsHook problem Pin
LongRange.Shooter21-Apr-06 15:02
LongRange.Shooter21-Apr-06 15:02 
GeneralRe: 64 bit / IME / WindowsHook problem Pin
Daniel Grunwald22-Apr-06 2:06
Daniel Grunwald22-Apr-06 2:06 
QuestionSwitching from DG tp DGV !!!???!!!???!!!??? Pin
mrkeivan21-Apr-06 9:44
mrkeivan21-Apr-06 9:44 
AnswerRe: Switching from DG tp DGV !!!???!!!???!!!??? Pin
Josh Smith21-Apr-06 10:04
Josh Smith21-Apr-06 10:04 
QuestionHow to find what file/s was selected by mouse? Pin
FocusedWolf21-Apr-06 8:35
FocusedWolf21-Apr-06 8:35 
AnswerRe: How to find what file/s was selected by mouse? Pin
Paul Brower21-Apr-06 10:14
Paul Brower21-Apr-06 10:14 
AnswerRe: How to find what file/s was selected by mouse? Pin
John C. Doe21-Apr-06 14:09
John C. Doe21-Apr-06 14:09 
AnswerRe: How to find what file/s was selected by mouse? Pin
John C. Doe21-Apr-06 14:11
John C. Doe21-Apr-06 14:11 
QuestionUsing CollectionBase Pin
JuanAlbertoMD21-Apr-06 8:06
JuanAlbertoMD21-Apr-06 8:06 
AnswerRe: Using CollectionBase Pin
Josh Smith21-Apr-06 10:09
Josh Smith21-Apr-06 10:09 
QuestionHow to add textbox or combobox to toolbar Pin
pliu_200021-Apr-06 7:40
pliu_200021-Apr-06 7:40 
AnswerRe: How to add textbox or combobox to toolbar Pin
Ravi Bhavnani21-Apr-06 8:13
professionalRavi Bhavnani21-Apr-06 8:13 
QuestionEnumerating CD/DVD Drives Pin
Joel Holdsworth21-Apr-06 6:34
Joel Holdsworth21-Apr-06 6:34 
AnswerRe: Enumerating CD/DVD Drives Pin
Paul Brower21-Apr-06 7:38
Paul Brower21-Apr-06 7:38 

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.