First of all, this is just a concept, I have no real programming. This is the situation:
I have a class A that uses Filesystemwatcher to view changes in a folder. (using events)
Then I have a "Collection Class" B that has a list A.
Now I want this to happen
The folder is changing. A detects this and sends a message to B, B passes this message to class C. Class C then starts a method that updates the GUI. (What changes were made, etc.)
Now I searched and thought for quite some time on this topic, but I can not find a solution. But, I found 2 design patterns:
Mediator and observer.
As a software engineer, to some extent I once created an Observer pattern, so I know some of its foundations.
Now to my questions:
Which template is best used in this situation?
How do I make B pass a message to C?
Do I need special events / delegates to pass data from A to B, or can I use inline events?
PS: I use C # as a programming language.
edit: Thanks everyone for helping me vote on the go.
Emerion
source share