I’ve been trying to figure out a way to update the interface after each step my .dll takes, but since there may be multiple .dll’s (each one running in a different time) i don’t feel like having them so attached to the UI layer.
This is my lattest thread, but the architeture was very confuse, so i removed the notification logic already.
My Goal:
- UI Invokes .dll Dinamically (OK,this works)
-
The .dll ( a crawler, in this case), do its work, and log every step in a file, using a known format. (OK, this is done already)
-
UI Layer, somehow, “knows” or “check periodically” for changes in the file, and parses it in order to display the file content in the user interface (maybe a logbox or w.e)
I am trying to achieve number 3 at the moment, any tips of how to do it without having the .dll too attached / dependant of the interface layer ?
Questions:
-
Is there any cons of reading the file within the interface layer in order to have it updated ?
-
Is there any event i may check to handle when the “file changes” or something like that ?
-
If there is no event, can i check asynchronously for the file, to read it,parse it, and show the results in the ui?
What would be the clear/best approach ?
Observations:
Using callbacks here is not an option, since i was using it, and because the “depth” of my url layers, firing and throwing events to the upper layer would take me 5-6 layers to reach the user interface itself.
Thanks in advance!
a
FileSystemWatchershould sort you out