Hi there,
I just read Chris Sells's article at
http://www.codeproject.com/csharp/de...269#xx922269xx
I wonder i can do this:
1)
I want to built in a class library that had multithreading enabled.
My initial overview of the library:
interface IParent
{
void funcA();
}
class Parent : IParent
{
// used this to be extended by other ppl in future
}
interface IChildA
{
int funcB();
}
interface IChildB
{
int funcC();
}
class ChildA : Parent, IChildA
{
}
class ChildB : Parent, IChildB
{
}
After look into your article, is it possible to replace interfaces into
delegates (correct me if i misunderstood).
to be like this?
interface IParent
{
void funcA();
}
class Parent : IParent
{
// used this to be extended by other ppl in future
}
delegate int funcB();
delagate int funcC();
class ChildA
{
public event funcB evtFuncB;
....
}
class ChildB
{
public event funcC evtFuncC;
....
}
So when, my Windows Form i call it,
I can trigger ChildA (maybe in buttonA) and ChildB (maybe in buttonB) ???
2)
At the of your article, does this code need to be there or be removed?
statirc int WorkerCompletedWork()
{
System.Threading.Thread.Sleep(4000); // is this a must?
}
Coz i am doing a program, that had 2 buttons, if i click buttonA, i hope i
can click on buttonB while buttonA backend is still processing.
Hope someone can clear my doubts! Thanks.
--
Regards,
Chua Wen Ching :)