it shouldn't be all that difficult, but it would be great if there were some Events to hook into. That way one could provide a statusreport to the user. Thats expecially useful, if you're transferring Attachments.
Thanks,
Eduard Ralph
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
well some basics like connected to server, transferring and finished connection would be great starters. If your transferring Attachments, you might want to be able to show how far down the road it is. (I'm not quite sure how to solve that most efficiently) Maybe a preset amount (in percent or byte) already transferred triggers a event at which time the user could update the progress bar or something of that fashion. In that connection a own thread variant would be nice (though creating one to do that isn't exactly much of a problem.
Thanks,
Eduard Ralph
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-07-16
They are not called Hooks but rather delegates in .net. The easy way to create them is to define them a name space level by
public delegate void ObjectStateCallBack(Object State);
and in the class provide a object of ObjectStateCallBack as a parameter to note that .net does the object type conversion for you. Leave the delegate as an object in the parameters deleclarations.
But this opens a new world in threads as you would need to lock and unlock the data with a Monitor.Enter(this);
Monitor.Exit(this);
Type syntax. but then if you add more threads to the mix you end up with a bigger mess. This can be resovled with a builtin type called Queue. It can continue to add things to the queue even though the worker threads are posting to that thread. its is easy to handle by then having the main thread look at the Queue and dispatch the messages. This is the only message queueing system I have seen correctly work and have upto 1000 threads on a 2.4 Ghz P4 with 1GB ram. and still have user interaction with other programs.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
it shouldn't be all that difficult, but it would be great if there were some Events to hook into. That way one could provide a statusreport to the user. Thats expecially useful, if you're transferring Attachments.
Thanks,
Eduard Ralph
I'll look into this, that would tie in well I think. What kind of events did you have in mind?
Hi Ian,
well some basics like connected to server, transferring and finished connection would be great starters. If your transferring Attachments, you might want to be able to show how far down the road it is. (I'm not quite sure how to solve that most efficiently) Maybe a preset amount (in percent or byte) already transferred triggers a event at which time the user could update the progress bar or something of that fashion. In that connection a own thread variant would be nice (though creating one to do that isn't exactly much of a problem.
Thanks,
Eduard Ralph
They are not called Hooks but rather delegates in .net. The easy way to create them is to define them a name space level by
public delegate void ObjectStateCallBack(Object State);
and in the class provide a object of ObjectStateCallBack as a parameter to note that .net does the object type conversion for you. Leave the delegate as an object in the parameters deleclarations.
But this opens a new world in threads as you would need to lock and unlock the data with a Monitor.Enter(this);
Monitor.Exit(this);
Type syntax. but then if you add more threads to the mix you end up with a bigger mess. This can be resovled with a builtin type called Queue. It can continue to add things to the queue even though the worker threads are posting to that thread. its is easy to handle by then having the main thread look at the Queue and dispatch the messages. This is the only message queueing system I have seen correctly work and have upto 1000 threads on a 2.4 Ghz P4 with 1GB ram. and still have user interaction with other programs.