Skip to main content

Posts

Showing posts from March, 2008

4 years wedding anniversary

Circular Quay, the one of most beautiful site in Sydney. That 's my favourite place to visite. WaterFront Bar, we celebrate the anniversary at there

learn Delegate function in C#

1 advantages for delegate function 1.1 decouple the caller class and callee class.They don't need know any internal detail about each other. 1.2 pass some values and handle from caller to callee. Not for from callee to caller!!! 2 sample code class Callee { private Fucntion Dosomething() { this.NotifyDelegate(); } public delegate void Notify(); //declare a delegate function event instance public event Notify NotifyDelegate; } class Caller { Callee instanceCallee = new Callee(); Callee.NotifyDelegate + = new Notify(NotifyFromCallee) private void Function() { instanceCallee.Dosomething(); } private void NotifyFromCallee() { //blah, blah, blah } }